← Back to team overview

dhis2-devs team mailing list archive

GIS layers and loading the hierarchy

 

On Thu, Nov 11, 2010 at 6:05 PM, Jan Henrik Øverland
<janhenrik.overland@xxxxxxxxx> wrote:
> Hi,
> I would like to suggest that we finally remove the map source types
> "GeoJSON" and "Shapefiles" from the GIS client. They are not able to offer
> most of the functionality that will be implemented in the future and even
> maintaining them as they are would hamper the development of new
> functionality considerably. However, overlays could still be loaded from
> local geojson files.
> In other words, I would like to control the geojson input to the thematic
> widgets completely by letting our own server produce it.

I think this is mostly ok, but I also think it requires us to improve
the importing and limit it to one polygon layer and one point layer -
see below

> This geojson may contain data from Geoserver, health surveys etc.

Not quite I understand - you mean we can import data from such
sources? As far as I know, that is not the case now - we can only
import from GML.

Recent discussion on the list has revived the need for more support
for data loading.  I think the hierarchy is a good place to start
improving. I have come to realize that it is actually a bit stupid to
import polygons at different levels (nation, province, district,
subdivision etc), because the higher levels should logically
correspond to fusion of lower level polygons. Therefore, I suggest the
following algorithm for starting in a new country:

1) Start with the lowest level for which you have polygons (e.g.
shapefiles), and simplify it to an acceptable degree (using e.g.
Mapshaper)

2) Create the organizational hierarchy in a standardized .xlsx
template with a worksheet that has columns like this:

Country, Province, District, Subdistrict, Facility (the number of
levels and their names will vary - this should probably be specified
in a front worksheet.

Make sure the names of the level in step 1) correspond exactly to the
shapefile names.

Also, there will be two columns at the end, immediately after
facilities, which can be filled with point coordinates if available.

3) Upload the Excel file to DHIS2, which will run it through an XSL
transformation that builds the whole hierarchy

4) Upload the simplified polygon layer. DHIS2 will not only poplulate
the orgunits for that level as it does currently, but also
automatically *all levels above".

For step 4, we probably need to use GIS Java capabilities like JTS or
Geotools (maybe even steal some code from Geoserver, uDig or OpenJump)
http://lin-ear-th-inking.blogspot.com/2007/11/fast-polygon-merging-in-jts-using.html.
With such tools in place, we could probably also do the simplification
in step 1, but it is actually quite good for people to have the
manually guided visualization that Mapshaper offers instead of
automated generalization.

Knut



Follow ups