-
Notifications
You must be signed in to change notification settings - Fork 74
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
Out of memory when serving large rasters #50
Comments
Why does Rasterio try to load the entire overview in order to calculate the default transform, is the real question here though. |
Sounds like a question better asked |
Sure, I just put it here as a note to us, that this is what causes the error. |
This looks bad. Rasterio / GDAL constructs an in-memory raster of the full size to compute the default transform. This can't be related to zoom level, either, since the arguments to |
Why would you need the raster to compute the transform...? Only to get the shape? |
To get the "best" resolution in the target CRS. Although I remember that we had some problems at high latitudes with that function, since it always keeps pixels square. I will experiment a little with non-square pixels in the VRT, that way we wouldn't need the default transform. |
Yes, it's probably that Rasterio tries to allocate 2x the full size of the raster for some reason.
Cool 👍 pretty ridiculous behaviour from Rasterio here, especially considering that we're using cloud-optimized rasters to get around having to load the entire thing. |
It's probably a GDAL limitation, but a pretty severe one if you think about it ... |
Looks like you're right, since this is the call that fails and makes Rasterio raise the exception: |
Seems to be a known issue: rasterio/rasterio#1131 Pretty sucky, looking into a workaround... |
-- Sean Gillies, 23 days ago hopefulness intensifies |
I used an overview to compute metadata, to get around the issue in #49. When I serve the data in Terracotta, I sometimes see this:
Which becomes a 500 response. It happens when I zoom out a bit, which might indicate that this could be a problem with loading the overviews. The innermost (highest res) overview is 43846x33163, which corresponds to a size of 1.45 GB (the raster is uint8), so the attempted allocation of 5.8 GB looks like a cast to some 32-bit size dtype of the innermost overview.
The text was updated successfully, but these errors were encountered: