[gdal-dev] Error using ogr2ogr to create SpatiaLite database

Simon O'Keefe simon.okeefe at groundtruth.com.au
Sun Mar 28 18:35:28 EDT 2010

Thanks Even.

By specifying -a_srs EPSG:4326, ogr2ogr no longer crashes, and I can
now view the output SQLite file in SpatiaLite-GIS. Here is my new

ogr2ogr -f SQLite C:\Data\db.sqlite C:\Data\states.shp -a_srs
EPSG:4326 -dsco SPATIALITE=yes

And thanks for creating a ticket and fixing this issue for future
releases so that a fake SRS authority name is automatically inserted
when ogr2ogr cannot identify the SRS of the shapefile:



On 29 March 2010 00:30, Even Rouault <even.rouault at mines-paris.org> wrote:
> Simon,
> I also reproduce the problem. It is not platform related. There are various
> problems in the way the spatial_ref_sys is handled, that I'm currently
> fixing. The problem is that the SRS of the shapefile is not properly
> recognized and translated in the spatial_ref_sys table.
> You can workaround it by adding -a_srs EPSG:4326 on the command line.
> Best regards,
> Even
> Le Sunday 28 March 2010 14:23:14 Simon O'Keefe, vous avez écrit :
>> Hi,
>> (I posted this issue to the FWTools mailing list a week ago, but have
>> not yet received a response.)
>> I'm attempting to create a new SQLite database from a SHP file using
>> FWTools2.4.7 on Windows 7. The following command:
>> ogr2ogr -f SQLite C:\Data\db.sqlite C:\Data\states.shp -dsco SPATIALITE=yes
>> generates the following error:
>> ogr2ogr.exe has stopped working
>> A problem caused the program to stop working correctly. Windows will
>> close the program and notify you if a solution is available.
>> The example uses 'states.shp' from the GeoServer sample data, but the
>> error occurs with other SHP files as well.
>> I'm able to create a SQLite file by leaving out SPATIALITE=yes, but
>> when I open the resulting file in SpatiaLite-GIS, it complains of
>> "Missing or invalid Spatial Metadata tables: spatial_ref_sys,
>> geometry_columns".
>> Is anyone able to create a proper SpatialLite database from a SHP file
>> using ogr2ogr?
>> Cheers,
>> Simon
>> _______________________________________
>> Simon O'Keefe
>> Geospatial Systems Developer
>> Groundtruth Mapping Systems
>> Level 2, 140 Queen Street
>> Melbourne VIC 3000 Australia
>> phone:  +61 409 413 890
>> email:  simon.okeefe at groundtruth.com.au
>> web:    http://www.groundtruth.com.au
>> _______________________________________
>> _______________________________________________
>> gdal-dev mailing list
>> gdal-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/gdal-dev

More information about the gdal-dev mailing list