[Gdal-dev] default pixel size in gdalwarp

agnes123 agnesyipck at gmail.com
Mon Aug 3 02:05:48 EDT 2009


Frank,

Thanks for your reply.

Do you know if python can use the function  GDALSuggestedWarpOutput2() ? I
searched on web and found only the C/C++ examples.

Regards,
Agnes






Frank Warmerdam wrote:
> 
> agnes123 wrote:
>> 
>> Dear all,
>> 
>> i have one question on the default pixel size in gdalwarp. 
>> 
>> In gdalwarp, we can use -tr to determine output pixel size in x and y
>> direction, however, if i omit the argument -tr , gdal will have a default
>> pixel size value which is in target projection units. 
>> 
>> For example, if the orginal input raster which has geodetic projection
>> with
>> pixel size 0.000277778 (decimal degree), after projecting to Lambert
>> Conformal Conic without typing the argument -tr, gdal will have output
>> raster pixel size 28.793808m. What is the algorithm behind to obtain the
>> value 28.793808? 
>> 
>> I was wondering if there is somebody who knows it. I would greatly
>> appreciate it.Thanks!
>> 
>> Regards,
>> Agnes
>> 
> 
> Agnes,
> 
> The computation is done by the GDALSuggestedWarpOutput2() function.  I
> would
> suggest you read it's documentation and if still in doubt scan through the
> code.
> 
>   
> http://trac.osgeo.org/gdal/browser/trunk/gdal/alg/gdaltransformer.cpp#L162
> 
> It is basically a heuristic to maintain approximately the same diagonal
> size of a pixel in the destination coordinate system as it was in the
> source coordinate system.
> 
> Best regards,
> -- 
> ---------------------------------------+--------------------------------------
> I set the clouds in motion - turn up   | Frank Warmerdam,
> warmerdam at pobox.com
> light and sound - activate the windows | http://pobox.com/~warmerdam
> and watch the world go round - Rush    | Geospatial Programmer for Rent
> 
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/gdal-dev
> 
> 

-- 
View this message in context: http://n2.nabble.com/default-pixel-size-in-gdalwarp-tp3341802p3376077.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.


More information about the gdal-dev mailing list