- double[] startCoords = graph.getRelatedValue2(startVertex, DIA.HasLocation);
-
- double startLon = ModelledCRS.longitudeToX(startCoords[0]) * scale;
- double startLat = ModelledCRS.latitudeToY(startCoords[1]) * scale;
-
- double[] endCoords = graph.getRelatedValue2(endVertex, DIA.HasLocation);
-
- double endLon = ModelledCRS.longitudeToX(endCoords[0]) * scale;
- double endLat = ModelledCRS.latitudeToY(endCoords[1]) * scale;
-
- Path2D path = new Path2D.Double();
- path.moveTo(startLon, startLat);
- path.lineTo(endLon, endLat);
+ if (!graph.hasStatement(edgeResource, DN.HasEndVertex))
+ return; // already deleted
+ Resource endVertex = graph.getSingleObject(edgeResource, DN.HasEndVertex);
+
+ double[] startCoords = graph.getRelatedValue2(startVertex, DIA.HasLocation, Bindings.DOUBLE_ARRAY);
+ double[] endCoords = graph.getRelatedValue2(endVertex, DIA.HasLocation, Bindings.DOUBLE_ARRAY);