[gdal-dev] Problem with merging SHAPEs into SpatiaLite

Casper Børgesen caboe at sdfe.dk
Sun Oct 8 23:00:52 PDT 2017


Hi Even

Thanks for your reply, I will try the option. I just wonder, if the driver performs automatical laundering, shouldn't it automatically transform any requests too? So when asked if a layer exists, launder the incoming name and compare to that or does it have other complications down the road?

Regards, Casper

From: Even Rouault [mailto:even.rouault at spatialys.com]
Sent: 5. oktober 2017 13:15
To: Casper Børgesen <caboe at sdfe.dk>
Cc: gdal-dev at lists.osgeo.org
Subject: Re: [gdal-dev] Problem with merging SHAPEs into SpatiaLite


On jeudi 5 octobre 2017 10:52:42 CEST Casper Børgesen wrote:

> Hi Even

>

> I have prepared a very small test data set:

>

> 2 shape files

> 1 BAT file

> 1 screenshot of my output

>

> You can find it here: https://ufile.io/ravt2

>

> I don't have access to a Linux machine at the moment, so I cannot test it on

> Linux. But I am curious to know if it works on Linux :)



Oh I wrongly assumed you used geopackage whereas you use sqlite



The difference is that the sqlite driver applies by default name laundering which will turn "a-b" into a_b in the creation stage. So your append -nln "a-b" will match a non existing layer



Add -lco LAUNDER=NO to the creation stage and that will solve it.



>

> Regards, Casper

>

> From: Even Rouault [mailto:even.rouault at spatialys.com]

> Sent: 5. oktober 2017 12:34

> To: gdal-dev at lists.osgeo.org<mailto:gdal-dev at lists.osgeo.org>

> Cc: Casper Børgesen <caboe at sdfe.dk<mailto:caboe at sdfe.dk>>

> Subject: Re: [gdal-dev] Problem with merging SHAPEs into SpatiaLite

>

> On mercredi 4 octobre 2017 08:58:25 CEST Casper Børgesen wrote:

> > Hi Jukka

> >

> >

> >

> > I tried only to discover that the error is probably about an invalid (?)

> >

> > layer name (-nln). ogr2ogr doesn't complain if I give it a layer name with

> >

> > a dash in the middle, like 'some-thing'. When appending data to the layer

> >

> > using the same layer name, I get the error message.

> >

> > I don't know if this type of layer names are indeed invalid and if so, the

> >

> > current behaviour of ogr2ogr not complaining is intended.

>

> I cannot reproduce on Linux (and can't see why that would be Windows

> specific)

>

>

>

> The following works fine for me:

>

> ogr2ogr -f gpkg test.gpkg ../autotest/ogr/data/poly.shp -nln "a-b"

>

> ogr2ogr -gt 100000 -update -append test.gpkg ../autotest/ogr/data/poly.shp

> -nln "a-b"

>

>

>

> Even

>

>

>

> --

>

> Spatialys - Geospatial professional services

>

> http://www.spatialys.com





--

Spatialys - Geospatial professional services

http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171009/03cb56bb/attachment.html>


More information about the gdal-dev mailing list