import org.simantics.diagram.elements.ElementTransforms;
import org.simantics.diagram.elements.ElementTransforms.TransformedObject;
import org.simantics.diagram.stubs.DiagramResource;
+import org.simantics.district.network.ModelledCRS;
import org.simantics.district.network.ontology.DistrictNetworkResource;
import org.simantics.g2d.canvas.Hints;
import org.simantics.g2d.diagram.participant.pointertool.TranslateMode;
Resource res = (Resource) obj;
AffineTransform at = ElementUtils.getLocalTransform(e, new AffineTransform());
if (graph.isInstanceOf(res, DN.Vertex)) {
+
+ double x = at.getTranslateX();
+ double y = at.getTranslateY();
+ // TODO: Fix scale!
+ double scale = 100000;
+// double scale = 1;
+ double lat = ModelledCRS.yToLatitude(y / scale);
+ double lon = ModelledCRS.xToLongitude(x / scale);
+
// write to db
- double[] coords = new double[] { at.getTranslateX(), at.getTranslateY() };
+ double[] coords = new double[] { lon, lat };
graph.claimLiteral(res, DIA.HasLocation, coords);
} else {
// fallback to normal HasTransforms