+ double currentPadding = DistrictNetworkVertexNode.width;
+ AffineTransform test = getTransform();
+ ICanvasContext ctx = DiagramNodeUtil.getCanvasContext(this);
+ AffineTransform tr = ctx.getHintStack().getHint(Hints.KEY_CANVAS_TRANSFORM);
+ AffineTransform testing = new AffineTransform(tr);
+ testing.concatenate(test);
+ double calculateScaleRecip = DistrictNetworkNodeUtils.calculateScaleRecip(testing);
+ double padding = currentPadding * calculateScaleRecip;
+ /*
+ * To convert y-coordinates to map coordinates in ruler, use:
+ * double val = (y-offsetY)/scaleY;
+ * val = Math.toDegrees(Math.atan(Math.sinh(Math.toRadians(val))));
+ * String str = formatValue(val);
+ */
+ // TODO: fix scale
+ double scaleY = getTransform().getScaleY();
+ double scaleX = getTransform().getScaleX();
+
+ double startLat = ModelledCRS.yToLatitude(-start.getY() / scaleY);
+ double startLon = ModelledCRS.xToLongitude(start.getX() / scaleX);
+
+ double endLat = ModelledCRS.yToLatitude(-end.getY() / scaleY);
+ double endLon = ModelledCRS.xToLongitude(end.getX() / scaleX);