This post has NOT been accepted by the mailing list yet.
I'm using gdal C# bindings and when I want create a pansharpened image I have nothing.
I've read trac.osgeo.org ticket 6437 but I don't now how to add GDALDatasetShadow to a typemap (swig), so I desided to write some code bellow but its doesn't work. I guess that Gdal.CreatePansharpenedVRT function needed xml file with params, but what params....???
Has anybody any ideas about code (what params) or how to add GDALDatasetShadow to a typemap?
Also I'm trying the decision from ticket 6437, but 'SWIGTYPE_p_p_GDALRasterBandShadow' still been after compile!
public unsafe static void CreatePanSharpen(Dataset panchromDs)
Dataset d = Gdal.Open("c:\\multispectral.JP2", Access.GA_ReadOnly);
IntPtr ptr = new IntPtr;
ptr = Band.getCPtr(d.GetRasterBand(1)).Handle;
ptr = Band.getCPtr(d.GetRasterBand(2)).Handle;
ptr = Band.getCPtr(d.GetRasterBand(3)).Handle;
ptr = Band.getCPtr(d.GetRasterBand(4)).Handle;
var gcHandle = GCHandle.Alloc(ptr, GCHandleType.Pinned);
SWIGTYPE_p_p_GDALRasterBandShadow bands = new SWIGTYPE_p_p_GDALRasterBandShadow(gcHandle.AddrOfPinnedObject(), false, d);
var res = Gdal.CreatePansharpenedVRT(string.Empty, panchromDs.GetRasterBand(1), 4, bands);
if (res == null) throw new Exception("");