Skip to content

Commit

Permalink
Reduce precision default value
Browse files Browse the repository at this point in the history
  • Loading branch information
utas-raymondng committed Nov 18, 2024
1 parent 6197be9 commit f28e55f
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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

Expand Down

0 comments on commit f28e55f

Please sign in to comment.