Hi Nicolas,

I would like to ask if you are interested in making the Spatialite datastore 
more usable with big tables by using the R-Tree spatial index it is available? 
Currently in 
 the SQL query is built as

        ret = String.format(Locale.US, "st_envIntersects(st_geomFromWkb(%s), 
%f,%f,%f,%f)", query.getGeometryAttributeName(), env.getMinX(),
            env.getMinY(), env.getMaxX(), env.getMaxY());

There is nothing else wrong with it, except that while it does restrict the 
size of the result set it does not make the query any faster.

What should be done is roughly:

1)      Modify 
 in case

a.  geometryColumnsLayout = GeometryColumnsLayout.OGC_GEOPACKAGE_LAYOUT or

b.  geometryColumnsLayout = GeometryColumnsLayout.OGC_SPATIALITE_LAYOUT

so that the existence of spatial index is checked and stored somewhere, like 

2)      Modify 
 so that if hasSpatialIndex=TRUE then the buildBoxFilter would be constructed 
in a slightly different way so that the R-Tree index would be utilized.

I believe that I do know well enough the table structures in Spatialite and 
Geopackage databases for making the SQL to work but I do not know Java well 
enough for making the necessary modifications.

Please contact me if you think that some sponsorship could make the wheels roll 

-Jukka Rahkonen-

Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Jump-pilot-devel mailing list

Reply via email to