[gdal-dev] Problem with merging SHAPEs into SpatiaLite

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Tue Oct 3 11:51:52 PDT 2017


Casper Børgesen-2 wrote
> Hi devs
> 
> I am trying to merge a bunch of SHAPE files into a few SpatiaLite files.
> To make it more simple I have two kinds of data sets A and B and each data
> set has two SHAPE files. So my result should end up being a SpatiaLite
> file for each data set.
> 
> I am using the following commands to create the SpatiaLite files:
> 
> If it's the first file:
> ogr2ogr -f SQLite -dsco SPATIALITE=YES -gt 100000 -lco SPATIAL_INDEX=NO
> out_A.spatialite A_1.shp -nln A
> Else:
> ogr2ogr -gt 100000 -update -append A.spatialite A_2.shp -nln A
> 
> If it's the first file:
> ogr2ogr -f SQLite -dsco SPATIALITE=YES -gt 100000 -lco SPATIAL_INDEX=NO
> out_B.spatialite B_1.shp -nln B
> Else:
> ogr2ogr -gt 100000 -update -append B.spatialite B_2.shp -nln B
> 
> For some reason I haven't found yet, the last command fails with the
> following message (both A's work just fine):
> 
> ERROR 1: Layer B already exists, CreateLayer failed.
> Use the layer creation option OVERWRITE=YES to replace it.
> ERROR 1: Terminating translation prematurely after failed
> translation of layer B (use -skipfailures to skip errors)
> 
> The two data sets are both linestrings but has different attributes. Both
> 1 and 2 in each data set has been created programmatically the same way.
> 
> I am using GDAL 2.2.2 (x64) on Windows 7 from OSGeo4W.
> 
> What could be the reason for this error?
> 
> Regards, Casper

Could you share a small test dataset for reproducing the issue?

-Jukka Rahkonen-




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list