Work on GeoJSon ans JTS support
[gpl/argeo-suite.git] / org.argeo.app.geo / src / org / argeo / app / geo / JTS.java
index 26237120bb25cd80856d7c68a6962b1194d1bb73..ba7ecf9ba92172e36744254a3ddfac51d717747d 100644 (file)
@@ -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;