It seems you created the layer with a WKB (well known binary) representation 
config

but now your location properties are not decodable as WKB because they are 
double's ?

Michael

Perhaps you can share a test that reproduces the issue?

> Am 08.08.2015 um 23:26 schrieb Alireza Rezaei Mahdiraji 
> <alireza...@gmail.com>:
> 
> 
> Here are the stacks for the two cases (very similar):
> 
> Exception in thread "main" java.lang.ClassCastException: java.lang.Double 
> cannot be cast to [B
>     at 
> org.neo4j.gis.spatial.WKBGeometryEncoder.decodeGeometry(WKBGeometryEncoder.java:41)
>     at 
> org.neo4j.gis.spatial.filter.SearchIntersectWindow.onEnvelopeIntersection(SearchIntersectWindow.java:48)
>     at 
> org.neo4j.gis.spatial.rtree.filter.AbstractSearchEnvelopeIntersection.geometryMatches(AbstractSearchEnvelopeIntersection.java:45)
>     at 
> org.neo4j.gis.spatial.rtree.RTreeIndex$SearchEvaluator.checkPosition(RTreeIndex.java:286)
>     at 
> org.neo4j.gis.spatial.rtree.RTreeIndex$SearchEvaluator.isStopNode(RTreeIndex.java:299)
>     at 
> org.neo4j.kernel.impl.traversal.OldTraverserWrapper$Pruner.evaluate(OldTraverserWrapper.java:260)
>     at 
> org.neo4j.graphdb.traversal.Evaluator$AsPathEvaluator.evaluate(Evaluator.java:69)
>     at 
> org.neo4j.kernel.impl.traversal.MultiEvaluator.evaluate(MultiEvaluator.java:62)
>     at 
> org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.evaluate(MonoDirectionalTraverserIterator.java:61)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchImpl.evaluate(TraversalBranchImpl.java:125)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchImpl.initialize(TraversalBranchImpl.java:130)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchImpl.next(TraversalBranchImpl.java:151)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchWithState.next(TraversalBranchWithState.java:32)
>     at 
> org.neo4j.kernel.impl.traversal.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:50)
>     at 
> org.neo4j.graphdb.traversal.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:49)
>     at 
> org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.fetchNextOrNull(MonoDirectionalTraverserIterator.java:70)
>     at 
> org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.fetchNextOrNull(MonoDirectionalTraverserIterator.java:36)
>     at 
> org.neo4j.helpers.collection.PrefetchingIterator.peek(PrefetchingIterator.java:60)
>     at 
> org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:46)
>     at 
> org.neo4j.helpers.collection.PrefetchingIterator.next(PrefetchingIterator.java:75)
>     at 
> org.neo4j.kernel.impl.traversal.OldTraverserWrapper$TraverserImpl.next(OldTraverserWrapper.java:86)
>     at 
> org.neo4j.kernel.impl.traversal.OldTraverserWrapper$TraverserImpl.next(OldTraverserWrapper.java:47)
>     at org.neo4j.gis.spatial.filter.SearchRecords.next(SearchRecords.java:53)
>     at org.neo4j.gis.spatial.filter.SearchRecords.next(SearchRecords.java:29)
>     at org.neo4j.gis.spatial.pipes.GeoPipeline$1.next(GeoPipeline.java:134)
>     at org.neo4j.gis.spatial.pipes.GeoPipeline$1.next(GeoPipeline.java:126)
>     at 
> org.neo4j.gis.spatial.pipes.impl.LastElementIterator.next(LastElementIterator.java:19)
>     at 
> org.neo4j.gis.spatial.pipes.impl.IdentityPipe.processNextStart(IdentityPipe.java:18)
>     at 
> org.neo4j.gis.spatial.pipes.impl.AbstractPipe.next(AbstractPipe.java:72)
>     at 
> org.neo4j.gis.spatial.pipes.AbstractGeoPipe.processNextStart(AbstractGeoPipe.java:49)
>     at 
> org.neo4j.gis.spatial.pipes.AbstractGeoPipe.processNextStart(AbstractGeoPipe.java:31)
>     at 
> org.neo4j.gis.spatial.pipes.impl.AbstractPipe.next(AbstractPipe.java:72)
>     at org.neo4j.gis.spatial.pipes.impl.Pipeline.next(Pipeline.java:113)
>     at 
> org.neo4j.gis.spatial.pipes.GeoPipeline.toNodeList(GeoPipeline.java:1015)
>     
> 
> Exception in thread "main" java.lang.ClassCastException: java.lang.Double 
> cannot be cast to [B
>     at 
> org.neo4j.gis.spatial.WKBGeometryEncoder.decodeGeometry(WKBGeometryEncoder.java:41)
>     at 
> org.neo4j.gis.spatial.filter.SearchIntersectWindow.onEnvelopeIntersection(SearchIntersectWindow.java:48)
>     at 
> org.neo4j.gis.spatial.rtree.filter.AbstractSearchEnvelopeIntersection.geometryMatches(AbstractSearchEnvelopeIntersection.java:45)
>     at 
> org.neo4j.gis.spatial.rtree.RTreeIndex$SearchEvaluator.checkPosition(RTreeIndex.java:286)
>     at 
> org.neo4j.gis.spatial.rtree.RTreeIndex$SearchEvaluator.isStopNode(RTreeIndex.java:299)
>     at 
> org.neo4j.kernel.impl.traversal.OldTraverserWrapper$Pruner.evaluate(OldTraverserWrapper.java:260)
>     at 
> org.neo4j.graphdb.traversal.Evaluator$AsPathEvaluator.evaluate(Evaluator.java:69)
>     at 
> org.neo4j.kernel.impl.traversal.MultiEvaluator.evaluate(MultiEvaluator.java:62)
>     at 
> org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.evaluate(MonoDirectionalTraverserIterator.java:61)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchImpl.evaluate(TraversalBranchImpl.java:125)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchImpl.initialize(TraversalBranchImpl.java:130)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchImpl.next(TraversalBranchImpl.java:151)
>     at 
> org.neo4j.kernel.impl.traversal.TraversalBranchWithState.next(TraversalBranchWithState.java:32)
>     at 
> org.neo4j.kernel.impl.traversal.StartNodeTraversalBranch.next(StartNodeTraversalBranch.java:50)
>     at 
> org.neo4j.graphdb.traversal.PreorderDepthFirstSelector.next(PreorderDepthFirstSelector.java:49)
>     at 
> org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.fetchNextOrNull(MonoDirectionalTraverserIterator.java:70)
>     at 
> org.neo4j.kernel.impl.traversal.MonoDirectionalTraverserIterator.fetchNextOrNull(MonoDirectionalTraverserIterator.java:36)
>     at 
> org.neo4j.helpers.collection.PrefetchingIterator.peek(PrefetchingIterator.java:60)
>     at 
> org.neo4j.helpers.collection.PrefetchingIterator.hasNext(PrefetchingIterator.java:46)
>     at 
> org.neo4j.helpers.collection.PrefetchingIterator.next(PrefetchingIterator.java:75)
>     at 
> org.neo4j.kernel.impl.traversal.OldTraverserWrapper$TraverserImpl.next(OldTraverserWrapper.java:86)
>     at 
> org.neo4j.kernel.impl.traversal.OldTraverserWrapper$TraverserImpl.next(OldTraverserWrapper.java:47)
>     at org.neo4j.gis.spatial.filter.SearchRecords.next(SearchRecords.java:53)
>     at org.neo4j.gis.spatial.filter.SearchRecords.next(SearchRecords.java:29)
>     at org.neo4j.gis.spatial.pipes.GeoPipeline$1.next(GeoPipeline.java:134)
>     at org.neo4j.gis.spatial.pipes.GeoPipeline$1.next(GeoPipeline.java:126)
>     at 
> org.neo4j.gis.spatial.pipes.impl.LastElementIterator.next(LastElementIterator.java:19)
>     at 
> org.neo4j.gis.spatial.pipes.impl.IdentityPipe.processNextStart(IdentityPipe.java:18)
>     at 
> org.neo4j.gis.spatial.pipes.impl.AbstractPipe.next(AbstractPipe.java:72)
>     at 
> org.neo4j.gis.spatial.pipes.AbstractGeoPipe.processNextStart(AbstractGeoPipe.java:49)
>     at 
> org.neo4j.gis.spatial.pipes.AbstractGeoPipe.processNextStart(AbstractGeoPipe.java:31)
>     at 
> org.neo4j.gis.spatial.pipes.impl.AbstractPipe.next(AbstractPipe.java:72)
>     at org.neo4j.gis.spatial.pipes.impl.Pipeline.next(Pipeline.java:113)
>     at 
> org.neo4j.gis.spatial.pipes.GeoPipeline.toNodeList(GeoPipeline.java:1015)
>     
> Cheers,
> Alireza
> 
> On Saturday, August 8, 2015 at 11:10:18 PM UTC+2, Michael Hunger wrote:
> Can you provide the full stacktrace.
> 
> Michael
> 
>> Am 07.08.2015 um 13:19 schrieb Alireza Rezaei Mahdiraji <alire...@ 
>> <>gmail.com <http://gmail.com/>>:
>> 
>> 
>> 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 Coordinate(0.0d, 0.0d);
>> List<Node> nodes = GeoPipeline.startNearestNeighborLatLonSearch(layer, 
>> coord, 1.0).toNodeList();
>> 
>> 
>> Basically, I am trying to find all other points within distance one of the 
>> origin (i.e., (0.0., 0.0) ). 
>> 
>> 
>> Cheers,
>> Alireza
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Neo4j" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to neo4j+un...@ <>googlegroups.com <http://googlegroups.com/>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to neo4j+unsubscr...@googlegroups.com 
> <mailto:neo4j+unsubscr...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to neo4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to