Hi,

I have never done anything with RPCs, but maybe you could remove RPCs with 
something like “gdal_translate -co profile=baseline input.tif output.tif” 
(delete the aux.xml or use that magic config option that I do not remember out 
of my head), define some fake geotransformation by defining same ullr 
coordinates and crs for both PAN and MS images, then pansharpen, and finally 
copy the RPCs back like you have done before. I apologize if this does not make 
any sense.
-Jukka Rahkonen-

Lähettäjä: gdal-dev <gdal-dev-boun...@lists.osgeo.org> Puolesta Joe McGlinchy 
via gdal-dev
Lähetetty: tiistai 25. helmikuuta 2025 23.38
Vastaanottaja: Howard Butler <how...@hobu.co>; gdal-dev@lists.osgeo.org
Aihe: Re: [gdal-dev] pansharpening on images with RPCs post GDAL 3.6

My apologies for the repost, was not aware that is against the rules of the 
list-serv. noted!

The workflow I described, pansharpening on data in image space, is a common 
practice. This being deprecated was surprising to see as a user, but I 
understand the reasoning in the migration notes. If I end up determining a 
workflow that allows similar functionality with gdal > 3.6, I'll be sure to 
respond accordingly for the benefit of the community.

As for the rest of the reply, from one working professional to another, I'll 
look past it. thanks!

-Joe
________________________________
From: Howard Butler <how...@hobu.co<mailto:how...@hobu.co>>
Sent: Tuesday, February 25, 2025 14:25
To: Joe McGlinchy <j...@aidash.com<mailto:j...@aidash.com>>
Cc: gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org> 
<gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>>
Subject: Re: [gdal-dev] pansharpening on images with RPCs post GDAL 3.6


EXTERNAL SENDER. DO NOT click links, or open attachments, if the sender is 
unknown, or the message seems suspicious in any way. DO NOT provide your user 
ID or Password.




Joe,

Ask the AI from AiDASH to tell you how to do it? Oh, right, the GDAL list is 
your training corpus, not the inference data.

Sorry for being snotty, but please refrain from reposting questions to the list 
like this. If no one answered your question the first time, the LLM 
hallucinates and pukes out-of-order GDAL arguments at you, and you cannot dig 
through the source code and documentation to figure it out yourself, you should 
hire a consultant. https://gdal.org/en/stable/community/service_providers.html 
is a list of a few, and inspecting the commit history of the repository should 
give you some inspiration for others to privately contact.

Howard



On Feb 25, 2025, at 2:51 PM, Joe McGlinchy via gdal-dev 
<gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>> wrote:

Any advice on how to pansharpen image space data with RPCs in gdal >= 3.7?? 
Repeating below.

Hello,

I saw in the migration notes from GDAL 3.6 -> 3.7:

- 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.

Previously, I had been taking a PAN and MS set of images with RPCs and running 
gdal_pansharpen, then copying over the RPCs from the PAN file, then continuing 
on in my workflow. This no long works past GDAL 3.6, so is there a recommended 
workflow for doing this? I've been able to "gdalwarp -rpc" the files prior to 
calling gdal_pansharpen, but i'd like to retain the image in image space with 
RPCs if possible.

thanks,
Joe

________________________________
From: Joe McGlinchy <j...@aidash.com<mailto:j...@aidash.com>>
Sent: Friday, February 14, 2025 10:37
To: gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org> 
<gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>>
Subject: pansharpening on images with RPCs post GDAL 3.6

Hello,

I saw in the migration notes from GDAL 3.6 -> 3.7:

- 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.

Previously, I had been taking a PAN and MS set of images with RPCs and running 
gdal_pansharpen, then copying over the RPCs from the PAN file, then continuing 
on in my workflow. This no long works past GDAL 3.6, so is there a recommended 
workflow for doing this? I've been able to "gdalwarp -rpc" the files prior to 
calling gdal_pansharpen, but i'd like to retain the image in image space with 
RPCs if possible.

thanks,
Joe
_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org<mailto:gdal-dev@lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/gdal-dev

_______________________________________________
gdal-dev mailing list
gdal-dev@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/gdal-dev

Reply via email to