duckdb / duckdb/duckdb-sqlite

GeoPackage geometry type detection

Open
#113 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
291
Forks
45
Avg merge
10h 13m
Merged PRs (30d)
18

Description

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)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.