This commit is contained in:
2025-10-23 07:17:58 +02:00
parent ff809c7c34
commit a715e4d602
2 changed files with 119 additions and 99 deletions

View File

@@ -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