+ 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;
+ }
+