[mapserver-users] Mapserver does not use the spatial index with GeoPackage
Even Rouault
even.rouault at spatialys.com
Wed Dec 14 04:16:47 PST 2016
On mercredi 14 décembre 2016 12:00:01 CET Rahkonen Jukka (MML) wrote:
> Hi,
>
> I am using Mapserver 7.0 with GDAL 2.1.1, released 2016/07/07
> I have Geopackage as source data:
>
> CONNECTIONTYPE OGR
> CONNECTION "/users/wms/data/vektorit/kiinteistot/palsta.gpkg"
> DATA "select * from palsta"
Using DATA "palsta" should likely make the RTree to be used. The "SELECT ..." case could
probably be also improved in that case, but that depends on whether the OGR driver
supports efficient spatial filtering on a layer resulting from a SQL SELECT (which should be
the case in the GPKG case)
The GPKG case could also potentially benefit from similar optimizations as the ones I did
recently for the Spatialite case (would require checking that a recent enough Spatialite lib is
available so that the ST_ operators can be used).
>
> Geopackage is created with GDAL 2.2 with default options and it does have a
> spatial index. Unfortunately it seems that it is not utilized:
>
>
> [Wed Dec 14 13:51:12 2016].928976
> msOGRFileOpen(/users/wms/data/vektorit/kiinteistot/palsta.gpkg)... [Wed Dec
> 14 13:51:12 2016].929040
> OGROPen(/users/wms/data/vektorit/kiinteistot/palsta.gpkg) [Wed Dec 14
> 13:51:12 2016].940209
> msConnPoolRegister(palstat,/users/wms/data/vektorit/kiinteistot/palsta.gpkg
> ,0x94a050) [Wed Dec 14 13:51:12 2016].942224 msOGRFileWhichShapes: SQL =
> select * from palsta. [Wed Dec 14 13:51:12 2016].947950 msOGRFileNextShape:
> Returning shape=0, tile=0 [Wed Dec 14 13:51:12 2016].948047
> msOGRFileNextShape: Returning shape=1, tile=0 [Wed Dec 14 13:51:12
> 2016].948098 msOGRFileNextShape: Returning shape=2, tile=0 [Wed Dec 14
> 13:51:12 2016].948132 msOGRFileNextShape: Returning shape=3, tile=0 [Wed
> Dec 14 13:51:12 2016].948173 msOGRFileNextShape: Returning shape=4, tile=0
> [Wed Dec 14 13:51:12 2016].948215 msOGRFileNextShape: Returning shape=5,
> tile=0 [Wed Dec 14 13:51:12 2016].948291 msOGRFileNextShape: Returning
> shape=6, tile=0 [Wed Dec 14 13:51:12 2016].948340 msOGRFileNextShape:
> Returning shape=7, tile=0 [Wed Dec 14 13:51:12 2016].948405
> msOGRFileNextShape: Returning shape=8, tile=0 [Wed Dec 14 13:51:12
> 2016].948464 msOGRFileNextShape: Returning shape=9, tile=0
>
> Is there something that I should do for forcing Mapserver/OGR to use the
> R-tree index?
>
> -Jukka Rahkonen-
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20161214/d0b36fe5/attachment.htm>
More information about the MapServer-users
mailing list