-
Notifications
You must be signed in to change notification settings - Fork 442
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
Remove enforcing array consistency from CoordinateArraySequence #584
Remove enforcing array consistency from CoordinateArraySequence #584
Conversation
modules/core/src/main/java/org/locationtech/jts/geom/impl/CoordinateArraySequence.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/locationtech/jts/geom/Coordinates.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/locationtech/jts/geom/Coordinates.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/locationtech/jts/geom/Coordinates.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/locationtech/jts/geom/Coordinates.java
Outdated
Show resolved
Hide resolved
modules/core/src/main/java/org/locationtech/jts/geom/LinearRing.java
Outdated
Show resolved
Hide resolved
90a63e4
to
53735a8
Compare
modules/core/src/main/java/org/locationtech/jts/geom/Coordinates.java
Outdated
Show resolved
Hide resolved
53735a8
to
ba136ff
Compare
Thanks for review everyone |
* array is not copied). | ||
* of {@link Coordinate}s (the array is not copied). | ||
* <p> | ||
* Ensure the array is of the indicated dimension and measures. The method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I wonder if this explanation should be expanded.
The word "Ensure" is throwing me here. Read quickly, could one think that the method is ensuring consistency? (Like it was previously?)
Also, if the requirement is on the inputs, it seems like it'd be better on the description of the coordinates variable.
Honestly, mixing Coordinates and using the common ordinates ought to be fine. Right?
As a concrete suggestion how about something this:
"CoordinateArray should likely contain consistent implementations of the Coordinate for most uses. Mixing types may lead to issues. Callers can create such consistent arrays using {@link CoordinateArrays#enforceConsistency(Coordinate[])}."
@jnh5y I have improved the javadoc, David also found a some code improvements to be made. Please merge when the automated checks are passed. |
Hold up I see Martin marked this as draft, sadly I removed that before noticing he just did so 10 mins ago. @dr-jts what is up? |
Utility method provided for client code working with inconsistent content in the same array Signed-off-by: Jody Garnett <[email protected]>
e01cf23
to
85ea515
Compare
|
Removes check on array used for CoordinateArraySequence, documenting instead that the array must be consistent with the dimension and measures provided. Refactored the protected enforceConsistency method out to the Coordintes utility class for any client code that ends up working with mixed coordines.