Hi Robert, Interesting work you're doing. I just read your blogs and I think it would be great to discuss your tests in more detail. Michael Hunger has done some interesting tests on the scalability of the OSM import, and could probably give suggestions on configuring the import.
Looking at your code below, I think you have swapped the x and y around in the Coordinate constructor. It should be Coordinate(x,y), but the values you have passed look like lat,long (which means y,x). Also, the SearchContain should return geometries that contain the point you passed, so if your point is within a lake, or building, or some other polygon geometry, you should get results, but I do not think it will return anything if you point is not actually contained within closed polygons. To give a more complete answer, I think I would need to run and test your code. Hopefully the above comments help resolve the issue. Regards, Craig On Thu, Mar 24, 2011 at 12:42 PM, Robert Boothby <rob...@presynt.com> wrote: > 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. > _______________________________________________ > Neo4j mailing list > User@lists.neo4j.org > https://lists.neo4j.org/mailman/listinfo/user > _______________________________________________ Neo4j mailing list User@lists.neo4j.org https://lists.neo4j.org/mailman/listinfo/user