mercantile
mercantile copied to clipboard
Spherical mercator tile and coordinate utilities
"bounding-box" -> "bounding-tile"
Looks like sphinx documentation is not fully finished. ```console + /usr/bin/sphinx-build -n -T -b man docs build/sphinx/man Running Sphinx v4.5.0 making output directory... done WARNING: html_static_path entry '_static' does not...
Hey folks :wave: I'm working on some projects coming with type annotations and I'm using mercantile in there, too. That's why I'm asking what your thoughts are re. type hints...
This was first brought up in https://github.com/mapbox/mercantile/issues/122#issuecomment-788116884 which mentions the use case of calculating the parent of a zoom 0 tile: ```python >>> mercantile.parent(mercantile.Tile(0,0,0)) Tile(x=0, y=0, z=-1) ``` The zoom...
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...
Per updated GeoJSON spec: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6 Polygon specification now indicates: ``` A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise,...
Resolves https://github.com/mapbox/mercantile/issues/148 See updated specification re: right-hand rule: https://datatracker.ietf.org/doc/html/rfc7946#section-3.1.6
Longitudes outside the -180/180 range don't seem to be handled: ```py import mercantile bbox = mercantile.LngLatBbox(180, 0, 180+360, 1) list(mercantile.tiles(*bbox, 10) # [Tile(x=1023, y=509, z=10), Tile(x=1023, y=510, z=10), Tile(x=1023, y=511,...
In order to get tiles across the x International Date Line, this update will list the neighboring tiles across the 2**z and 0 divide. The original version will not include...
Just a minor fix to a code example.