A.HADDAD
A.HADDAD

Reputation: 1906

How to add list of nodes to a SpatialLayer

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 ?

Upvotes: 1

Views: 113

Answers (1)

A.HADDAD
A.HADDAD

Reputation: 1906

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)

Upvotes: 1

Related Questions