1

I am currently using OGC GeoPackage features and tiles which is another spatial data format that is also a SQLite3 container.
I am using it in a mobile app but GeoPackage does not support spatial queries and spatial functions like SpatiaLite. I see there is a new feature of SpatiaLite that's a virtualgpkg. Like their virtual Shapefile.
Trying not to reinvent the wheel and take advantage of this cool feature and all the functionality.

In the reference of SpatiaLite 4.2.0 the syntax for creating virtualgpkg is:

CREATE VIRTUAL TABLE tablename USING module(arg1, ...);  

I need more examples of the syntax. How it references a GeoPackage Filename and the GeoPackage Tablename.

Can someone provide the code to create a virtual GeoPackage table in SpatiaLite?

1

You should be able to do this with just

SELECT AutoGPKGStart()

before the first usage, then

SELECT AutoGPKGStop()

when you are finished.

Those will create virtual tables for each GPKG table entry.

  • Did this work for you? If not, can you update your question with more details? – BradHards Dec 20 '16 at 7:12
0

SELECT AutoGPKGStart() builds a wrapper to geom column but it doesn't create the view.

You need to do something like:

CREATE VIRTUAL TABLE "vgpkg_<YOUR TABLE>" USING VirtualGPKG("YOUR TABLE")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.