[gdal-dev] Renaming multiple layers when loading gpkg into postgis

Richard Duivenvoorde rdmailings at duif.net
Thu Mar 7 10:42:08 PST 2024


Hi,

Loading a gpkg with multiple layers (from a zip) into Postgis is a breeze (all PG-stuff from env):

  ogr2ogr -overwrite -f PostgreSQL PG:"schemas=target" /vsizip//home/richard/data/data.zip/this.gpkg layer1 layer3

but now I want to rename those layers

  ogr2ogr -overwrite -f PostgreSQL PG:"schemas=target" /vsizip//home/richard/data/data.zip/this.gpkg layer1 -nln betterlayer1 layer3 -nln betterlayer3

This only loads the last layer.

Tried to google for this, but asking here: is it only possible to rename one layer per ogr2ogr call? (while it is possible to load several layers)

If so I will make my scripts do the loading one by one, but just want to check.

Regards,

Richard Duivenvoorde


More information about the gdal-dev mailing list