Closed GoogleCodeExporter closed 8 years ago
Is VirtualSpatialIndex working on spatialite-android?
Original comment by mithenks...@gmail.com
on 15 Apr 2013 at 1:06
They should. You could create a test to try it out?
Original comment by efroh...@gmail.com
on 15 Apr 2013 at 1:26
String query = "SELECT count(*) FROM regions WHERE pk_uid IN (SELECT rowid FROM
SpatialIndex WHERE \"f_table_name\"='regions' AND
\"f_geometry_column\"='Geometry' AND \"search_frame\" =
GeomFromEWKT(\"SRID=4326;POLYGON((12.02 41.52,19.38 42.70,19.38 35.70,11.30
36.06,12.02 41.52))\"))";
This is a test query I'm trying to execute with stmt.prepare().
It works with spatialiate_gui, gime me 11 regions, while is not on android.
No errors given, but 0 result.
Tell me if you want the complete workspace code.
Original comment by mithenks...@gmail.com
on 16 Apr 2013 at 10:47
Executing "Select count(*) from idx_regions_Geometry", I give "No such module:
rtree".
I've followed the instructions on the main page to build spatialite-android,
and then imported it in eclipse.
Am I making a mistake somewhere?
Original comment by mithenks...@gmail.com
on 16 Apr 2013 at 11:08
Hard to tell what is going on from just the query. If you are using the test
DB there are no spatial indexes. You will have to create them first. If you
can post more code and the database that would help.
Original comment by efroh...@gmail.com
on 16 Apr 2013 at 12:20
You can find a test code here: https://github.com/Mithenks/SpatialiteAndroidTest
Original comment by mithenks...@gmail.com
on 16 Apr 2013 at 2:39
I don't see where you are creating the spatial index. Try adding something
like:
select checkspatialindex()
select createspatialindex('HighWays','Geometry')
select checkspatialindex()
Original comment by efroh...@gmail.com
on 17 Apr 2013 at 11:46
The index is preexisting on the database.
However, I've added the queries you suggest.
The result is in the attached screenshot.
Original comment by mithenks...@gmail.com
on 17 Apr 2013 at 1:29
Attachments:
See revision: 3d9de54d66c7
(https://code.google.com/p/spatialite-android/source/detail?r=3d9de54d66c74d5fab
aa183d8ed0822c010c8440)
Note that CheckSpatialIndex sometime returns the incorrect value. See:
https://www.gaia-gis.it/fossil/libspatialite/tktview?name=1c3f376d50
Original comment by efroh...@gmail.com
on 29 Apr 2013 at 1:35
Original issue reported on code.google.com by
efroh...@gmail.com
on 14 Jan 2013 at 2:08