Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GeoPackage geometry type detection #113

Open
rouault opened this issue Sep 4, 2024 · 0 comments
Open

GeoPackage geometry type detection #113

rouault opened this issue Sep 4, 2024 · 0 comments

Comments

@rouault
Copy link

rouault commented Sep 4, 2024

GeoPackage is a specification for geospatial files based on a SQLite3 database: https://www.geopackage.org/spec/
Geometries are encoded in as blobs in a column, but the column type name used is not BLOB, but one of GEOMETRY, POINT, LINESTRING, POLYGON, MULTIPOINT, MULTILINESTRING, MULTIPOLYGON, GEOMETRYCOLLECTION, CIRCULARSTRING, COMPOUNDCURVE, CURVEPOLYGON, MULTICURVE, MULTISURFACE, CURVE, SURFACE (cf tables 30 and 31 of the above link). Currently the SQLite scanner wrongly detects them as VARCHAR, given the rules it uses for type deduction. Would it be possible to modify the scanner for that special case to recognize geometry columns as binary ? The easiest way to identify GeoPackage files is to test for the "gpkg" file extension, which is mandated by the specification. It is also possible to check the SQLite3 application_id header field to be 0x47504B47 ("GPKG" in ASCII) (cf requirement 2 of the spec)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant