From: jsimomaa Date: Wed, 5 Dec 2018 09:01:24 +0000 (+0200) Subject: Use EPSG code instead of full WKT for creating CRS X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F2519%2F1;p=simantics%2Fdistrict.git Use EPSG code instead of full WKT for creating CRS gitlab #17 Change-Id: Ida549b67167259252f3fafd43dac03d3bc1ae116 --- 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); }