[gdal-dev] gpkg related tables extension

Even Rouault even.rouault at spatialys.com
Tue Dec 19 08:29:58 PST 2023


Karsten,

Le 19/12/2023 à 16:56, Karsten Tebling via gdal-dev a écrit :
> Hello,
>
> according to the docs 
> (https://gdal.org/drivers/vector/gpkg.html#relationships) the 
> geopackage driver is able to read, create, update and delete 
> "relationships". I tried to convert some tables of a postgis database 
> to geopackage, but there was no related tables extensions in the 
> geopackage. 

The driver supports the API to read & edit relationships, but ogr2ogr 
doesn't have logic to copy relationships from the source dataset to the 
target one, nor does the PostGIS implement the relationship API.

> The related tables extension is also not listed in the supported 
> extensions 
> (https://gdal.org/drivers/vector/gpkg.html#level-of-support-of-geopackage-extensions). 

Was missing in that section of the doc. Just added

> Is it possible to convert postgis tables to a geopackage with related 
> tables?

You'll have to use the relationship API to create them manually. Cf 
python testing of the GPKG driver: 
https://github.com/OSGeo/gdal/blob/master/autotest/ogr/ogr_gpkg.py#L6897

Even


-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list