Update of "about GetShapefileExtent()"
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: 0f1bdffe600160910edd334466a0cceb4970b1ae
Page Name:about GetShapefileExtent()
Date: 2017-04-21 11:36:02
Original User: sandro
Parent: a8c4338631671dc24d303cce016441f9768529e5 (diff)
Next cc751d18dde0c4324114af38a4e7e2e04f727d43
Content

about GetShapefileExtent()

Starting since version 4.5.0 libspatialite supports a new SQL function related to VirtualShape Tables that is specifically intended to quickly retrieve the Full Extent of the underlaying Shapefile.

Just a short recall about Shapefiles:
The new GetShapefileExtent() SQL function directly queries the full extent declared into the shapefile's header block, so it's expected to be very fast even when the shapefile contains an huge number of Features.


Example

We'll start by creating a VirtualShape Table:
CREATE VIRTUAL TABLE test USING VirtualShape('./someshapefile', 'CP1252', 4326);
and now we are ready to check the VirualShape's Full Extent:
SELECT AsEWKT(GetShapefileExtent('test'));
-------
SRID=4326;POLYGON((6.626621360000058 35.49285259200007,18.52038155300005 35.49285259200007,18.52038155300005 47.09178374200007,6.626621360000058 47.09178374200007,6.626621360000058 35.49285259200007))
Please note:
Caveat
If two (or more) VirtualShapes exist within the same DB connection exactly sharing an identical Table-name (obviously, each one being located on a different ATTACHED-DB) the result returned by GetShapefileExtent() will be unpredictable.