[gdal-dev] Geopackage ogr2ogr append question

Even Rouault even.rouault at spatialys.com
Fri Mar 3 06:53:15 PST 2017


Hi Andreas,

> 
> I am, for the first time trying to append additional tables with ogr2ogr
> to an existing Geopackage file and have questions:
> 
> ogr2ogr -progress -lco SPATIAL_INDEX=YES -f GPKG av_1700_lv03.gpkg
> PG:'dbname=publikation host=localhost schemas=av_1700' -sql "SELECT
> t_id, t_ili_tid, geom_03, bfs_nr, gemeinde, bodenbedeckungsart,
> bodenbedeckungs_flaeche, gebaeudenummer, gwr_egid, objekt_name FROM
> av_1700.bb_bodenbedeckung"
> 
> ogr2ogr -progress -append -f GPKG av_1700_lv03.gpkg
> PG:'dbname=publikation host=localhost schemas=av_1700' -sql "SELECT
> t_id, t_ili_tid, geom_03, bfs_nr, gemeinde, linienart, bobeart_links,
> bobeart_rechts FROM av_1700.bb_bodenbedeckung_kanten"
> 
> -----------------
> 
> First question:
> 
> is the -append option enough or do I also need the -update option?

Yes -append is enough. It implies -update.

But -append is for appending features to an existing table. If you need to create a new table, 
you just need -update.

In your above case, you must be careful. The name of a SQL result layer depends on the 
driver. I nthe GPKG driver, it is always "sql_statement". You might want to rename it to 
something more useful with -nln new_layer_name,

> 
> -----------------
> 
> Second question:
> 
> I get warnings:
> 
> Warning 1: Layer sql_statement relies on the 'gpkg_geom_COMPOUNDCURVE'
> (GeoPackage 1.0 Specification Annex J) extension that should be
> implemented for safe write-support, but is not currently. Update of that
> layer are strongly discouraged to avoid corruption.
> Warning 1: Layer sql_statement relies on the 'gpkg_geom_CURVEPOLYGON'
> (GeoPackage 1.0 Specification Annex J) extension that should be
> implemented for safe write-support, but is not currently. Update of that
> layer are strongly discouraged to avoid corruption.
> 
> Can I safely ignore these messages? Or is there a creation option for
> the first table that enables this extension?

Which GDAL version is this ? It looks like the issue of 
https://trac.osgeo.org/gdal/ticket/6402

So this should be fixed in GDAL 2.0.3 or GDAL >= 2.1.0

(the warning can be ignored, but you should upgrade to a more recent version so that the 
extension is properly registered as read-write)

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170303/dd7782dc/attachment.html>


More information about the gdal-dev mailing list