1 package org
.argeo
.app
.geo
;
3 import org
.argeo
.api
.cms
.CmsLog
;
4 import org
.locationtech
.jts
.geom
.GeometryFactory
;
5 import org
.locationtech
.jts
.geom
.PrecisionModel
;
8 * Factories initialisation and workarounds for the JTS library. The idea is to
9 * code defensively around factory initialisation, API changes, and issues
10 * related to running in an OSGi environment. Rather see {@link GeoUtils} for
11 * functional static utilities.
14 private final static CmsLog log
= CmsLog
.getLog(JTS
.class);
16 public final static int WGS84_SRID
= 4326;
18 /** A geometry factory with no SRID specified */
19 public final static GeometryFactory GEOMETRY_FACTORY
;
20 /** A geometry factory with SRID 4326 (WGS84 in the EPSG database) */
21 public final static GeometryFactory GEOMETRY_FACTORY_WGS84
;
25 GEOMETRY_FACTORY
= new GeometryFactory();
26 GEOMETRY_FACTORY_WGS84
= new GeometryFactory(new PrecisionModel(), WGS84_SRID
);
27 } catch (RuntimeException e
) {
28 log
.error("Basic JTS initialisation failed, geographical utilities are probably not available", e
);