Re: [gdal-dev] FW: Function - GDALCreatePansharpenedVRT

2016-10-19 Thread Jidnyasa Nilange
Hi,

Can anyone provide me a flowchart of the methods to be used to actually access 
the pansharpened dataset and convert it into .tif?
i.e. I would like to know how to move ahead after getting CE_NONE from 
GDALPansharpenProcessRegion method. 

Thanks & regards,
Jidnyasa N

-Original Message-
From: Even Rouault [mailto:even.roua...@spatialys.com] 
Sent: Monday, October 17, 2016 7:44 PM
To: Jidnyasa Nilange 
Cc: gdal-dev@lists.osgeo.org
Subject: Re: [gdal-dev] FW: Function - GDALCreatePansharpenedVRT

Jidnyasa,

Please let the list CC'ed (I've re-added it)

> 
> Thanks for the reply. My doubt is if I am having only panchromatic and 
> multispectral files as an input how to generate pansharpening vrt 
> without using python script as I am trying to use only C++?

Well 2 choices:

1) port
https://svn.osgeo.org/gdal/trunk/gdal/swig/python/scripts/gdal_pansharpen.py
to C++. That shouldn't be too hard. It mostly formats the XML of the VRT and 
finally pass it to GDALCreateCopy

2) or perhaps less cumbersome, use the lower level C++ pansharping API of 
alg/gdalpansharpen.h ( http://www.gdal.org/gdalpansharpen_8h.html )

Even

> 
> Thanks & Regards,
> Jidnyasa N
> 
> -Original Message-
> From: Even Rouault [mailto:even.roua...@spatialys.com]
> Sent: Monday, October 17, 2016 2:40 PM
> To: gdal-dev@lists.osgeo.org
> Cc: Jidnyasa Nilange 
> Subject: Re: [gdal-dev] FW: Function - GDALCreatePansharpenedVRT
> 
> Hi,
> 
> >   I am trying to use  GDALCreatePansharpenedVRT  
> > function
> > 
> > however I am not been able to interpret the argument const char * 
> > pszXML
> > 
> >  Which is explained as  "Pansharpened VRT XML where 
> > 
> > elements have no explicit SourceFilename and SourceBand. The 
> > spectral bands in the XML will be assigned the successive values of 
> > the pahInputSpectralBands array. Must not be NULL."
> > 
> > 
> > 
> > Can someone please explain me, if this function merely converts the 
> > pansharpened VRT  XML to VRT dataset
> 
> Yes
> 
> > or does it actually pansharpens the
> > image using multispectral and panchromatic inputs
> 
> No, you have to read the content of the VRT dataset with GDAL 
> RasterIO() API or translate it to another format like GTiff with 
> GDALCreateCopy() for example.
> 
> > . If the latter is true
> > please let me know how to generate such an XML and what it should 
> > consist of.
> 
> See also
> http://www.gdal.org/gdal_vrttut.html#gdal_vrttut_pansharpen
> 
> And also http://www.gdal.org/gdal_pansharpen.html if you don't need to 
> embed that in your program but just run as an external program.
> 
> Even
> 
> --
> Spatialys - Geospatial professional services http://www.spatialys.com

--
Spatialys - Geospatial professional services http://www.spatialys.com

___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] FW: Function - GDALCreatePansharpenedVRT

2016-10-17 Thread Even Rouault
Jidnyasa,

Please let the list CC'ed (I've re-added it)

> 
> Thanks for the reply. My doubt is if I am having only panchromatic and
> multispectral files as an input how to generate pansharpening vrt without
> using python script as I am trying to use only C++?

Well 2 choices:

1) port 
https://svn.osgeo.org/gdal/trunk/gdal/swig/python/scripts/gdal_pansharpen.py 
to C++. That shouldn't be too hard. It mostly formats the XML of the VRT and 
finally pass it to GDALCreateCopy

2) or perhaps less cumbersome, use the lower level C++ pansharping API of 
alg/gdalpansharpen.h ( http://www.gdal.org/gdalpansharpen_8h.html )

Even

> 
> Thanks & Regards,
> Jidnyasa N
> 
> -Original Message-
> From: Even Rouault [mailto:even.roua...@spatialys.com]
> Sent: Monday, October 17, 2016 2:40 PM
> To: gdal-dev@lists.osgeo.org
> Cc: Jidnyasa Nilange 
> Subject: Re: [gdal-dev] FW: Function - GDALCreatePansharpenedVRT
> 
> Hi,
> 
> >   I am trying to use  GDALCreatePansharpenedVRT  function
> > 
> > however I am not been able to interpret the argument const char *
> > pszXML
> > 
> >  Which is explained as  "Pansharpened VRT XML where 
> > 
> > elements have no explicit SourceFilename and SourceBand. The spectral
> > bands in the XML will be assigned the successive values of the
> > pahInputSpectralBands array. Must not be NULL."
> > 
> > 
> > 
> > Can someone please explain me, if this function merely converts the
> > pansharpened VRT  XML to VRT dataset
> 
> Yes
> 
> > or does it actually pansharpens the
> > image using multispectral and panchromatic inputs
> 
> No, you have to read the content of the VRT dataset with GDAL RasterIO()
> API or translate it to another format like GTiff with GDALCreateCopy() for
> example.
> 
> > . If the latter is true
> > please let me know how to generate such an XML and what it should
> > consist of.
> 
> See also
> http://www.gdal.org/gdal_vrttut.html#gdal_vrttut_pansharpen
> 
> And also http://www.gdal.org/gdal_pansharpen.html if you don't need to
> embed that in your program but just run as an external program.
> 
> Even
> 
> --
> Spatialys - Geospatial professional services http://www.spatialys.com

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] FW: Function - GDALCreatePansharpenedVRT

2016-10-17 Thread Even Rouault
Hi,
> 
>   I am trying to use  GDALCreatePansharpenedVRT  function
> however I am not been able to interpret the argument const char * pszXML
> 
> 
> 
>  Which is explained as  "Pansharpened VRT XML where  elements
> have no explicit SourceFilename and SourceBand. The spectral bands in the
> XML will be assigned the successive values of the pahInputSpectralBands
> array. Must not be NULL."
> 
> 
> 
> Can someone please explain me, if this function merely converts the
> pansharpened VRT  XML to VRT dataset

Yes

> or does it actually pansharpens the
> image using multispectral and panchromatic inputs

No, you have to read the content of the VRT dataset with GDAL RasterIO() API 
or translate it to another format like GTiff with GDALCreateCopy() for example.

> . If the latter is true
> please let me know how to generate such an XML and what it should consist
> of.

See also
http://www.gdal.org/gdal_vrttut.html#gdal_vrttut_pansharpen

And also http://www.gdal.org/gdal_pansharpen.html if you don't need to embed 
that in your program but just run as an external program.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
___
gdal-dev mailing list
gdal-dev@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/gdal-dev