-
-
Notifications
You must be signed in to change notification settings - Fork 167
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
LineString.IsClosed()
does not use DoubleComparer
for Position
#137
Comments
Well it's a dilema here. I don't know what was the intended behavior when the project was initiated. But comparing until the 10th decimal digit (as DoubleComparer does) is fair enough to state it's the same coordinate. We are talking about micrometers here. More over equality with double is something variable upon where the code is executed and strict equality should be replaced by difference is below double.Epsilon. So the DoubleComparer is a good choice here, as it checks for equality for acceptable ranges. So I think we could remove this strict equality check and prefer the DoubleComparer. We then may add candies for strict closeness such as If anyone watching this thinks it's a bad idea please comment down here. And by the way, thanks for your implication @jnyrup ! |
Two instances of
Position
are considered equal when theirLatitude
,Longitude
andAltitude
are approximately equal using aDoubleComparer
.LineString.IsClosed
considers an instance to be closed ifLatitude
,Longitude
andAltitude
of its first and lastIPosition
coordinate are exactly equals.This seems to be potential inconsistent when constructing a
LineString
withPosition
asIPosition
.Is that intended behavior?
The text was updated successfully, but these errors were encountered: