-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Pansharpening: require geotransform on panchromatic and multispectral bands #7373
Conversation
… bands Pansharpening now requires that panchromatic and multispectral bands have valid geotransform (in early versions, it was assumed in the case of missing geotransform that they covered the same geospatial extent). The undocumented VRT pansharpened MSShiftX and MSShiftY options (and the corresponding C++ GDALPansharpenOptions::dfMSShiftX and dfMSShiftY members) have been removed, due to using the inverted convention as one would expect, and being sub-par solution compared to using geotransform to correlate pixels of panchromatic and multispectral bands.
CC @tbonfort |
valid geotransform (in early versions, it was assumed in the case of missing | ||
geotransform that they covered the same geospatial extent). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
valid geotransform (in early versions, it was assumed in the case of missing | |
geotransform that they covered the same geospatial extent). | |
valid geotransform (in early versions the geotransform was not considered, i.e. it was expected that all bands covered the same geospatial extent). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
your suggestion is actually not quite true. If the geotransforms of the pan and ms band differed by more than one pixel of the pan, then the SpatialExtentAdjustment=Union default logic would add the necessary padding so their geotransform was taken into account (but with integer rounding, so not a sub-pixel accuracy from what I can see)
@tbonfort Did you get or will you have a chance to test that before I merge? |
Hi @rouault , I just ran a test and I believe there is an issue: I'm getting some This happens when I am using a vrt on the MS file to force an "incorrect" geotransform for testing.
|
FWIW, the recursion guard getting hit is this one: https://github.com/rouault/gdal/blob/69e65c35ebe2c236f5d4b9c8867005edab32fcd7/frmts/vrt/vrtrasterband.cpp#L1342 |
…bands have significant different spatial extent
… res) when they have different extents
fixed by commits added to this PR |
LGTM. I'll test more extensively in the coming weeks, but I'd say it's ok to merge. thanks @rouault |
Pansharpening now requires that panchromatic and multispectral bands have valid geotransform (in early versions, it was assumed in the case of missing geotransform that they covered the same geospatial extent). The undocumented VRT pansharpened MSShiftX and MSShiftY options (and the corresponding C++ GDALPansharpenOptions::dfMSShiftX and dfMSShiftY members) have been removed, due to using the inverted convention as one would expect, and being sub-par solution compared to using geotransform to correlate pixels of panchromatic and multispectral bands.