Re: [Neo4j] Neo4j Spatial: Strange caset exception while using startNearestNeighborLatLonSearch

2015-08-12 Thread Craig Taverner
Hi Alireza, Since you have three different geometry types, you are correct to use WKT (or WKB) for the layer. This layer can handle all three types. You do not need a separate layer for points. The only reason I suggested making a points-only layer was that I thought perhaps you only stored

Re: [Neo4j] Neo4j Spatial: Strange caset exception while using startNearestNeighborLatLonSearch

2015-08-12 Thread Alireza Rezaei Mahdiraji
Very well explained, thanks, However, one problem with one layer solution is that when I am trying Q2 and Q3 it returns also non-point nodes (edge and polygons) which are not part of the result. So I think it might be better for me to have two layers. Is there any performance cost on

Re: [Neo4j] Neo4j Spatial: Strange caset exception while using startNearestNeighborLatLonSearch

2015-08-10 Thread Craig Taverner
Hi Alireza, I wrote some test code using your layer creation and neighbour search code that you pasted, and it works fine. So what I think has happened is that you have somehow added nodes with a different layer config to the same index that you are now using for WKB. Perhaps the nodes used to be

Re: [Neo4j] Neo4j Spatial: Strange caset exception while using startNearestNeighborLatLonSearch

2015-08-08 Thread Alireza Rezaei Mahdiraji
I used Coordinate coord = new Coordinate(0.0d, 0.0d); as a test location which is required by startNearestNeighborLatLonSear (see my first post). Is that enough? Alireza On Saturday, August 8, 2015 at 11:48:24 PM UTC+2, Michael Hunger wrote: It seems you created the layer with a WKB (well

Re: [Neo4j] Neo4j Spatial: Strange caset exception while using startNearestNeighborLatLonSearch

2015-08-08 Thread Alireza Rezaei Mahdiraji
Let me ask you a design kind of question: the nodes in my graph could have various geometry: point, line, or polygon. I used the following layer definition (but I am not sure that is the best way to do it) EditableLayer runningLayer = (EditableLayer)

[Neo4j] Neo4j Spatial: Strange caset exception while using startNearestNeighborLatLonSearch

2015-08-07 Thread Alireza Rezaei Mahdiraji
Hi, I get the following cast exception while using startNearestNeighborLatLonSearch method: *Exception in thread main java.lang.ClassCastException: java.lang.Double cannot be cast to [B*my code is as follows: Layer layer = spatialDbInstance.getLayer(mylayer); Coordinate coord = new