24. A tip of Data Importing (Windows Local File)
1. Start Neo4j
2. Create a new project folder
3. Open the http://localhost:7474/browser/
4. Create the ‘import’ folder under the new project folder
DocumentsNeo4jNew_Folderimport
5. Copy the CSV file at the ‘import’ folder
6. Import dataset using LOAD CSV
LOAD CSV with Headers from "file:///city.csv" AS city
CREATE (ct:city {name: city.city, state: city.state, city_state: city.city_state, lat: city.lat, lng:
city.lng, population: city.pop});
25.
26. Spherical distance using the haversin function
CREATE (a:City { lat: 52.5, lon: 13.4 }),(b:City { lat: 37.5, lon: -122.3 })
RETURN 2 * 6371 * asin(sqrt(haversin(radians(b.lat - a.lat))+ cos(radians(b.lat))* cos(radians(a.lat))*
haversin(radians(b.lon - a.lon))))
AS dist