Skip to content
mj10777 edited this page Oct 26, 2018 · 16 revisions

Creating / Destroying of a VirtualGPKG wrapper

--> 'List of Sql-Commands'

<-- 'Index Page for GeoPackage - Commands'


Original Documentation 'SQL functions implementing OGC GeoPackage compatibility'

  • AutoGPKGStart( void ) : Integer
  • AutoGPKGStop( void ) : Integer

  • This function will inspect the DB layout, then automatically creating/refreshing a VirtualGPKG wrapper for each GPKG geometry table

    • returns amount of tables effected
  • sample 20140101.world_Haiti.gpkg

    • a valid R10 GeoPackage
      • 'CheckGeoPackageMetaData' returns 1
        • 1 features [Geometry] table called geonames
        • 1 tiles [Raster] table called fromosm_tiles
SELECT AutoGPKGStart();
  • returns 1
    • 1 features [Geometry] table found
    • a new table called vgpkg_geonames now exists
      • the show CREATE statement shows:
        • CREATE VIRTUAL TABLE "vgpkg_geonames" USING VirtualGPKG("geonames")

--

  • when viewing the Geometry field with BLOB explore
    • geonames: shows BLOB sz=?? UNKNOWN type
      • a Geometry in the gpkg-format
    • vgpkg_geonames: shows BLOB sz=?? GEOMETRY
      • a Geometry in the spatialite-format

Note: at this point there is no (Spatialite-specific) SpatialIndex

  • 'CreateSpatialIndex'
    • will fail in a GeoPackage
      • due to the missing, spatialite-specific, geometry_columns TABLE

2014-05-23: Mark Johnson, Berlin Germany


Clone this wiki locally