[gdal-dev] SQL script for creating a test GeoPackage

Jukka Rahkonen jukka.rahkonen at maanmittauslaitos.fi
Thu Apr 23 09:54:14 PDT 2015


Hi,

Inspired by this Spatialite forum thread
https://groups.google.com/d/msg/spatialite-users/rBKeuXLpQv8/THStsQdQXI0J I
started to write a SQL script that creates a GeoPackage database with all
the metadata tables, triggers etc. and also data tables for every possible
geometry type, each with one column for every possible data type, populated
with some data that suits the type. 

However, I started to think that this is so obvious that someone must have
done that already and that could save me a few hours. Even, Pepijn, where do
you have your SQL? This Python in autotest directory probably has it all
http://trac.osgeo.org/gdal/browser/trunk/autotest/ogr/ogr_gpkg.py.

The ultimate GeoPackage experts could then inspect the resulting GPKG
database byte by byte and once it is perfect it could be shared to everybody
and used in the conformance tests.

If I copy and paste right the columns will be:

BOOLEAN
TINYINT
SMALLINT
MEDIUMINT
INTEGER
INT
FLOAT
DOUBLE
TEXT
BLOB
GEOMETRY
DATE
DATETIME

And the basic geometry types:
GEOMETRY
POINT
LINESTRING
POLYGON
MULTIPOLYGON
MULTILINESTRING
MULTIPOLYGON
GEOMETRYCOLLECTION

And the extented geometry types:
CIRCULARSTRING
COMPOUNDCURVE
CURVEPOLYGON
MULTICURVE
MULTISURFACE
CURVE
SURFACE

I have no idea about how I could insert contents to these but I think they
should be put into their own database anyways.

-Jukka Rahkonen-



More information about the gdal-dev mailing list