how to use elementarygeometries with geopackage data

149 views
Skip to first unread message

David Anderson

unread,
Nov 20, 2015, 5:13:52 PM11/20/15
to SpatiaLite Users
I started looking at the elementarygeometries functionality.

Using a Spatialite db it works just great.

When I try to use a Geopackage formatted database it won't work.  Both the virtual table and the SQL function seem produce no results.  I can understand the virtual table as I assume that it is looking in the metadata tables and since the right ones don't exist it crashes.  The SQL function I sort of expected to work.  I tried it straight up, in GPKGmode, in EnableGpkgAmphibiousMode and in virtualgpkg mode.  No luck.  I even tried converting the geometry from GPB to native Spatialite geometry.  Still no go.

Maybe this shouldn't even work.  It would be kind of handy if it did though.

bye David

a.fu...@lqt.it

unread,
Nov 27, 2015, 8:29:36 AM11/27/15
to spatiali...@googlegroups.com
Hi David,

ElementaryGeometries (in all its related flavors) can never
work if the input table is not correctly registered into
the "geometry_columns" metadata-table.
So any eventual format conversion affecting just the BLOB
Geometries will always be completely useless. What is
strictly needed is populating a "genuine" SpatiaLite
GeoTable.

So there is only a way allowing to successfully call
ElementaryGeometries:
1. create a "genuine spatialite" table
2. populate this table by importing your initial GPKG data
3. export back the result returned by ElementaryGeometries()
into a GPKG own table.

please note: SpatiaLite is _not_ intended to be a library
indifferently supporting its own native binary format or
the alternative GPKG format.
the main goal of SpatiaLite simply is supporting its own
native stuff; soption, but it is and will always remain
an "alien" format clearly distinct from the native one,
and not necessarily supported if not by the most simpler
and unsophisticated functions.

bye Sandro

David Anderson

unread,
Dec 1, 2015, 3:39:06 PM12/1/15
to SpatiaLite Users
Sandro, thanks for responding.  I didn't think it would work but I thought it was worth a question.
I understand not wanting to support 2 formats. 
After some more work I figured out how to write Spatialite geometries that ESRI will recognize.
I'll probably abandon the geopackage format as the only reason I went that way was as a interchange format.

David
Reply all
Reply to author
Forward
0 new messages