GML Import not displaying under org units

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@yahoo.com, addyraph@yahoo.com
Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

Hi Dayo,
I do not think this is a really possible to do with GML, as there are no child-parent relationships which are imported. (Could be wrong here, but I do not think so)

I would think you would need to

  1. Import the hierarchy using DXF2

  2. Import the geographical data using GML.

or alternatively

  1. Just used DXF to import both the hierarchy as well as the geographical data together.

Simply changing the level will have no effect, as this is determined through the parent-child relationships of the orgunits themselves.

Regards,

Jason

Regards,

Jason

···

On Wed, Dec 18, 2013 at 6:09 PM, Dayo Adeyomoye deemoyes@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

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@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

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@yahoo.com, addyraph@yahoo.com
Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

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@yahoo.com, addyraph@yahoo.com
Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

Hi Dayo,

Unfortunately, it does not quite work with just the level, you also have to specify the PARENT.

···

On Thursday, December 19, 2013 3:10 PM, Dayo Adeyomoye deemoyes@yahoo.com wrote:
On Wednesday, December 18, 2013 5:18 PM, Knut Staring knutst@gmail.com wrote:

Sent from my mobile

On 18 Dec 2013 17:09, “Dayo Adeyomoye” deemoyes@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

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@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

On Thursday, December 19, 2013 3:10 PM, Dayo Adeyomoye deemoyes@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

On Wednesday, December 18, 2013 5:18 PM, Knut Staring knutst@gmail.com 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@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

Thanks Jason,

I use the Adobe Dreamweaver as my editor. I have exported from the system and made some changes and want to import back. Could you please look at the attached xml file to see how it goes? Asides this, which is the best and easiest way to delete the coordinates that I imported before now through GML? This coordinates that I imported through GML created the org units in the system. The org units are not visible under org units and whenever I try to create an org unit with such name it warns me. Knowing well that names are not unique identifies as such anymore, I did not recreate it.

Could you please help?

Many thanks,

Adedayo

BlackBerry: 3114F90C
Phone: 08028851441, 08035560463
emails: deemoyes@yahoo.com, addyraph@yahoo.com
Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

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

LGAImportSample.xml (358 KB)

···

On Thursday, December 19, 2013 4:28 PM, Jason Pickering jason.p.pickering@gmail.com wrote:

On Thu, Dec 19, 2013 at 5:15 PM, Dayo Adeyomoye deemoyes@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

On Thursday, December 19, 2013 3:10 PM, Dayo Adeyomoye deemoyes@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell

On Wednesday, December 18, 2013 5:18 PM, Knut Staring knutst@gmail.com 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@yahoo.com 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@yahoo.com, addyraph@yahoo.com

Yahoo IM: deemoyes
Facebook: pharael
twitter:pharaell


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp