Hi Alireza, Points is the most common use case, and that is why we made the SimplePointLayer to minimise complexity for this case. This is also why you see so many examples with points only.
However, Neo4j Spatial was built with complex geometries in mind, so they are fully supported, and you should use a WKB or WKT layer should you use those. The best source of examples for this are the test cases in the code on github. Note that you must be careful not to mix layer types. If you make a layer with one config, you must add nodes of that same config. A safer option is to add the geometry and allow the layer to make the node, but if you want more control, you can add the node only if you take care yourself to ensure the node has the same config as the layer (ie. add a WKB node to a WKB layer). Currently there is no choice of index, as all layer types use a RTree index build into the graph model. This is generalized for all geometries, and is not optimized to any particular type. We had planned to add more index types to increase performance, but instead we are taking a different direction, building a new 'points only' spatial support into Neo4j itself, which will use an index optimized for points. This means that, for a while, the best solution for points will be the built-in spatial, and the best solution for complex geometries will be the external 'Neo4j Spatial' library. There is, however, no scheduled release date yet. Regards, Craig On Sun, Aug 9, 2015 at 7:12 PM, Alireza Rezaei Mahdiraji < [email protected]> wrote: > > Hi, > > Most of the examples I found assume one type of geometry (mostly point) > and then build layer and index accordingly. > > In my case, the nodes can be points, lines or polygons. My query set range > from > finding nearest neighbors to finding the polygon which an arbitrary point > is located in, etc. > > Any advice on a good design is appreciated: how many layers and what kind > of indexes, etc. > > Thanks, > 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 [email protected]. > For more options, visit 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 [email protected]. For more options, visit https://groups.google.com/d/optout.
