Table of Contents
The DHIS2 mapping client relies on GeoJSON files in order to display a map in the browser window. Often times, geographical data is received in many different formats, but the ESRI shape file format is one of the most common. Several procedures will be described below. It is important, but not required, that the names in your geographical data match those in the DHIS2 organizational hierarchy. If they do not, you will need to manually match them in a later step
Geoserver is capable of outputting GeoJSON formats. If you have geoserver running someplace, you can execute the following query.
Take note that you need to specify the spatial coordinate system. By defualt, Geoserver will return GeoJSON files with the format "long/lat" while the DHIS mapping client expects the ordering of the coordinates in "lat/long" format. The expllicit declartaion of the spatial reference system will ensure that coordinates are returned in the proper order. At the time of writing, the DHIS mapping client does not support spatial reference systems other than EPSG 4326. If you are using Geoserver, the application will handle the reprojection from the native format of the geographical data to EPSG 4326. If you are using other methods as described below to generate the GeoJSON file, you will need to ensure that the GeoJSON output is set to EPSG 4326 (Geographical Lat/long).
You will need to adjust the host destination if the machine is not
your local machine as well as defining the actual layer in Geoserver
which should be output to GeoJSON (in this case
topp:states).
Upon execution of the URL, Geoserver will produce a GeoJSON file, and you will be asked to save it. Once it has finished downloading, rename the file following the suggested naming convention:
ISO2CountryCode followed by an underscore, followed by the layer type (e.g. “admin” for administrative layers, “health” for health administrative boundaries). For instance, the first administrative layer for Zambia would be named as "zm_admin1".
GDAL is a multi-platform toolkit for the manipulation of geographical data. It is freely available for a wide-range of platforms at http://gdal.org
Production of GeoJSON files are straightforward with GDAL. Just execute (on Windows)
ogr2ogr.exe -f "GeoJSON" dst_datasource_name src_datasource_name
or on Linux
ogr2ogr -f "GeoJSON"dst_datasource_name src_datasource_name
Replace dst_datasource_name with the path
to the destination geographical data file (following the naming
convention described above) and
src_datasource_name with the source geographical
data file. Take note that you may need to specify input and output coordinate systems as described above.