Skip to content

AER-4255 Extended HexagonUtil to add custom rounding parameter for hexagon coordinates.#369

Open
Hilbrand wants to merge 1 commit intoaerius:mainfrom
Hilbrand:AER-4255-hexagon-util-rounding
Open

AER-4255 Extended HexagonUtil to add custom rounding parameter for hexagon coordinates.#369
Hilbrand wants to merge 1 commit intoaerius:mainfrom
Hilbrand:AER-4255-hexagon-util-rounding

Conversation

@Hilbrand
Copy link
Member

@Hilbrand Hilbrand commented Feb 6, 2026

Kept original method for backward compatibility.

…xagon coordinates.

Kept original method for backward compatibility.
@Hilbrand Hilbrand requested a review from BertScholten February 6, 2026 16:11
/**
* Returns a Geometry with a hexagon conforming to the given Point, and rounds the points of the hexagon
*
* @see #createHexagon(Point, HexagonZoomLevel, boolean)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @see #createHexagon(Point, HexagonZoomLevel, boolean)
* @see #createHexagon(Point, HexagonZoomLevel, DoubleUnaryOperator)

assertCreateHexagon();
@ParameterizedTest
@MethodSource("createHexagon")
void testCreateHexagon(final boolean round, final double[][][] results) {
Copy link
Member

Choose a reason for hiding this comment

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

useDefaultMethod might make more sense as a parameter?

final Polygon polygon = round
? HexagonUtil.createHexagon(point, ZOOM_LEVEL_1)
: HexagonUtil.createHexagon(point, ZOOM_LEVEL_1, d -> BigDecimal.valueOf(d).setScale(3, RoundingMode.HALF_UP).doubleValue());
System.out.println(polygon);
Copy link
Member

Choose a reason for hiding this comment

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

Want to keep this?

*/
package nl.overheid.aerius.shared.domain.geo;

import nl.overheid.aerius.shared.MathUtil;
Copy link
Member

Choose a reason for hiding this comment

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

Don't know if the reason stated in MathUtil for using it over Math.round still applies?

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