]> gerrit.simantics Code Review - simantics/district.git/blobdiff - org.simantics.district.network.ui/src/org/simantics/district/network/ui/contributions/ChangeRoutePointToVertexHandler.java
Fix elevation bounding box profile shift & elevation transform fixes
[simantics/district.git] / org.simantics.district.network.ui / src / org / simantics / district / network / ui / contributions / ChangeRoutePointToVertexHandler.java
index d540a96c8ae85fa642901cf01490fb25e3dab4f8..f9e37c088bc2751b8e9c339a66d312f1409df0df 100644 (file)
@@ -29,10 +29,10 @@ import org.simantics.db.layer0.SelectionHints;
 import org.simantics.db.layer0.util.RemoverUtil;
 import org.simantics.db.request.Read;
 import org.simantics.diagram.stubs.DiagramResource;
+import org.simantics.district.network.DNEdgeBuilder;
 import org.simantics.district.network.DistrictNetworkUtil;
 import org.simantics.district.network.ModelledCRS;
 import org.simantics.district.network.ontology.DistrictNetworkResource;
-import org.simantics.district.network.ui.DNEdgeBuilder;
 import org.simantics.district.network.ui.DistrictDiagramEditor;
 import org.simantics.district.network.ui.NetworkDrawingParticipant;
 import org.simantics.g2d.canvas.ICanvasContext;
@@ -159,21 +159,10 @@ public class ChangeRoutePointToVertexHandler {
                                                     double y = finalClosestPoint.getY();
                                                     double[] midVertexCoords = new double[] { x, y };
                                                     
-                                                    double elevation = 0;
-                                                    if (MapsElevationServerPreferences.useElevationServer()) {
-                                                        // ok! we use new elevation API to resolve possible elevations for the starting points
-                                                        try {
-                                                            elevation = SingletonTiffTileInterface.lookup(x, y).doubleValue();
-                                                        } catch (Exception ee) {
-                                                            LOGGER.error("Could not get elevation from tiff interface", ee);
-                                                        }
-                                                    }
-                                                    
-                                                    Resource createdVertex = DistrictNetworkUtil.createVertex(graph, diagram, midVertexCoords, elevation, mapping);
+                                                    Resource createdVertex = DistrictNetworkUtil.createVertex(graph, diagram, midVertexCoords, Double.MAX_VALUE, mapping);
 
-                                                    Optional<Resource> leftEdge = DNEdgeBuilder.create(graph, diagram, currentStartVertexCoords, 0, midVertexCoords, 0, detailedLeftEdgeGeometryCoords, 0.001);
-                                                    Optional<Resource> rightEdge = DNEdgeBuilder.create(graph, diagram, midVertexCoords, 0, currentEndVertexCoords, 0, detailedRightEdgeGeometryCoords, 0.001);
-                                                    
+                                                    Optional<Resource> leftEdge = DNEdgeBuilder.create(graph, diagram, currentStartVertexCoords, Double.MAX_VALUE, midVertexCoords, Double.MAX_VALUE, detailedLeftEdgeGeometryCoords, 0.001);
+                                                    Optional<Resource> rightEdge = DNEdgeBuilder.create(graph, diagram, midVertexCoords, Double.MAX_VALUE, currentEndVertexCoords, Double.MAX_VALUE, detailedRightEdgeGeometryCoords, 0.001);
                                                 }
                                             }
                                         });