问题
I'm new to Neo4j and cypher.
I have many nodes, that i want to add to a spatial layer.
This is what i tried with cypher :
Creating Nodes from a csv file
load csv with headers from "file:///green_tripdata_2015-02.csv" as line
create(pl:pickup_location{lat:line.Pickup_latitude,lon:line.Pickup_longitude});
Spatial Layer Creation
CALL spatial.addPointLayer('nyc');
and then :
MATCH (pl:pickup_location)
WITH collect(pl) AS pickup
CALL spatial.addNodes('nyc',pickup) YIELD count
RETURN count
and i get this error :
Neo.ClientError.Statement.PropertyNotFound: NODE[397] has no property with propertyKeyId=8.
what is wrong ?
回答1:
I Solved my problem by just changing:
1) lat property to latitude
2) lon property to longitude
3) cast with toFloat() the two properties(they were Strings in the csv):
toFloat(line.Pickup_latitude) and toFloat(line.Pickup_longitude)
来源:https://stackoverflow.com/questions/50861988/how-to-add-list-of-nodes-to-a-spatiallayer