← Back to team overview

dhis2-users team mailing list archive

Re: GML Import not displaying under org units

 

Hi Dayo,

I personally think the easiest way is to create your DXF2  (that is the XML
format of DHIS2)  for the hierarchy first as you wish. There are many
different ways to do this. I personally use the R programming language, but
I am sure others use things like Python, Java, etc. It really makes little
difference how you chose to do it. I have also used PostGIS in the past to
directly inject the geographical data into the "organisationunit" table,
although this approach should be handled carefully. So short story is,
there are many different approaches, and may depend on which tools you are
most comfortable with.

Once the hierarchy has been created and imported, you can them use the GML
import to get in the coordinates.  This is really only a convenience
mechanism, because normally you are exporting from a shape file to GML and
there are lots of tools to this. The advantage of importing via GML as
well, is that DHIS2 will truncate the precision of your coordinates to four
decimal places, which can be a bit tricky otherwise.  It is a bit trickier
now that "names" in DHIS2 are not unique, so you should probably use the
"code" field to match on.

But if you want to pursue the "pure" DXF route, you would need to be sure
that your geographical data is in GeoJSON format, and that you add a node
in the DXF "featureType" which would correspond to either "Polygon" or
"Point", along with valid GeoJSON formatted data to the "coordinates" node.

Hope this helps.

Best regards,
Jason



On Thu, Dec 19, 2013 at 5:15 PM, Dayo Adeyomoye <deemoyes@xxxxxxxxx> wrote:

> Thank you, could you please help with this format? I am thinking of just
> editing the xml i got using the web api resources, I want to edit it and
> then send it in using curl.
>
> Asides this, how do I get to delete all these imported org units and
> coordinates? Reason being that when ever I try to create these imported
> coordinates that created this org units, it tells me that there name
> already exist.
>
> Many thanks.
>
> Adedayo
>
> BlackBerry: 3114F90C
> Phone: 08028851441, 08035560463
> emails: deemoyes@xxxxxxxxx, addyraph@xxxxxxxxx
> Yahoo IM: deemoyes
> Facebook: pharael
> twitter:pharaell
>
>
>   On Thursday, December 19, 2013 3:10 PM, Dayo Adeyomoye <
> deemoyes@xxxxxxxxx> wrote:
>  Thanks,
>
> I am sure DXF2 means DHIS2 Xchange Format right? how do I do this. I am
> thinking of using the Meta-data import tool after creating my xml file
> using curl.
>
> What do you think?
>
>
>
> BlackBerry: 3114F90C
> Phone: 08028851441, 08035560463
> emails: deemoyes@xxxxxxxxx, addyraph@xxxxxxxxx
> Yahoo IM: deemoyes
> Facebook: pharael
> twitter:pharaell
>
>
>   On Wednesday, December 18, 2013 5:18 PM, Knut Staring <knutst@xxxxxxxxx>
> wrote:
>  Hi Dayo,
> Unfortunately, it does not quite work with just the level, you also have
> to specify the PARENT.
> Sent from my mobile
> On 18 Dec 2013 17:09, "Dayo Adeyomoye" <deemoyes@xxxxxxxxx> wrote:
>
> Dear All,
>
> I imported GML file into DHIS2 for coordinates without having the org
> units there already as they are many (775). This import was successful but
> I did not find this org units under the org unit tree. I know DHIS2 allows
> only 1 org unit at the level 1, so I did a meta data export of only org
> units and found that this imported org units from GML are all on level 1,
> perhaps the reason for not showing up.
>
> I then opened this xml file using an xml editor to replaced all level=1""
> org units to be level="2" and then returned the master org unit to
> level="1" since the replace all would have also changed it. I imported this
> file, which was also successful but I still can not find this org units,
> reason probably being that no change was effected in the database because
> when I do an export again and access the xml file, the changes I made and
> imported does not reflect. It gives me the same old export.
>
> Thanks
>
> BlackBerry: 3114F90C
> Phone: 08028851441, 08035560463
> emails: deemoyes@xxxxxxxxx, addyraph@xxxxxxxxx
> Yahoo IM: deemoyes
> Facebook: pharael
> twitter:pharaell
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>
>
>
>
>

Follow ups

References