abyot / sun-pmt

BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Clarify the "code" requirements for shapefiles and org units #74

Closed chloedenavit closed 6 years ago

chloedenavit commented 6 years ago

This was not clear in our guidance. Can you confirm that we should open the shapefiles to edit the codes, and the create GMT files to upload into the tool?

abyot commented 6 years ago

First the shapefile needs to be converted to GML. There are multiple tools / approaches. DHIS2 documentation explains one.

Here is what you can do to import GML into DHIS2.

  1. Open the following link (this is from Zimbabwe server) http://154.120.241.124:8080/dhis/api/organisationUnits.json?paging=false&fields=displayName,featureType,coordinates

It lists all orgunits together with their feature type and corresponding coordinate.

  1. Look into this https://docs.dhis2.org/master/en/user/html/dhis2_user_manual_en_full.html#gis_creating_setup Since you already have GML, you can start from Step 3.

Open the GML file in Notepad++. It is important that you use Notepad++ - as it won't add unnecessary line feed and related characters.

  1. Use search and replace

Replace ogr:DISTNAME with ogr:Name Save.

  1. Go to Apps -> Import/Export -> GML Import Import the GML file you just saved.

The system will display how many imported, how many ignored depending on the match you have between your orgunits's name and the name you have in the GML file.

  1. You can also go and open the link from step 1 and compare the result. http://154.120.241.124:8080/dhis/api/organisationUnits.json?paging=false&fields=displayName,featureType,coordinates