[gdal-dev] Using GDALTranslateOptions with '-a_ullr' doesn't work

Even Rouault even.rouault at spatialys.com
Tue Jan 17 00:05:57 PST 2017


On mardi 17 janvier 2017 08:59:30 CET Paul Meems wrote:
> Hi list,
> 
> I'm using GDAL v2.1.2 from GisInternals.com on Win10 with the C#-bindings.
> 
> I'm trying to recreate this gdal_translate command in C#:
> gdal_translate -of GTiff -a_nodata 65535 -a_srs "+proj=stere +lat_0=90
> +lon_0=0 +lat_ts=60 +a=6378.14 +b=6356.75 +x_0=0 y_0=0" -a_ullr 0.0,
> -3650.000, 800.000, -4415.000 "HDF5:\"in.h5\"://image1/image_data" "out.tif"
> 
> This is my C#-code:
> var options =
>     new GDALTranslateOptions(new[]
>     {
>         "-of", "GTiff",
>         "-a_nodata", "65535",
>         // "-a_srs", "\"+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60
> +a=6378.14 +b=6356.75 +x_0=0 y_0=0\"",

Remvoe the \" in the proj.4 string. This is just needed for invokation from a shell, not when 
passing arguments as a string

>         //"-a_ullr", "0.0, -3650.000, 800.000, -4415.000"

Split the four values as 4 separate strings.

>     });
> var newDs = Gdal.wrapper_GDALTranslate(outputFile, ds, options, null, null);
> 
> The above code works, because I commented the last two GDALTranslateOptions.
> 
> When I enable the -a_srs option I get this error: Failed to process SRS
> definition
> When I enable the -a_ullr option I get Unknown option name '-a_ullr'
> 
> So it seems I'm not doing it right. I tried looking for examples but
> couldn't find any.
> Can anybody assist?
> 
> Thanks,
> 
> Paul


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170117/eda462e1/attachment.html>


More information about the gdal-dev mailing list