Re: [mapserver-users] Mapserver does not use the spatial index with GeoPackage

2017-01-09 Thread Even Rouault
On mercredi 14 décembre 2016 13:16:47 CET Even Rouault wrote:
> 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).

FYI, I've just enhanced the OGR backend to have optimizations in the GPKG case 
similar to the 
ones of the Spatialite case (requires GDAL >= 2 and Spatialite >= 4.3). Note: I 
only dealt with 
the DATA "layer_name" case, not for SELECT...


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Mapserver does not use the spatial index with GeoPackage

2016-12-14 Thread Rahkonen Jukka (MML)
Right, using simply DATA "table_name" makes it fast for me. I suppose that when 
data source is GeoPackage then typical WMS queries with DATA "SELECT..." would 
usually be much faster if  spatial index is utilized and almost never much 
slower.

-Jukka-

Even Rouault wrote:
Re: [mapserver-users] Mapserver does not use the spatial index with GeoPackage


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
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Re: [mapserver-users] Mapserver does not use the spatial index with GeoPackage

2016-12-14 Thread Even Rouault
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
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users

[mapserver-users] Mapserver does not use the spatial index with GeoPackage

2016-12-14 Thread Rahkonen Jukka (MML)
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"

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-

___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-users