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

Raise when nan bounds are passed to tiles #149

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samn
Copy link

@samn samn commented May 30, 2023

Otherwise the coordinate could get unintentionally clamped to the globe's extremeties:

w = max(-180.0, w)
s = max(-85.051129, s)
e = min(180.0, e)
n = min(85.051129, n)

>>> from math import nan
>>> max(nan, -180)
nan
>>> min(nan, 180)
nan
>>> max(-180, nan)
-180
>>> min(180, nan)
180

Otherwise the coordinate could get unintentionally clamped
to the globe's extremeties:
https://github.com/mapbox/mercantile/blob/fe3762d14001ca400caf7462f59433b906fc25bd/mercantile/__init__.py#L533-L536

```python
>>> from math import nan
>>> max(nan, -180)
nan
>>> min(nan, 180)
nan
>>> max(-180, nan)
-180
>>> min(180, nan)
180
```
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.

None yet

1 participant