[gdal-dev] How to append to all layers with ogr2ogr?

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Mon Feb 1 05:25:50 PST 2016


Hi,

Did you try to add another GML file into existing GeoPackege?

First run OK:
ogr2ogr -f gpkg -update -append mtk.gpkg /vsizip/K2344R_mtk.zip

Secong run gives an error:
ogr2ogr -f gpkg -update -append mtk.gpkg /vsizip/K2433L_mtk.zip
ERROR 1: Layer Kunta already exists, and -append not specified.
        Consider using -append, or -overwrite.
ERROR 1: Terminating translation prematurely after failed
translation of layer Kunta (use -skipfailures to skip errors)

-Jukka-

Even Rouault wrote:


> Jukka,

>> 
>> I would like to collect data from a bunch of GML files into one 
>> GeoPackage but GML files may contain more than 20 layers and ogr2ogr 
>> does not want to append data for me because the -append switch 
>> probably has an effect only to one explicitly given layer.

> -append is supposed to work with several layers too.

> I've just downloaded
> http://kartat.kapsi.fi/files/maastotietokanta/kaikki/etrs89/gml/K2/K24/K2433L_mtk.zip
> and tried your below command, both a non inexisting mtk.gpkg, and one created with it, and it works as expected for me.

> Perhaps the bug only triggers with some initial content of mtk.gpkg ?

> 
> >ogr2ogr -f gpkg -update -append mtk.gpkg /vsizip/K2433L_mtk.zip

Even

--
Spatialys - Geospatial professional services http://www.spatialys.com


More information about the gdal-dev mailing list