X-Git-Url: http://git.argeo.org/?a=blobdiff_plain;f=org.argeo.app.geo%2Fsrc%2Forg%2Fargeo%2Fapp%2Fgeo%2FJTS.java;h=ba7ecf9ba92172e36744254a3ddfac51d717747d;hb=8b7dc8398a17d09c5e20857b4e1e5f82ad28e769;hp=26237120bb25cd80856d7c68a6962b1194d1bb73;hpb=8a490e540ac623b3545b1bd3da65ecbf2e4b6436;p=gpl%2Fargeo-suite.git diff --git a/org.argeo.app.geo/src/org/argeo/app/geo/JTS.java b/org.argeo.app.geo/src/org/argeo/app/geo/JTS.java index 2623712..ba7ecf9 100644 --- a/org.argeo.app.geo/src/org/argeo/app/geo/JTS.java +++ b/org.argeo.app.geo/src/org/argeo/app/geo/JTS.java @@ -2,6 +2,7 @@ package org.argeo.app.geo; import org.argeo.api.cms.CmsLog; import org.locationtech.jts.geom.GeometryFactory; +import org.locationtech.jts.geom.PrecisionModel; /** * Factories initialisation and workarounds for the JTS library. The idea is to @@ -12,12 +13,17 @@ import org.locationtech.jts.geom.GeometryFactory; public class JTS { private final static CmsLog log = CmsLog.getLog(JTS.class); + public final static int WGS84_SRID = 4326; + + /** A geometry factory with no SRID specified */ public final static GeometryFactory GEOMETRY_FACTORY; + /** A geometry factory with SRID 4326 (WGS84 in the EPSG database) */ + public final static GeometryFactory GEOMETRY_FACTORY_WGS84; static { try { - // GEOMETRY_FACTORY = JTSFactoryFinder.getGeometryFactory(); GEOMETRY_FACTORY = new GeometryFactory(); + GEOMETRY_FACTORY_WGS84 = new GeometryFactory(new PrecisionModel(), WGS84_SRID); } catch (RuntimeException e) { log.error("Basic JTS initialisation failed, geographical utilities are probably not available", e); throw e;