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
https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
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
https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteDSMetadata.java
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
"hasSpatialIndex"
2) Modify
https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
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
faster.
-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
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel