+ // We need to put GraphLayer to newLayers so...
+// for (Resource layer : graph.getObjects(diagramResource, DiagramResource.getInstance(graph).HasLayer)) {
+// IGraphLayerUtil layerUtil = graph.adapt(graph.getSingleObject(layer, Layer0.getInstance(graph).InstanceOf), IGraphLayerUtil.class);
+//
+// GraphLayer gl = layerUtil.loadLayer(graph, layer);
+// gl.forEachTag(tag -> {
+// DiagramGraphUtil.tag(graph, startVertex, tag, true);
+// DiagramGraphUtil.tag(graph, endVertex, tag, true);
+// });
+// }
+//
+ return edge;
+ }
+ private static double calculateElevationFromVertices(WriteGraph graph, Resource startVertex, Resource endVertex) throws ManyObjectsForFunctionalRelationException, BindingException, ServiceException {
+ DistrictNetworkResource DN = DistrictNetworkResource.getInstance(graph);
+ Double startElevation = graph.getPossibleRelatedValue(startVertex, DN.Vertex_HasElevation, Bindings.DOUBLE);
+ Double endElevation = graph.getPossibleRelatedValue(endVertex, DN.Vertex_HasElevation, Bindings.DOUBLE);
+ if (startElevation != null && endElevation != null) {
+ return (startElevation + endElevation) / 2;
+ }
+ return 0;
+ }
+
+ public void create(WriteGraph graph, double[] start, double[] end, double padding) throws DatabaseException {
+
+ Resource edge = create(graph, diagramResource, start, end, padding);