Replies: 2 comments 5 replies
-
I think this is more a rasterio/rio-tiler design issue 👇 rio-tiler code from rio_tiler.io import Reader
lon, lat = -119.9019, 34.3468
with Reader("https://cdn.proj.org/us_nga_egm96_15.tif") as src:
print(src.point(lon, lat, coord_crs="epsg:4326").data)
print(src.point(lon, lat, coord_crs="epsg:4326", resampling_method="bilinear").data)
[-36.604877]
[-36.604877] which can be translated in rasterio code import rasterio
from rasterio.warp import transform as transform_coords
from rasterio import windows
from rasterio.enums import Resampling
lon, lat = -119.9019, 34.3468
with rasterio.open("https://cdn.proj.org/us_nga_egm96_15.tif") as src:
xs, ys = transform_coords("epsg:4326", src.crs, [lon], [lat])
lon, lat = xs[0], ys[0]
row, col = src.index(lon, lat)
print(
src.read(
window=windows.Window(row_off=row, col_off=col, width=1, height=1),
masked=True,
resampling=Resampling["nearest"],
)[0][0]
)
print(
src.read(
window=windows.Window(row_off=row, col_off=col, width=1, height=1),
masked=True,
resampling=Resampling["bilinear"],
)[0][0]
)
[-36.604877]
[-36.604877] I think it comes down about how the pixel coordinates are
in rio-tiler, we will always use the To be honest I'm not quite sure how GDAL |
Beta Was this translation helpful? Give feedback.
-
@scottyhq The comments ☝️ show there are differences between GDAL and rio-tiler/rasterio concept of
rio-tiler implementation is similar to https://github.com/OSGeo/gdal/blob/master/swig/python/gdal-utils/osgeo_utils/samples/gdallocationinfo.py#L280-L329 function. Two choice here:
|
Beta Was this translation helpful? Give feedback.
-
Problem description
I'm only seeing 'nearest' resampling coming back for point sampling:
Expected Output
Environment Information
titiler.xyz 0.21.1
Beta Was this translation helpful? Give feedback.
All reactions