[gdal-dev] Geopackage ogr2ogr append question

Neumann, Andreas a.neumann at carto.net
Mon Mar 6 01:27:21 PST 2017


Hi Even, 

I upgraded to gdal 2.1.3 and everything works fine regarding the
upgrades of the geopackage. 

I also switched to "-update" as you suggested, as -append is not
necessary, since I am creating new tables within an existing gepackage
and don't append to existing tables. 

Thanks a lot, 

Andreas 

On 2017-03-03 15:53, Even Rouault wrote:

> 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/20170306/e4acbee1/attachment-0001.html>


More information about the gdal-dev mailing list