1 Attachment(s)
Creating an 11 digit number
I am currently undertaking a task to identify all physical structures within the Great Barrier Reef Marine Park. The listing from the body charged with the responsibility to govern the GBRMPA has kindly provided a list of their recognised structures however it has become so what compromised when converting into Excel. In the attached file you will see that Column A contains the Structure ID, Column B contains the type of Structure. The 11 digit number they use and the one I need to replicate if possible is derived from the following set of rules;
As supplied by the Manager of the Geospacial section of the GBRMPA
Quote:
"The UNIQUE_ID number is an automatically generated attribute, only used internally to allow the Oracle database to identify each feature. The number is a combination of the GBR_ID, SUB_NO and FEATURE_C attributes.
Quote:
The GBR_ID is the feature identification number - e.g. Hamilton Island is 20-057.
The SUB_NO is a three-digit number that identifies multiple features of the same type in a group, e.g. multiple reefs surrounding an island are labelled a, b, c, d etc. - these will be numbered 101, 102, 103, 104 etc. If it refers to a single feature it will be given the number 100. So for example Marquis Island which has an ID of 22-063b will have a corresponding sub number of 102.
The FEATURE_C is an automatically generated three-digit number representing the type of feature eg mainland, island, cay etc. (100, 102, 103)
- Mainland features = 100
- Islands = 102
- Cays = 103
- Reefs = 104
- Rocks = 106 and 108"."
The first five numbers of the 11 digit number is the GBR-id (Column A minus the hyphen and or an alphabetical letter if more than one), then the Sub_No number, then the Feature-C number (Column B). If I use the example of Hamilton Island 20-057 then the unique number should be 20057101102. To add to the complexity, ( and for reasons I don't understand), if you search for 20-041, you will find a nightmare...
20-041 U/N Rock
20-041 Fitzaland Island Reef
20-041 Whitsunday Island
20-041 Whitsunday Island Reef (N0 1) and so on.
20-041 U/N Rock should be 20041101106. Reasoning: 20-041 without the hyphen, 101 for the first of it type, and 106 because its a rock,
20-041 Fitzaland Island Reef should be 20041101104. Reasoning: 20-041 without the hyphen, 101 for the first of its type, and 104 because its a reef,
20-041a Whitsunday Island should be 20041101102. Reasoning: 20-041 without the hyphen and the "a", 101 for the first of its type, and 102 because its an island,
20-041a Whitsunday Island Reef (No 1) should be 20041102104. Reasoning: 20-041 without the hyphen and the "a", 102 because its the second of its type, and 104 because its a reef,
20-041b Whitsunday Island Reef (N0 2) should be 20041103104. Reasoning: 20-041 without the hyphen and the "b", 103 because its the third of its type, and 104 because its a reef,
20-041b Fitzaland Island should be 20041102102. Reasoning: 20041 without the hyphen and the "b", 102 beause its the second of it type, and 102 because its an island.
Can anyone assist me in developing a method the create this unique 11 digit number so I can use it to implement a database where the Structures are clearly identified despite carrying an "complicated" GBR_No?