October 2017
Beginner to intermediate
316 pages
8h
English
Neo4j has a limited built-in spatial support since Neo4j 3.0. There is default support for point and distance. This support assumes that you will set property keys named latitude and longitude for the nodes you want to use as points.
You can use them to calculate the distance between two nodes, but first let's build the towers, starting with the good habit of creating a constraint:
CREATE CONSTRAINT ON (t:Tower) ASSERT t.name IS UNIQUECREATE (paris:Tower {name: "Eiffel Tower",country:"FRA", latitude:48.858093, longitude:2.294694})CREATE (vegas:Tower {name: "Vegas Eiffel Tower",country:"USA", latitude:36.112474, longitude:-115.172737})CREATE (tokyo:Tower {name: "Tokyo Tower",country:"JPN", latitude:35.659053,longitude:139.745228}) ...Read now
Unlock full access