← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis2-users] Shapefile Conversion to GML

 

To add to Brams mail, I have had issues with MapShaper and the DBF's it
produces. Normally, I just trash these, and use the original DBF from the
unmodified shapefile.

I am still not convinced it is a problem with the DBF though, as clearly
the projection which you provided in the first conversion was not correct.

Regards,
Jason



On Tue, Apr 1, 2014 at 5:00 PM, Bram Piot <bram.piot@xxxxxxxxx> wrote:

> Hi Adedayo,
>
> If you need to modify attributes in the dbf file, you should only do this
> in a GIS software such as www.qgis.org - never modify the dbf on its own
> (eg in Excel) as this will result in a corrupt shapefile. It's also much
> easier to define the projection or to convert to a different projection in
> QGIS, and once you have your shapefile ready you can simply save it as a
> gml file.
>
> bram
>
>
> On 1 April 2014 17:47, Dayo Adeyomoye <deemoyes@xxxxxxxxx> wrote:
>
>> Thanks a lot Jason. I also tried converting without first trying to
>> convert to 4326 knowing that it may already be in that projection. I
>> noticed later on that This conversion worked if i didn't use the original
>> dbf file that I downloaded with it. I mean it converted when I used the dbf
>> file generated after working on it at mapshaper.org.
>>
>> As soon as I changed the dbf file to the one downloaded from the
>> shapefile site, it produced the error.
>>
>> The dbf file might be bad though. I have downloaded another from a new
>> site and hopefully it will work.
>>
>> Regards,
>>
>> Adedayo
>>
>> BlackBerry: 3114F90C
>> Phone: 08028851441, 08035560463
>> emails: deemoyes@xxxxxxxxx, addyraph@xxxxxxxxx
>> Yahoo IM: deemoyes
>> Facebook: pharael
>> twitter:pharaell
>>   On Tuesday, April 1, 2014 3:19 PM, Jason Pickering <
>> jason.p.pickering@xxxxxxxxx> wrote:
>>  Well, it seems pretty clear from the logs.
>>
>> Failed to process SRS definition: EPSG:14684
>>
>> Try looking here http://www.epsg-registry.org/
>>
>> and this is not a valid projection.
>>
>> However, looking from the bounding box, it looks like it may be 4326 to
>> begin with.
>>
>> Why do you think you need to use  EPSG:14684  as the source projection?
>>
>> Regards,
>> Jason
>>
>>
>>
>> On Tue, Apr 1, 2014 at 12:47 PM, Dayo Adeyomoye <deemoyes@xxxxxxxxx>wrote:
>>
>>  Dear All,
>>
>> I have been trying to convert my shapefile for Nigeria Admin0 and Admin1
>> levels into GML but its not working. I was able to convert the Admin2 at
>> but I am wondering, what could be the problem here.
>>
>> I also tried converting without copying the dbf file from the Admin file
>> downloaded and it converted without errors but as soon as I tried to use it
>> with the dbf file that i copied from the download admin file for Nigeria, I
>> am unable to convert it.
>>
>> Below is the response while trying to do that.
>>
>>  Regards,
>>
>> Adedayo
>>
>> C:\Users\aadeyomoye\Desktop\Mine\DHIS2 Academy\NGA Admin1 Optimized
>> Shapefile>og
>> r2ogr -s_srs EPSG:14684 -t_srs EPSG:4326 -f GML NGA_adm1.gml NGA_adm1.shp
>> ERROR 6: EPSG PCS/GCS code 14684 not found in EPSG support files.  Is
>> this a val
>> id
>> EPSG coordinate system?
>> Failed to process SRS definition: EPSG:14684
>>
>> C:\Users\aadeyomoye\Desktop\Mine\DHIS2 Academy\NGA Admin1 Optimized
>> Shapefile>og
>> rinfo -al -so NGA_adm1.shp
>>  INFO: Open of `NGA_adm1.shp'
>>       using driver `ESRI Shapefile' successful.
>>
>> Layer name: NGA_adm1
>> Geometry: Polygon
>> Feature Count: 38
>> Extent: (2.668431, 4.270418) - (14.680070, 13.892010)
>> Layer SRS WKT:
>> (unknown)
>> ID_0: Integer (9.0)
>> ISO: String (3.0)
>> NAME_0: String (75.0)
>> ID_1: Integer (9.0)
>> NAME_1: String (75.0)
>> VARNAME_1: String (150.0)
>> NL_NAME_1: String (50.0)
>> HASC_1: String (15.0)
>> CC_1: String (15.0)
>> TYPE_1: String (50.0)
>> ENGTYPE_1: String (50.0)
>> VALIDFR_1: String (25.0)
>> VALIDTO_1: String (25.0)
>> REMARKS_1: String (125.0)
>> Shape_Leng: Real (19.11)
>> Shape_Area: Real (19.11)
>>
>>  C:\Users\aadeyomoye\Desktop\Mine\DHIS2 Academy\NGA Admin1 Optimized
>> Shapefile>og
>> r2ogr -f GML NGA_adm1.gml NGA_adm1.shp
>> ERROR 1: Error in fread() reading object of size 101852 from .shp file
>> ERROR 1: Error in fread() reading object of size 4872 from .shp file
>> ERROR 1: Error in fread() reading object of size 7032 from .shp file
>> ERROR 1: Error in fread() reading object of size 917484 from .shp file
>> ERROR 1: Error in fread() reading object of size 7592 from .shp file
>> ERROR 1: Error in fread() reading object of size 21800 from .shp file
>> ERROR 1: Error in fread() reading object of size 41080 from .shp file
>> ERROR 1: Error in fread() reading object of size 719100 from .shp file
>> ERROR 1: Error in fread() reading object of size 5048 from .shp file
>> ERROR 1: Error in fread() reading object of size 10424 from .shp file
>> ERROR 1: Error in fread() reading object of size 4152 from .shp file
>> ERROR 1: Error in fread() reading object of size 5352 from .shp file
>> ERROR 1: Error in fread() reading object of size 4520 from .shp file
>> ERROR 1: Error in fread() reading object of size 2728 from .shp file
>> ERROR 1: Error in fread() reading object of size 2968 from .shp file
>> ERROR 1: Error in fread() reading object of size 9160 from .shp file
>> ERROR 1: Error in fread() reading object of size 11704 from .shp file
>> ERROR 1: Error in fread() reading object of size 7112 from .shp file
>> ERROR 1: Error in fread() reading object of size 13656 from .shp file
>> ERROR 1: Error in fread() reading object of size 11976 from .shp file
>> ERROR 1: Error in fread() reading object of size 12568 from .shp file
>> ERROR 1: Error in fread() reading object of size 19960 from .shp file
>> ERROR 1: Error in fread() reading object of size 44344 from .shp file
>> ERROR 1: Error in fread() reading object of size 11288 from .shp file
>> ERROR 1: Error in fread() reading object of size 18648 from .shp file
>> ERROR 1: Error in fread() reading object of size 21624 from .shp file
>> ERROR 1: Error in fread() reading object of size 62728 from .shp file
>> ERROR 1: Error in fread() reading object of size 5256 from .shp file
>> ERROR 1: Error in fread() reading object of size 11880 from .shp file
>> ERROR 1: Error in fread() reading object of size 5864 from .shp file
>> ERROR 1: Error in fread() reading object of size 965796 from .shp file
>> ERROR 1: Error in fread() reading object of size 9544 from .shp file
>> ERROR 1: Error in fread() reading object of size 19160 from .shp file
>> ERROR 1: Error in fread() reading object of size 7384 from .shp file
>> ERROR 1: Error in fread() reading object of size 8968 from .shp file
>> ERROR 1: Error in fread() reading object of size 7592 from .shp file
>>
>> C:\Users\aadeyomoye\Desktop\Mine\DHIS2 Academy\NGA Admin1 Optimized
>> Shapefile>og
>> r2ogr -t_srs EPSG:4326 -f GML NGA_adm1.gml NGA_adm1.shp
>> Can't transform coordinates, source layer has no
>> coordinate system.  Use -s_srs to set one.
>>
>> BlackBerry: 3114F90C
>> Phone: 08028851441, 08035560463
>> emails: deemoyes@xxxxxxxxx, addyraph@xxxxxxxxx
>> Yahoo IM: deemoyes
>> Facebook: pharael
>> twitter:pharaell
>>
>> _______________________________________________
>> 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-users
>> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> 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
>
>

Follow ups

References