← Back to team overview

dhis2-devs team mailing list archive

Re: Possible issue with GML import (MapshaperLoader)

 

Hi Sushil,
Just to confirm, will this procedure work for existing orgunits? I recall
the last time when I looked at the app, it did not support the work flow of
updating only the geometry of existing OUs. Could you explain a bit more
about this, i.e. whether it is supported at the moment or not?

Regards,
Jason


On Mon, Mar 30, 2015 at 10:32 AM, Sushil Chitrakar <sushilchitr@xxxxxxxxx>
wrote:

> Hello All,
> in earlier email, I missed the steps to follow to use the app. I am
> including it here.
>
> I have included the steps to follow after installing the app for importing:
>
> 1. open the app.
> 2. choose the level*.shp file. level*.shp file is the shape file that you
> have. First(zero level) is country
> 3. now drag the corresponding .dbf file into the browser. ie dbf file of
> the country ( you can drag or upload both files at once aswell)
> 4. after dragging the .dbf , adjust the detail of map you want to be
> imported using the slider in the browser. You can see slight changes in the
> map detail.
> 5.  now use the button Org Unit to display the list of org units in the
> .dbf file.
> 6. in the same page, you choose column with the id of the org unit, its
> parent, name and short name and level of the organisation units. The
> columns for corresponding data  are listed in the select box on top of
> table.  For  country since its a zero level, it does not have a parent, so
> do not choose anything. For other level like in the first level,
>  development region , you need to choose the id of country or its parent
> there. After choosing all the mandatory fields the Map field button will be
> enabled.
>
> 7. Use the map fields button to map the fields with the database and find
> the parent automatically on the basis of  code.
>
> 8. If the app finds the matching parent it will show up in the parent
> column. If not you will be allowed to choose the parent from the select box.
> 9. Then choose the organisations units that you want to import. After
> choosing the at least one row from the list, import button will be
> displayed.
> 10. then use import button to import the data into the dhis.
>
> 11. If you want to see the GML data, please choose the "show GML text"
> check box.  It will also display the GML data at the right side in a text
> box.
> 12. now follow the same process again.
>
> Please let me know if you find any issue on this.
>
> Regards,
> Sushil
>
> On 29 March 2015 at 19:19, Sushil Chitrakar <sushilchitr@xxxxxxxxx> wrote:
>
>> Hello All,
>>  I am doing master thesis with DHIS2 and developing the app to import the
>> organisation units with the coordinates from the shaperfiles. Here I am
>> including the the app that I am working on and this is kind of first
>> version. I have included the list of work doing in this app and there are
>> many things can be done. Please take a look on this and let me know what do
>> you guys feel about this. For now this does not work in the demo server of
>> DHIS2 simply because of the links to different paths. I am working on that
>> as well.
>>
>> Main Features:
>>
>> 1. remove digits from the coordinates, ie. coordinates will have only 4
>> digits after .(eg: 23.33333333 -> 23.3333)
>> 2. display the dbf values
>> 3. allow user to map the columns with the columns in the DHIS2 database.
>> 4. automatically try to find the parent of each organisation units from
>> the db, if not all user to select the parent.
>> 5. import the organisation units into the db with coordinates.
>>
>> Things you need:
>> 1. Shaper files(.dbf and .shp) for each layer
>> 2. coordinates in the .shp file must be of projection EPSG:4326 in case
>> of DHIS2
>>
>> I hope that you can provided me some feedback on this app and help me
>> work on this more and also for my thesis.  Let me know if you have any
>> issues installing the app or using it. One link that can be helpful for
>> installing the app is:
>> https://www.dhis2.org/doc/snapshot/en/developer/html/ch02s03.html
>>
>> Thanks and best regards,
>> Sushil Chitrakar
>>
>> On 24 March 2015 at 22:42, Knut Staring <knutst@xxxxxxxxx> wrote:
>>
>>> Hi Jason (and Halvdan),
>>>
>>> Not directly related, but since GML is coming up again, it could perhaps
>>> be good to revisit Sushil's app, which is meant to bypass GML and import
>>> shapefiles directly.
>>>
>>> If you (and others on the list) have some time, it would be good to get
>>> more feedback on it.
>>>
>>> Knut
>>>
>>> On Tue, Mar 24, 2015 at 4:05 PM, Halvdan Grelland <halvdanhg@xxxxxxxxx>
>>> wrote:
>>>
>>>> Yeah as discussed just now we should support output from qgis and gdal
>>>> at least. Currently working on that.
>>>>
>>>> 2015-03-24 16:03 GMT+01:00 Jason Pickering <jason.p.pickering@xxxxxxxxx
>>>> >:
>>>>
>>>>> I just exported this from QGIS.  Would seem strange if we could not
>>>>> support this,as it was just an export from a shape file.
>>>>>
>>>>> Regards
>>>>> Jason
>>>>> On Mar 24, 2015 9:30 AM, "Halvdan Grelland" <halvdanhg@xxxxxxxxx>
>>>>> wrote:
>>>>>
>>>>>> Actually, small error in my example: pos elements should have lat and
>>>>>> long separated by whitespace:
>>>>>>
>>>>>> <gml:pos>-45.046450667490049 30.904516454945856</gml:pos
>>>>>>
>>>>>> 2015-03-24 14:05 GMT+01:00 Halvdan Grelland <halvdanhg@xxxxxxxxx>:
>>>>>>
>>>>>>> By the way, here is the relevant quote from the GML Point Profile:
>>>>>>>
>>>>>>> "A Point is defined by a single coordinate tuple, with the
>>>>>>> coordinate values being specified by the gml:pos property. Data instances
>>>>>>> compliant with this profile shall use only the gml:pos property."
>>>>>>>
>>>>>>> 2015-03-24 13:57 GMT+01:00 Halvdan Grelland <halvdanhg@xxxxxxxxx>:
>>>>>>>
>>>>>>>> The gml:Point element only supports gml:pos coordinate tuples (a
>>>>>>>> single one, of course). The gml:coordinates element is expected to have
>>>>>>>> multiple points, which is why it is parsed in that particular way.
>>>>>>>>
>>>>>>>> The only real bug on our part here is that we for some reason allow
>>>>>>>> gml:Point to contain a gml:coordinates element with a single contained
>>>>>>>> coordinate, thus being incorrectly output as seen in Jasons example. I
>>>>>>>> realize we might have allowed this for a while, though, as the logics of
>>>>>>>> this has remained unchanged by the recent GML importer rewrite.
>>>>>>>>
>>>>>>>> My suggestion is that we follow the standard GML point profile and
>>>>>>>> remove support for gml:coordinates within gml:Point entirely. Jason, could
>>>>>>>> you try with the following XML, please:
>>>>>>>>
>>>>>>>>  <gml:featureMember>
>>>>>>>>     <ogr:OpenDemolandHealthFacilities
>>>>>>>> fid="OpenDemolandHealthFacilities.4">
>>>>>>>>       <ogr:geometryProperty><gml:Point
>>>>>>>> srsName="EPSG:4326"><gml:pos>-45.046450667490049,30.904516454945856</gml:pos></gml:Point></ogr:geometryProperty>
>>>>>>>>       <ogr:Name>Crow Site</ogr:Name>
>>>>>>>>       <ogr:NAME_1>Bird</ogr:NAME_1>
>>>>>>>>       <ogr:Region>Animal</ogr:Region>
>>>>>>>>       <ogr:Country>Demoland</ogr:Country>
>>>>>>>>     </ogr:OpenDemolandHealthFacilities>
>>>>>>>>   </gml:featureMember>
>>>>>>>>
>>>>>>>> Of course, If you feel otherwise let me know.
>>>>>>>>
>>>>>>>> Halvdan
>>>>>>>>
>>>>>>>> 2015-03-24 13:09 GMT+01:00 Jan Henrik Øverland <
>>>>>>>> janhenrik.overland@xxxxxxxxx>:
>>>>>>>>
>>>>>>>>> Halvdan, quick fix. Points should never have more than one set of
>>>>>>>>> brackets.
>>>>>>>>>
>>>>>>>>> On Tue, Mar 24, 2015 at 12:01 PM, Jason Pickering <
>>>>>>>>> jason.p.pickering@xxxxxxxxx> wrote:
>>>>>>>>>
>>>>>>>>>> Hi there.
>>>>>>>>>>
>>>>>>>>>> I am using the GML importer to import coordinates.
>>>>>>>>>>
>>>>>>>>>> Here is a snippet of the GML I am importing
>>>>>>>>>>
>>>>>>>>>>  <gml:featureMember>
>>>>>>>>>>     <ogr:OpenDemolandHealthFacilities
>>>>>>>>>> fid="OpenDemolandHealthFacilities.4">
>>>>>>>>>>       <ogr:geometryProperty><gml:Point
>>>>>>>>>> srsName="EPSG:4326"><gml:coordinates>-45.046450667490049,30.904516454945856</gml:coordinates></gml:Point></ogr:geometryProperty>
>>>>>>>>>>       <ogr:Name>Crow Site</ogr:Name>
>>>>>>>>>>       <ogr:NAME_1>Bird</ogr:NAME_1>
>>>>>>>>>>       <ogr:Region>Animal</ogr:Region>
>>>>>>>>>>       <ogr:Country>Demoland</ogr:Country>
>>>>>>>>>>     </ogr:OpenDemolandHealthFacilities>
>>>>>>>>>>   </gml:featureMember>
>>>>>>>>>>
>>>>>>>>>> This seems to import fine, but on the database side, I see this
>>>>>>>>>>
>>>>>>>>>>  Crow Site               | [[-45.0465,30.9045]]
>>>>>>>>>>
>>>>>>>>>> Note, the double square brackets. The GIS says there are no valid
>>>>>>>>>> coordinates.
>>>>>>>>>>
>>>>>>>>>> When I replace these double brackets with single ones
>>>>>>>>>>
>>>>>>>>>> Crow Site               | [-45.0465,30.9045]
>>>>>>>>>>
>>>>>>>>>> Things work OK. This is a 2.19 snapshot version, unsure of the
>>>>>>>>>> revision.
>>>>>>>>>>
>>>>>>>>>> Is this an issue possibly with rev 18488?
>>>>>>>>>>
>>>>>>>>>> Regards,
>>>>>>>>>> Jason
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Jason P. Pickering
>>>>>>>>>> email: jason.p.pickering@xxxxxxxxx
>>>>>>>>>> tel:+46764147049
>>>>>>>>>>
>>>>>>>>>> _______________________________________________
>>>>>>>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>>>>>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>>>>>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>>>>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>
>>>>
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>>
>>>
>>>
>>> --
>>> Knut Staring
>>> Dept. of Informatics, University of Oslo
>>> Norway: +4791880522
>>> Skype: knutstar
>>> http://dhis2.org
>>>
>>
>>
>


-- 
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049