Conversation
vincentsarago
commented
Sep 16, 2025
| if da.rio.get_gcps(): | ||
| ds = ds.rename({"ground_range": "x", "azimuth_time": "y"}) | ||
| ds["x"] = numpy.arange(ds.shape[1]) | ||
| ds["y"] = numpy.arange(ds.shape[0]) |
Collaborator
Author
There was a problem hiding this comment.
The array in da is still unprojected so it's coordinates are x and y
vincentsarago
commented
Sep 16, 2025
| ds.rio.height, | ||
| gcps=gcps, | ||
| ) | ||
| bounds = array_bounds(height, width, transform) |
Collaborator
Author
There was a problem hiding this comment.
Confirmed with COGs
from rio_tiler.io import Reader
with Reader("s3://sentinel-s1-l1c/GRD/2024/12/6/IW/DV/S1A_IW_GRDH_1SDV_20241206T180253_20241206T180318_056875_06FBFD_25AD/measurement/iw-vh.tiff") as src:
print(src.transform)
print(src.height, src.width)
print(src.bounds)
| 0.00, 0.00,-2.92|
| 0.00,-0.00, 39.97|
| 0.00, 0.00, 1.00|
18243 31563
(-2.9232683268903976, 38.06529167118216, 0.3728770426105874, 39.97042046045461)
from titiler.eopf.reader import GeoZarrReader
from rasterio.warp import calculate_default_transform
from rasterio.transform import array_bounds
with GeoZarrReader("s3://esa-zarr-sentinel-explorer-fra/tests-output/eopf_geozarr/S1A_IW_GRDH_1SDV_20241206T180253_20241206T180318_056875_06FBFD_25AD.zarr") as src:
ds = src.datatree["/S01SIWGRD_20241206T180253_0025_A325_25AD_06FBFD_VV/measurements/0/grd"]
transform, width, height = calculate_default_transform(
"epsg:4326",
"epsg:4326",
ds.shape[1],
ds.shape[0],
gcps=ds.rio.get_gcps(),
)
bounds = array_bounds(height, width, transform)
print(transform)
print(height, width)
print(bounds)
| 0.00, 0.00,-2.92|
| 0.00,-0.00, 39.97|
| 0.00, 0.00, 1.00|
18243 31563
(-2.923268334017043, 38.065291443928366, 0.372877180534696, 39.970420317038254)
Collaborator
Author
BLOCKEDWe're missing some pieces in rioxarray to be able to work with the array and the external gcps. In Rasterio's world we virtually apply the GCPS (reproject) to the dataset using WarpedVRT before doing any read operation so GDAL perform all the transformation between pixel space and the projected space. Sadly there is no When we do a Tile request we do:
I need to check the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.