DHIS 2 GIS User Manual

Jan Henrik Øverland

Jason Paul Pickering

Revision History
Revision 112/09/2009JPP

Initial conversion of document to DocBook format

Table of Contents

8.1. Conversion of geographical data to GeoJSON format
8.1.1. Production of GeoJSON files with Geoserver
8.1.2. Production of GeoJSON files with GDAL
8.1.3. Copying files to the DHIS application
8.2. Administrator panel
8.3. Registering geographical information
8.4. Assign organization units to map
8.5. Register overlays
8.6. Thematic map
8.7. Register views
8.8. Register legend sets

8.1. Conversion of geographical data to GeoJSON format

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

8.1.1. Production of GeoJSON files with Geoserver

Geoserver is capable of outputting GeoJSON formats. If you have geoserver running someplace, you can execute the following query.

http://localhost:8080/geoserver/ows?service=WFS&version=1.0.0&request=GetFeature&typename=topp:states&outputformat=json&srs_name=EPSG:4326

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".

8.1.2. Production of GeoJSON files with GDAL

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.

8.1.3. Copying files to the DHIS application

Currently, your GeoJSON files should be placed in the DHIS_HOME/geoson of your DHIS application to be accessible to the GIS module. If the GeoJSON directory does not exist, you will need to create it manually and copy your GeoJSON files there.