-
Notifications
You must be signed in to change notification settings - Fork 31
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
Decide if all functions should always return normalized coordinates (within ±90deg/±180deg range) #46
Comments
Right now, the coordinate types But you have to explicitly call it. Nowhere in the library is this done automatically. |
I found some older discussions, where this is mentioned: #4 (comment) |
After giving this a small amount of thought, I would presume that most use cases center on real world geographical data, in which case, extending beyond the bounds of the standard ±90deg/±180deg range aren't much use. There is probably a small use case to be argued for allowing non-normalized coordinates, particularly with abstract geo-manipulation, but I would posit that is the exception, not the rule. With that said, my vote would be to make coordinates always normalized to within the standard range, and potentially provide a way to keep calculations and positions unsigned, i.e. non-normalized. How that is achieved, I don't really know, since normalization is "lossy" in effect, and you can never return to the pre-normalized state, UNLESS you keep that data around as part of the position and bbox objects for some future use, but I think it's better to wait for someone in the community to actually raise that as a valid use case before building it into the implementation. |
100% agree Maybe this could be done in the constructors of the coordinate types. Similarly to this approach maybe: |
We could add a constructor Position operator +(Position other) =>
shouldRemainUnsigned
? Position.unsigned(lng + other.lng, lat + other.lat)
: Position(lng + other.lng, lat + other.lat); |
I will start with an implementation attempt soon |
The decision was, to keep The imagined behaviour with signed/unsigned is similar to |
Relating to the new vector functions #23 – which don't have a "wraparound" conversion built-in. But may also be important more broadly:
Originally posted by @baparham in #43 (comment)
The text was updated successfully, but these errors were encountered: