From fc60d9ff8e26972734dddf0ba71137e3d67c2b6c Mon Sep 17 00:00:00 2001 From: jsimomaa Date: Wed, 5 Dec 2018 11:01:24 +0200 Subject: [PATCH] Use EPSG code instead of full WKT for creating CRS gitlab #17 Change-Id: Ida549b67167259252f3fafd43dac03d3bc1ae116 --- .../src/org/simantics/district/network/ModelledCRS.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/org.simantics.district.network/src/org/simantics/district/network/ModelledCRS.java b/org.simantics.district.network/src/org/simantics/district/network/ModelledCRS.java index 55d850e5..af0bf418 100644 --- a/org.simantics.district.network/src/org/simantics/district/network/ModelledCRS.java +++ b/org.simantics.district.network/src/org/simantics/district/network/ModelledCRS.java @@ -7,15 +7,15 @@ import org.simantics.databoard.Bindings; import org.simantics.db.ReadGraph; import org.simantics.db.Resource; import org.simantics.db.exception.DatabaseException; -import org.simantics.district.network.ontology.DistrictNetworkResource; +import org.simantics.layer0.Layer0; public class ModelledCRS implements CRS { private GeodeticCalculator calculator; public ModelledCRS(ReadGraph graph, Resource type) throws DatabaseException, FactoryException { - String wkt = graph.getRelatedValue2(type, DistrictNetworkResource.getInstance(graph).HasSRTEXT, Bindings.STRING); - CoordinateReferenceSystem crs = org.geotools.referencing.CRS.parseWKT(wkt); + String code = graph.getRelatedValue2(type, Layer0.getInstance(graph).HasLabel, Bindings.STRING); + CoordinateReferenceSystem crs = org.geotools.referencing.CRS.decode(code); this.calculator = new GeodeticCalculator(crs); } -- 2.47.1