[Gdal-dev] Gdal Warp in C#

Frank Warmerdam warmerdam at pobox.com
Tue Jan 30 11:52:05 EST 2007


Jean Michel PIERRET wrote:
> Hi,
> 
>  
> 
> How can i reproject images in BNG (British National Grid : epsgcode = 
> 27700) to Geographic (epsgcode 4326) using gdal in c#.
> 
> Else how can i user gdal warp in c#.

Jean Michel,

The warp api per-se is not wrapped in c# and other non-C++ languages.

But I do see the AutoCreateWarpedVRT() function is wrapped though I'm
not sure if it works fully.  For this you would roughly call the
AutoCreateWarpedVRT() function in the gdal package with the arguments:


GDALDatasetShadow *AutoCreateWarpedVRT( GDALDatasetShadow *src_ds,
                                         const char *src_wkt = 0,
                                         const char *dst_wkt = 0,
                                         GDALResampleAlg eResampleAlg = 
GRA_NearestNeighbour,
                                         double maxerror = 0.0 ) {

So you give it a source dataset the coordinate system of the source,
the coordinate system you want to warp to, the resampling type, and
the approximation error that is acceptable, and it returns a handle
to a "virtual warped dataset" that you could pass to CreateCopy() to
write to disk as a warped image.

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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list