routes
This commit is contained in:
20
README.md
20
README.md
@@ -58,6 +58,26 @@ RETURN path;
|
||||
MATCH (a:Point {nom:'Boulangerie'}), (b:Point {nom:'Salle des fêtes'})
|
||||
RETURN point.distance(a.location, b.location)
|
||||
|
||||
LOAD CSV WITH HEADERS FROM 'file:///routes.csv' AS row
|
||||
WITH row
|
||||
MATCH (a:Lieu {id: toInteger(row.source)})
|
||||
WITH a, row
|
||||
MATCH (b:Lieu {id: toInteger(row.target)})
|
||||
MERGE (a)-[r:ROUTE {route_id: toInteger(row.route_id)}]->(b)
|
||||
SET r.tag = row.tag, r.cout = toFloat(row.cout);
|
||||
|
||||
-- routes inverses si cout_inverse != -1
|
||||
LOAD CSV WITH HEADERS FROM 'file:///routes.csv' AS row
|
||||
WITH row
|
||||
WHERE toFloat(row.cout_inverse) <> -1
|
||||
MATCH (a:Lieu {id: toInteger(row.source)})
|
||||
WITH a, row
|
||||
MATCH (b:Lieu {id: toInteger(row.target)})
|
||||
MERGE (b)-[r:ROUTE {route_id: toInteger(row.route_id) * 1000}]->(a)
|
||||
SET r.tag = row.tag, r.cout = toFloat(row.cout_inverse);
|
||||
|
||||
|
||||
|
||||
### Réseau routier
|
||||
|
||||
```cypher
|
||||
|
||||
Reference in New Issue
Block a user