[Gdal-dev] GDALWarpOptions - Destination dataset issue
Guillaume Bourel
gbourel at ago.fr
Thu Nov 23 10:45:03 EST 2006
Frank Warmerdam wrote :
> Guillaume Bourel wrote:
>> Hi,
>>
>> I am currently trying to warp GeoTiff data with any geographic
>> coordinate system into WGS84 with Mercator projection, within a C++
>> project.
>>
>> I do believe this should be done by using GDALWarpRegionToBuffer,
>> which needs a GDALWarpOperation, which, itself, needs a GDALWarpOptions.
>>
>>
>> GDALWarpOptions reference explains :
>>
>> GDALDatasetH GDALWarpOptions::hDstDS
>> <http://gdal.maptools.org/structGDALWarpOptions.html#o5>
>> Destination image dataset - may be NULL if only using
>> GDALWarpOperation::WarpRegionToBuffer()
>> <http://gdal.maptools.org/classGDALWarpOperation.html#a7>.
>>
>> but GDALWarpOperation::Initialize or GDALCreateWarpOperation both
>> returns CE_Failure, if hDstDS is set to NULL
>> (behavior due to ValidateOptions() call, which checks hDstDS isn't
>> NULL). Therefore, creation of the GDALWarpOperation fails.
>> And, as I don't have any destination file, my destination dataset is
>> NULL.
>>
>> I don't understand what I'm doing wrong,
>> if someone could explain me the way I should follow to successfully
>> create a GDALWarpOperation in order to use it with
>> GDALWarpRegionToBuffer.
>
> Guillaume,
>
> It appears that support for null hDstDS has "rotted" through disuse. I
> have made a few changes to the Validate() method that I hope will fix the
> problem, but I currently have no uses for this style of use of the warper
> so it is hard for me to check. Can you grab the latest from CVS and
> see if this helps?
>
> Best regards,
Thanks a lot Frank,
I've made an update from CVS this morning and everything is now working
well.
Guillaume.
--
BOUREL Guillaume - ATLANTIDE
consultant
Tel. : +33 (0)2 98 05 43 21
http://www.ago.fr/
--
Technopôle Brest Iroise
Site du Vernis - CS 23866
29238 Brest Cedex 3 - France
Tel. : +33 (0)2 98 05 43 21
Fax. : +33 (0)2 98 05 20 34
e-mail: atlantide-brest at ago.fr
More information about the Gdal-dev
mailing list