Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add reducer support #169

Merged
merged 4 commits into from
Nov 21, 2024
Merged

Conversation

utas-raymondng
Copy link
Contributor

No description provided.

// to reduce processing time.
@Getter
@Setter
protected static Double reducerPrecision = null;

// Load a coastline shape file so that we can get a spatial extents that cover sea only
public static void init() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like this class is growing bigger and bigger and its readability is somehow affected. It has quite a lot of static methods too. Maybe can refactor / group narrower scope's related methods into separate classes (like saveResourceToTemp is not really directly related to "geometry") and use dependency injection and reduce the size of GeometryUtils?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok let me move this out

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved out

@@ -75,7 +88,7 @@ public static void init() {
Geometry simplifiedGeometry = DouglasPeuckerSimplifier
.simplify(landFeatureGeometry, getCoastalPrecision()); // Adjust tolerance

geometries.add(simplifiedGeometry);
geometries.add(reducer != null ? reducer.reduce(simplifiedGeometry) : simplifiedGeometry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a test case

@vietnguyengit vietnguyengit merged commit 48889c1 into main Nov 21, 2024
2 checks passed
@vietnguyengit vietnguyengit deleted the features/6008-reduce-polygon-decimal branch November 21, 2024 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants