telluric
telluric copied to clipboard
Get_tile should return a raster which is projected to web_mercator
While investigating this issue I noticed another thing:
I get the same result regardless of the masked
and resampling
. Is this to be expected?
Also, GeoRaster2.get_tile
(internally GeoRaster2.get_window
) fails for in-memory rasters:
from rasterio.enums import Resampling
import telluric as tl
from telluric.constants import *
rs1 = tl.GeoRaster2.open("../tests/data/raster/overlap1.tif", lazy_load=False)
rs2 = tl.GeoRaster2.open("../tests/data/raster/overlap2.tif", lazy_load=False)
rs2_alt = (
rs2
.reproject(dst_crs=WGS84_CRS, resampling=Resampling.nearest)
.reproject(dst_crs=WEB_MERCATOR_CRS, resampling=Resampling.nearest)
)
rs2.get_tile(4377, 3038, 13) # Works
rs2_alt.get_tile(4377, 3038, 13) # Fails
Confirmed original issue:
rs2_4326.save("/tmp/rs2_4326.tif")
tl.GeoRaster2.open("/tmp/rs2_4326.tif").get_tile(4377, 3038, 13) # Empty image
I think you should open on each of the issues here an issue of its own,
about the mask, the mask will not have an effect on a raster that nodata value set, the paramter tells rasterio not to read the mask from the raster, we are doing it, because when you have no-data value set up rasterio is not using the overview masks
I think you should open on each of the issues here an issue of its own
Done: #118 and #119