[gdal-dev] Geopackage ogr2ogr append question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gdal-dev] Geopackage ogr2ogr append question

Neumann, Andreas

Hi,

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?

-----------------

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?

Thanks a lot for your help!

Andreas

 

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Geopackage ogr2ogr append question

Even Rouault-2

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


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Geopackage ogr2ogr append question

Neumann, Andreas

Hi Even,

Thanks for your reply.

My gdal version is 2.0.2 - I can update to a newer version and see if this warning disappears.

I meanwhile also figured out that I need to use -nln for proper table names.

Thanks also for the information about append vs. update. I'll switch to update then.

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

 

 

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Geopackage ogr2ogr append question

Neumann, Andreas
In reply to this post by Even Rouault-2

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

 

 

_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...