Skip to content

Commit 12698fb

Browse files
Merge pull request #184 from developmentseed/docs/bbox-tiles-example
docs: add example for finding tiles for a bounding box
2 parents 988f02f + 525930b commit 12698fb

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
## Unreleased
33

4+
* docs: add example of how to enumerate tiles for a bounding box and zoom level(s)
45
* use `WGS84` as default CRS for `TileMatrixSet.feature` GeoJSON response (as per specification)
56
* add `geographic_crs` option for `TileMatrixSet.feature` method
67
* update non-WGS84 CRS notation in `TileMatrixSet.feature` GeoJSON response

docs/src/usage.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,30 @@ tms._tile(x, y, 4)
4141
>>> Tile(x=15, y=10, z=4)
4242
```
4343

44+
### Find all tiles for a bounding box and zoom level(s)
45+
46+
```python
47+
import morecantile
48+
49+
tms = morecantile.tms.get("WebMercatorQuad")
50+
51+
tiles = tms.tiles(
52+
west=-93,
53+
south=46,
54+
east=-92,
55+
north=47,
56+
zooms=[8],
57+
)
58+
59+
for tile in tiles:
60+
print(tile)
61+
62+
>>> Tile(x=61, y=90, z=8)
63+
>>> Tile(x=62, y=90, z=8)
64+
>>> Tile(x=61, y=91, z=8)
65+
>>> Tile(x=62, y=91, z=8)
66+
```
67+
4468
### Get Geojson Feature
4569

4670
```python

0 commit comments

Comments
 (0)