Hi,

GDAL has been supporting Spatialite spatial index since 
http://trac.osgeo.org/gdal/ticket/4212
Some further work was done in http://trac.osgeo.org/gdal/ticket/4508
I am remembering from my own experience that a query like the one you are using 
needs GDAL 1.10 but with that version the query should be fast. What GDAL 
version do you have? I guess that you have already checked that you really have 
a valid spatial index with CheckSpatialIndex SQL function.
I am also remembering that if a huge Spatialite table is built little by little 
for example by appending separate shapefiles into one common table then the 
result may be slow even if there is a valid spatial index because the SQLite 
data file gets so badly fragmented. Running VACUUM may have a great effect in 
such case.


-Jukka Rahkonen- 
________________________________________
Sven Geggus wrote:

> Hello,

> I have the following entry in a layer which I would like to convert from psql 
> backend
> to spatialite:

> CONNECTIONTYPE POSTGIS
> CONNECTION "dbname=..."
> DATA "geom from (select geom,id,height from contours where height%200=0) as 
> foo using unique id using srid=900913"

> I tried the following:
> CONNECTIONTYPE OGR
> CONNECTION "/path/to/contours.sqlite"
> DATA "select geometry,OGC_FID,height from contours where height%200=0"

> This does work, but does not seem to use the spation Index and is thus
> unusable in conjunction with a file containing Gigabytes of contour
> lines.

> Any hint?

> Sven

--
Das allgemeine Persönlichkeitsrecht (Art. 2 Abs.1 i.V.m. Art.1 Abs. 1GG)
umfasst das Grundrecht auf Gewährleistung der Vertraulichkeit und Integrität
informationstechnischer Systeme. (BVerfG, 1BvR 370/07)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users
_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to