Which query is causing the NPE? You have three? The NPE must be occurring within one of the method or function calls.
just a few comments:
you have a sequence of ‘unwinds’. This will cause the Cartesian product of all the events of all the lists you are unwinding. As a result, I think you are getting the same list of points for each value of property. What does the jso look like? Maybe we can figure out the best way to extract the data
the ‘points’ variable will be a list, since it is created by collecting data. You then try to convert it to a string. This should have an issue.
in the last query, you are matching to get nodes ‘l’, then collecting into list ‘lines’, then unwinding to ‘n’. All this is unnecessary, since you will end up with the same rows as created from the match. As such, you could just match and pass ‘l’ to the addNodes method.
I don't get it, I put it back in the prompt image.
It tells me "java.lang.NullPointerException" and doesn't execute me "spatial.addNode", not reporting consequently the nodes in the spatial layer.
Thank you very much for helping
the NPE must be occurring in the spatial.addNode method. What is the method doing? I suspect it needs data in one or more properties and you are not providing at least one of those properties. When the missing property is accessed it is null, and that is causing a problem in the method’s code.
What is the method doing so we can figure out the issue?
The spatial.addNode should add nodes to the spatial layer, created in the above query with the spatial.addWKTLayer('spatial', 'geometry') method.
Maybe it can't access the 'geometry' property, but I don't understand what I could have done wrong with importing the multilinestrings. Seeing the json file, how would you import them?
The geometry property is set to the value of pointString, which is set using the apoc method. The issue here is that you are passing a list to convert to a string. The method will convert a list such as [1,2,3] to ‘[1,2,3]’. What is the structure if the data that addWKTLayer expects for the ‘geometry’ property? Is there documentation I can read?
But I don't know, maybe it's related to spatial.addWKTLayer; I've never done such a thing before and took a cue from https://neo4j-contrib.github.io/spatial/0.24-neo4j-3.1/index.html.
Anyway, how would you import multilinestrings, how would you create a 'geometry' property with wkt geometry?