Skip to content

Commit b128bf2

Browse files
committed
FIX: Set EPSG:4326 for rasters with empty CRS to be orthorectified with RPCs
1 parent 9b3656f commit b128bf2

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
- FIX: Handle GCPs in VHR data
2525
- FIX: Fix raw CRS exported as string rather than CRS object for Maxar data [#255](https://github.com/sertit/eoreader/issues/255)
2626
- FIX: Use only the number of range looks to derive the resolution and pixel_size of CSG data [#256](https://github.com/sertit/eoreader/issues/256)
27-
- FIX: Retunr an empty `lxml.Element` as metadata for S1 RTC ASF products instead of `None` to ensure consistency
27+
- FIX: Return an empty `lxml.Element` as metadata for S1 RTC ASF products instead of `None` to ensure consistency
28+
- FIX: Set `EPSG:4326` for rasters with empty CRS to be orthorectified with RPCs
2829
- OPTIM: Use raw band path over default band path to speed up the computation of image information (extent, footprint, CRS, transform) of SAR ortho products
2930
- OPTIM: Allow predictor = 3 with LZW compression when saving SAR intermediate data as SNAP handles it properly now. [#173](https://github.com/sertit/eoreader/issues/173)
3031
- CI: Filter some warnings in pytest

eoreader/products/product.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2594,6 +2594,12 @@ def _orthorectify(
25942594
kw = utils._prune_keywords(["nodata", "num_threads"], **kwargs)
25952595
resampling = kw.pop("resampling", self.band_resampling)
25962596
vcrs = kw.pop("vcrs", os.getenv(DEM_VCRS))
2597+
2598+
if rpcs and not src_xda.rio.crs:
2599+
# RPCs are always in 4326 by convention
2600+
# https://rasterio.readthedocs.io/en/latest/topics/reproject.html#reprojecting-with-other-georeferencing-metadata
2601+
src_xda.rio.write_crs(vectors.EPSG_4326, inplace=True)
2602+
25972603
out_xda = rasters.reproject(
25982604
src_xda,
25992605
rpcs=rpcs,

0 commit comments

Comments
 (0)