-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image bounds are in geographic coordinate system #354
Comments
Hi @mcvittal thanks for opening the issue. the error message says that the Mercator Tile x=1, y=1, z=1 bounds coordinates do no intersect with your raster bounds. what is the output of from rio_tiler.io import COGReader
import morecantile
tms = morecantile.tms.get("WebMercatorQuad")
print(tms.bounds(1, 1, 1)
with COGReader("myraster_projected.tif") as img:
print(img.bounds) |
Thanks for the quick reply! This outputs
|
☝️ shows that your raster doesn't intersect with tile 1-1-1 (latitude of your file is ~48 North, while grid max lat is ~0) I'm going to close this issue because it's not bug, but please feel free to re-open if you feel the documentation should better explain that we cannot read tiles that are outside your raster bounds 🙏 |
I'm just a little bit confused here. The image is a small high-res image located in Paris, France (Hence the location of 2, 48) - this should be well within the bounds of the Web Mercator maximum and minimum bounds. I'm trying to serve this as a tiled webmap, and thought that this tool would be the best way to do something like this on the fly. Below is a screenshot of the image with a Google Maps basemap: Obviously, at zoom level 1, it would be a pretty useless webmap tile as it is very small, but it should be able to generate something at least. |
@mcvittal you are right, rio-tiler can create tile from you file (but I wouldn't recommend using it for really low zoom level). if you try tile x=1, y=0, z=1. it should work (but it will be really memory intensive: see #348) |
Hello!
I'm not sure what I'm doing wrong here, but I'm trying to generate tiles from a GeoTIFF, but it can't assess that a tile is within its bounds because in the tile_exists method within base.py, the bounds array contains geographic lat/lon coordinates instead of projected coordinates.
My basic code is as follows:
Which throws the error
I've tried re-projecting my raster to EPSG:3857 but the issue still prevails - I've added some print statements to get the bounds array contents and it still prints out that it is in a geographic coordinate system. Is there an additional step I should be doing?
The text was updated successfully, but these errors were encountered: