Skip to content

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.

1 participant