Replies: 1 comment
-
Admin IDA core concept in the admin layers that has profound implication in respect to admin layers management is the admin identifier.
The admin ID is a integer resulted by rounding down the float latlon coordinates of the admin unit centroid with a specific chosen precision. Thsi loss of precision is crucial because it is insensitive to small changes in admin unit geometry ensuring a smooth update process in future as the ID is no longer tightly coupled with any properties of the admin units. Admin 0 IDThe admin0 id is the simplest one and is completely defined by ISO3 country code. This code consisting of three characters is converted to integer number suing the ASCII table. It is mandatory for this layer to contain all UN member states and optional to contain all affiliated/associated disputed/non-disputed territories. Admin 1 IDThe admin1 ID is an integer code consisting of a fixed part (country code) made up of six digits and a second part composed of coordinates of the centroid of the admin entity generated with 4 digits precision . graph TD
%%classDef
classDef classAlert fill:pink,color:white,stroke-width:1px,stroke:darkRed;
classDef classOk fill:green,color:#00FF00,stroke-width:2px,stroke:darkGreen;
classDef classWarn fill:orange,color:#FF0,stroke-width:2px,stroke:darkOrange;
classDef red color:darkRed
%%flowchart
ID1[657071716405630425]
ID1-->|ASCII codes| CC[657071]
CC-->|A|FIRST[65]
CC-->|F|SECOND[70]
CC-->|G|THIRD[71]
ID1 -->|LON| LON[716405]
ID1 -->|LAT| LAT[630425]
LON --> ILON[71 - rescale lon to 10:99]
LON --> PLON[6405 - rescale lon to 10:99]
%%Style
class CC classAlert;
class FIRST classOk;
class SECOND classOk;
class THIRD classOk;
Admin 2 IDThe admin2 ID is composed of the admin1 ID (country+province) plus the identically encoded coordinates of the centroid of admin2 entity For example the admin2 ID for district Ambriz in Angola has value: 6571795799524857835253 generated with 2 digits precision where: graph TD
%%classDef
classDef classAlert fill:pink,color:white,stroke-width:1px,stroke:darkRed;
classDef classOk fill:green,color:#00FF00,stroke-width:2px,stroke:darkGreen;
classDef classWarn fill:orange,color:#FF0,stroke-width:2px,stroke:darkOrange;
classDef red color:darkRed
%%flowchart
ID2["`**6571795799524857835253**`"]
ID2-->|country code| CC[657179]
ID2-->|centroid coords| ID1[57995248]
ID2-->|centroid coords| SID2[57835253]
%%Style
class ID2 classWarn
class CC classAlert;
class ID1 classOk;
class SID2 classOk;
Generating id from centroid with specific precisiongraph TD
%%classDef
classDef classAlert fill:pink,color:darkRed,stroke-width:1px,stroke:darkRed;
classDef classOk fill:green,color:#00FF00,stroke-width:1px,stroke:darkGreen;
classDef classWarn fill:orange,color:black,stroke-width:1px,stroke:darkOrange;
classDef red color:darkRed
%%flowchart
G[Admin Unit Geometry]-->|centroid|LL[Coordinates]-->|scaling 10:99|SC[Positive coords]-->|*10**precision|IC[Integer coordinates]-->|string&merge|ID[integer unique ID]
%%Style
class G classAlert;
class LL classWarn;
class SC classWarn;
class IC classWarn;
class ID classOk;
The implementation is available at |
Beta Was this translation helpful? Give feedback.
-
Context
Administrative divisions represent an important concept in development policy making because they constitute the fundamental spatial units suitable to carry out and monitor development work.
In Geohub administrative divisions are used to:
Requirements
It follows from the above the admin layers have to satisfy following requirements:
All this logic needs to be developed as an automated processing pipeline and deployed in a suitable environment.
Sources
While there are multiple sources of administrative divisions we have identifies geoboundaries CGAZ as a potential data source. Another potential source is UNICEF GeoRepo
Currently I have identified the fieldmaps as a potential data source
Implementation proposal
The admin layers needs be stored in the PostGIS database and for this reason the most straightforward option seems to be
pg_cron to launch the update and then a series of triggers to implement all functionality defined in the requirements.
Alternatively, the implementation could be python based and deployed as an azure function or an equivalent solution in kubernetes.
Timeline
Beta Was this translation helpful? Give feedback.
All reactions