Hi,
When a layer comes from Spatialite or GeoPackage datastore through "Open Data
Store Layer" OpenJUMP is making new SQL request after each pan/zoom by using
the envelope of the view as spatial filter. Corresponding code is at
https://sourceforge.net/p/jump-pilot/code/HEAD/tree/core/trunk/src/com/vividsolutions/jump/datastore/spatialite/SpatialiteSQLBuilder.java
and queries are like
// Example of Spatialite SQL:
// select nom_comm from commune where st_envIntersects(wkt_geometry,
bbox(516707,6279239,600721,6347851)
This works but because Spatialite and Geopackage do not have a real spatial
index this query can be very slow with big tables.
However, both Spatialite and GeoPackage may have geometries indexed with RTree
spatial index which is very fast but it must be queried with a SQL subquery. It
is possible to check from the metadata tables of Spatialite and GeoPackage if
RTree index exists. If index is available the SQL in the previous example could
be changed into
select nom_comm from commune where rowid in
(select id from rtree_commune_geom
where
minx<600721 and
maxx>516707 and
miny<6347851 and
maxy>6279239);
In Spatialite case the syntax is a bit different but the idea is the same. See
also our blog
http://openjump.blogspot.fi/2014/02/openjump-and-geopackage-part-2-spatial.html.
If somebody gets interested in adding support for RTree index in Spatialite and
Geopackage I am willing to help as much as I can. I believe that I know how to
check if RTree index exist and how to build queries which utilize RTree. I
could also provide test data and help with testing.
-Jukka Rahkonen-
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Jump-pilot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel