Created
April 3, 2020 11:10
-
-
Save yuhangch/5f3c389586899672a03c4ce2636cbd85 to your computer and use it in GitHub Desktop.
Rasterio Hint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mercantile | |
import rasterio | |
from rasterio.session import OSSSession | |
from rasterio.warp import transform_bounds | |
from rio_tiler import constants | |
with rasterio.open(prefix) as src: | |
bounds = transform_bounds( | |
src.crs, constants.WGS84_CRS, *src.bounds, densify_pts=21 | |
) | |
mintile = mercantile.tile(bounds[0], bounds[3], 10) | |
maxtile = mercantile.tile(bounds[2], bounds[1], 10) | |
print(mintile,maxtile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment