TileOutsideBounds error with get_geographic_bounds using EPSG:32723 and EPSG:3857 in rio-tiler 7.5.0 #791
-
Description Package Versions
Steps to Reproduce
In both cases, regardless of whether I use the Mercator or the lat/long image, I always get the error stating that the tile is outside of bounds—even though the coordinates are derived directly from the source. Expected Behavior Questions / Request for Guidance
Any guidance or suggestions on how to resolve this issue would be greatly appreciated. Thanks in advance for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
with Reader('orto-mercator.tif') as src:
crs = src.crs
print("crs", crs)
bounds = src.get_geographic_bounds(crs) here you're using the wrong CRS. You want to use the import io
import numpy as np
from PIL import Image
from rio_tiler.io import Reader
from rio_tiler.io import rasterio
from pyproj import Transformer
from matplotlib.pyplot import imshow
with Reader('orto-mercator.tif') as src:
bounds = src.get_geographic_bounds(src.tms.rasterio_geographic_crs)
print("bounds", bounds)
print("minzoom", src.minzoom)
tile = src.tms.tile
print(tile)
img = src.tile(bounds[0], bounds[3], src.minzoom + 1)
imshow(img) |
Beta Was this translation helpful? Give feedback.
There is a problem with this solution, but you put me in the right track!
your suggestion throws