diff --git a/indexer/src/main/java/au/org/aodn/esindexer/utils/GeometryUtils.java b/indexer/src/main/java/au/org/aodn/esindexer/utils/GeometryUtils.java index 343cb565..e5e9d7c0 100644 --- a/indexer/src/main/java/au/org/aodn/esindexer/utils/GeometryUtils.java +++ b/indexer/src/main/java/au/org/aodn/esindexer/utils/GeometryUtils.java @@ -44,7 +44,7 @@ public enum PointOrientation { @Getter @Setter - protected static double coastalPrecision = 0.05; + protected static double coastalPrecision = 0.1; // Load a coastline shape file so that we can get a spatial extents that cover sea only public static void init() { @@ -68,7 +68,10 @@ public static void init() { SimpleFeature feature = iterator.next(); Geometry landFeatureGeometry = (Geometry) feature.getDefaultGeometry(); - // This will reduce the points of the shape file for faster processing + // This will reduce the points of the shape file for faster processing, this + // simplification may cause polygon invalid and therefore need to use buffer(0.0) later + // during processing to work around this issue. Another choice is TopologyPreservingSimplifier + // but the polygon output is a bit complicated Geometry simplifiedGeometry = DouglasPeuckerSimplifier .simplify(landFeatureGeometry, getCoastalPrecision()); // Adjust tolerance