Ankur Kumar Chhabra
Ankur Kumar Chhabra

Reputation: 31

Creating Nodes in Neo4j with 3d Coordinates

I have a file with following details File Name - NodesNew.csv

Node_id,x,y,z
N1,-64.4099,-7.1637,-1502.5
N2,-55.3361,0.635342,-1502.5
N3,-55.3361,0.635342,-1502.5
N4,-55.3361,0.635342,-1502.5
N5,-55.3361,0.635342,-1502.5
N6,-57.0687,-8.17777,-1502.5
N7,-73.8723,-2.5789,-1502.5
N8,1,5,70
N9,1,5,70
N10,-20.2929,-3.26937,-1502.5

Now i want to create these Nodes such that, they are placed as per their coordinates in the Graph Database. I researched and used Spatial functions for the same but things are not working as expected.

LOAD CSV WITH HEADERS FROM "file:///NodesNew.csv" AS row
CREATE (n:Nodes)
SET n = row
RETURN n

With this Query, 10 Nodes are created with all the information present in the file. However, for some reason - i want these nodes to be located as per their x,y,z coordinates. Have a look at the screenshot

Nodes

The nodes that are labelled have same coordinates but then also they are separated. Please if anyone can guide me as how to achieve this

Upvotes: 1

Views: 211

Answers (1)

Dave Fauth
Dave Fauth

Reputation: 878

The Neo4j browser does not place nodes based on x,y,z coordinates.

Take a look at this blog post: https://medium.com/neo4j/visualizing-graphs-in-3d-with-webgl-9adaaff6fe43

Upvotes: 1

Related Questions