double x = ModelledCRS.xToLongitude(pos.getX() / scale);
double y = ModelledCRS.yToLatitude(-pos.getY() / scale);
- 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);
- }
- }
- final double felevation = elevation;
-
boolean leftButton = e.button == MouseEvent.LEFT_BUTTON;
ThreadUtils.getNonBlockingWorkExecutor().schedule(() -> {
if (mapping == null) {
mapping = graph.getSingleObject(diagramResource, DistrictNetworkResource.getInstance(graph).VertexDefaultMapping);
}
- DistrictNetworkUtil.createVertex(graph, diagramResource, new double[] { x, y }, felevation, mapping);
+ DistrictNetworkUtil.createVertex(graph, diagramResource, new double[] { x, y }, Double.MAX_VALUE, mapping);
}
});
}, 100, TimeUnit.MILLISECONDS);
detailedGeometryCoords[i++] = lon;
detailedGeometryCoords[i++] = lat;
}
-
- double startElevation = 0;
- double endElevation = 0;
- if (MapsElevationServerPreferences.useElevationServer()) {
- // ok! we use new elevation API to resolve possible elevations for the starting points
- try {
- startElevation = SingletonTiffTileInterface.lookup(startLat, startLon).doubleValue();
- endElevation = SingletonTiffTileInterface.lookup(endLat, endLon).doubleValue();
- } catch (Exception e) {
- LOGGER.error("Could not get elevation from tiff interface", e);
- }
- }
- final double se = startElevation;
- final double ee = endElevation;
+
DNEdgeBuilder builder = new DNEdgeBuilder(diagramResource, diagram);
Simantics.getSession().asyncRequest(new WriteRequest() {
@Override
public void perform(WriteGraph graph) throws DatabaseException {
- builder.create(graph, startCoords, se, endCoords, ee, detailedGeometryCoords, padding);
+ builder.create(graph, startCoords, Double.MAX_VALUE, endCoords, Double.MAX_VALUE, detailedGeometryCoords, padding);
}
});