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

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


More intormation:

Reason may be that GML files do not have same layers but the second one has one layer more:

ogrinfo /vsizip/K2344R_mtk.zip
ERROR 1: Random access not supported for /vsizip
Had to open data source read-only.
INFO: Open of `/vsizip/K2344R_mtk.zip'
      using driver `GML' successful.
1: MaastokuvionReuna (3D Line String)
2: Meri (3D Polygon)
3: AluemerenUlkoraja (3D Line String)
4: Kunta (3D Polygon)

ogrinfo /vsizip/K2433L_mtk.zip
ERROR 1: Random access not supported for /vsizip
Had to open data source read-only.
INFO: Open of `/vsizip/K2433L_mtk.zip'
      using driver `GML' successful.
1: MaastokuvionReuna (3D Line String)
2: Meri (3D Polygon)
3: AluemerenUlkoraja (3D Line String)
4: KunnanHallintoraja (3D Line String)
5: Kunta (3D Polygon)

Output from running ogr2ogr with  --debug on

GML: Using Expat reader
GML: Layers are monoblock. Using SEQUENTIAL_LAYERS read mode
GDAL: GDALOpen(/vsizip/K2433L_mtk.zip, this=0000000003DA65F0) succeeds as GML.
GDAL: GDALOpen(mtk.gpkg, this=0000000003DADDC0) succeeds as GPKG.
GML: ResetReading()
GML: ResetReading()
GDALVectorTranslate: 3 features written in layer 'MaastokuvionReuna'
GDALVectorTranslate: 2 features written in layer 'Meri'
GDALVectorTranslate: 2 features written in layer 'AluemerenUlkoraja'
GDALVectorTranslate: 1 features written in layer 'KunnanHallintoraja'
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)
GDAL: GDALClose(mtk.gpkg, this=0000000003DADDC0)
GDAL: GDALClose(/vsizip/K2433L_mtk.zip, this=0000000003DA65F0)


-Jukka-


More information about the gdal-dev mailing list