How to extract org unit with coordinates in excel format

Hello All,
Kindly guide/help to extract the org unit with its coordinates in excel format.

Thanking you in advance.

2 Likes

Hi Sangay,

Because Org Unit coordinates are a top-line attribute, you can easily use the API to do this. Just paste the following into your browser:

https://play.dhis2.org/2.31.0/api/organisationUnits.csv?fields=name,code,featureType,coordinates&paging=false

Just to explain the API call:

  • everything up until /api/ is the server - replace this with your own server
  • everything after /api/ is your query
  • you’re querying the collection organisationUnits
  • .csv means return the information in CSV (Excel) format instead of XML
  • fields lists the fields/attributes that you want to see
  • ‘featureType’ is the type of coordinates: POINT means a point on the map (eg a clinic), POLYGON means an area on the map (eg a district), which is defined as a series of joined-up points
  • paging=false means return this data for every Org Unit (otherwise it will just give you the first 50 records); note that this API call will only return Org Units to which your user has access, so different users may see a different list of Org Units.

Happy querying!

3 Likes

Thank you sir. Really appreciate it

1 Like