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

Fatal error converting invalid longitude #15

Open
hishma opened this issue Jul 7, 2024 · 0 comments
Open

Fatal error converting invalid longitude #15

hishma opened this issue Jul 7, 2024 · 0 comments

Comments

@hishma
Copy link

hishma commented Jul 7, 2024

A fatal error occurs when converting a CLLocation or a CLLocationCoordinate2D with an invalid longitude to a UTMCoordinate .

For example:

let coordinate = CLLocationCoordinate2D(latitude: 90, longitude: -180.1)
let utm = coordinate.utmCoordinate()

CLFatal error: Double value cannot be converted to UInt because the result would be less than UInt.min

This is due in part to the unfortunate fact that you can actually create an invalid CLLocationCoordinate2D.

And error is not raised when using an invalid latitude by the way.

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

No branches or pull requests

1 participant