- // TODO: Find maybe a better way to apply the scaling
- double[] startCoords = graph.getRelatedValue2(startVertex, DIA.HasLocation);
- double[] endCoords = graph.getRelatedValue2(endVertex, DIA.HasLocation);
- DistrictNetworkEdge edge = new DistrictNetworkEdge(new Point2D.Double(startCoords[0], startCoords[1]), new Point2D.Double(endCoords[0], endCoords[1]));
+ double[] startCoords = graph.getRelatedValue2(startVertex, DIA.HasLocation, Bindings.DOUBLE_ARRAY);
+ double[] endCoords = graph.getRelatedValue2(endVertex, DIA.HasLocation, Bindings.DOUBLE_ARRAY);
+
+ double[] geometry = EMPTY;
+ try {
+ geometry = graph.getPossibleRelatedValue2(edgeResource, DN.Edge_HasGeometry, Bindings.DOUBLE_ARRAY);
+ } catch (Exception e) {
+ // most likely no geometry available
+ }
+ DistrictNetworkEdge edge = new DistrictNetworkEdge(new Point2D.Double(startCoords[0], startCoords[1]), new Point2D.Double(endCoords[0], endCoords[1]), geometry);