[Neo4j] Neo4J Spatial - issue with bounding box indices in OSM Layer.
Robert Boothby
robert at presynt.com
Thu Mar 24 12:42:35 CET 2011
Hi, I've been playing with Neo4j Spatial and the OSM data imports to
see how it all fits together. I've been blogging on my experiences
(http://bbboblog.blogspot.com).
It's still early days but think that I have run into an issue. Having
imported the OSM data successfully I've tried to execute this code to
determine whether the centre of the town of Aylesbury (UK) is within
the county of Buckinghamshire (which it is) and to pull back all nodes
which contain the centre of the town:
final OSMLayer osmLayer = (OSMLayer)spatialDB.getLayer("OSM-BUCKS");
final GeometryFactory factory = osmLayer.getGeometryFactory();
final Point point = factory.createPoint(new
Coordinate(51.796726,-0.812988));
SearchContain searchContain = new SearchContain(point);
osmLayer.getIndex().executeSearch(searchContain);
for(SpatialDatabaseRecord record: searchContain.getResults()){
System.out.println("Container:" + record);
}
The layer does contain the appropriate data imported from a .osm file
extract for Buckinghamshire (the smallest file for an English county).
When I've tried to run it I've got no results and when I've debugged
it appears that the bbox property attributes (minx, maxx, miny, maxy)
for the layer's root node are incorrect (mixed up) - minx=-1.1907455,
maxx = 51.0852483, miny=0.3909055, maxy=52.2274931 causing the search
to return immediately. Am I using this API correctly and have I
stumbled into a genuine bug?
Thank you,
Robert Boothby.
More information about the User
mailing list