← Back to team overview

dhis2-users team mailing list archive

Re: Setting up GIS

 

I guess you gave the .shp and .shx files a different
name ("MOZ_adm1_polygons_ms1") instead of just replacing the original ones.
Which means they are no longer linked to the rest of the shapefile set..
Use the same name and

ogrinfo -al -so

should say "WGS_1984". Then you can just do

ogr2ogr -f GML MOZ_adm1.gml MOZ_adm1.shp

and Bob's your uncle.


On Tue, Feb 26, 2013 at 4:19 PM, Paulo Grácio <paulogracio@xxxxxxxxx> wrote:

> I just get the following warning message
>
> Warning 1: Layer name 'MOZ_adm1-polygons-ms1' adjusted to
> 'MOZ_adm1_polygons_ms1' for XML validity. Output attached.
>
> Nevertheless, I was expecting something similar to this structure
>         (...)
>         <gml:featureMember>
>         <ogr:admin2 fid="F0">
>             <ogr:geometryProperty>
>                 (...)
>             </ogr:geometryProperty>
>             <ogr:ADMINID>6940101</ogr:ADMINID>
>             <ogr:ADM1_NAME>Southern</ogr:ADM1_NAME>
>             <ogr:Name>Bo</ogr:Name>
>             <ogr:ISO_CTRY>SL</ogr:ISO_CTRY>
>             <ogr:POPDENS90>37</ogr:POPDENS90>
>             <ogr:TOT_POP90>213</ogr:TOT_POP90>
>             <ogr:ADM1CODE>69401</ogr:ADM1CODE>
>             <ogr:LVLID>SLP002004000000000000</ogr:LVLID>
>             <ogr:OLDLVLID>SLP002001000000000000</ogr:OLDLVLID>
>         </ogr:admin2>
>     </gml:featureMember>
>     (...)
>
> this is based on the test resources for dhis-service-importexport.
>
> Paulo
>
> On 26 February 2013 15:04, Jan Henrik Øverland
> <janhenrik.overland@xxxxxxxxx> wrote:
> > Ok, then try the same command, just replace -t_srs with -s_srs.
> >
> >
> > On Tue, Feb 26, 2013 at 3:59 PM, Paulo Grácio <paulogracio@xxxxxxxxx>
> wrote:
> >>
> >> Hello Jan,
> >>
> >> thanks for the reply.
> >>
> >> Executing the command you suggested I'm having the following error:
> >>
> >> Can't transform coordinates, source layer has no
> >> coordinate system.  Use -s_srs to set one.
> >>
> >> Regards,
> >> Paulo Grácio
> >>
> >>
> >> On 26 February 2013 12:53, Jan Henrik Øverland
> >> <janhenrik.overland@xxxxxxxxx> wrote:
> >> > Hi, please try
> >> >
> >> > ogr2ogr -t_srs EPSG:4326 -f GML MOZ_adm1-polygons-ms1.gml
> >> > MOZ_adm1-polygons-ms1.shp
> >> >
> >> >
> >> > On Tue, Feb 26, 2013 at 1:31 PM, Paulo Grácio <paulogracio@xxxxxxxxx>
> >> > wrote:
> >> >>
> >> >> Hello,
> >> >>
> >> >> I have been following Chapter 16. Setting up GIS of DHIS User Manual.
> >> >> After download Spatial Data from http://www.diva-gis.org
> >> >>
> >> >> Country: Mozambique
> >> >> Subject: Administrative areas (GADM)
> >> >>
> >> >> I used MapShaper to simplify geographical data according to the
> >> >> described, but on Step 2 - Convert the shapefile to GML, I got stuck.
> >> >> Running ogrinfo -al -so MOZ_adm1-polygons-ms1.shp the output is
> >> >>
> >> >> INFO: Open of `MOZ_adm1-polygons-ms1.shp'
> >> >>       using driver `ESRI Shapefile' successful.
> >> >>
> >> >> Layer name: MOZ_adm1-polygons-ms1
> >> >> Geometry: Polygon
> >> >> Feature Count: 10
> >> >> Extent: (30.217328, -26.868695) - (40.839361, -10.471250)
> >> >> Layer SRS WKT:
> >> >> (unknown)
> >> >>
> >> >> Having this as an output what's the correct way to create the GML
> file?
> >> >>
> >> >>
> >> >> Kind regards,
> >> >> Paulo Grácio
> >> >>
> >> >> _______________________________________________
> >> >> 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
>

References