<div dir="ltr">Thanks Even for your reply, it helped me great.<div><br></div><div>For future reference here's the working C# code:</div><div><br></div><div><div><font face="monospace, monospace">var options =</font></div><div><font face="monospace, monospace">    new GDALTranslateOptions(new[]</font></div><div><font face="monospace, monospace">    {</font></div><div><font face="monospace, monospace">        "-of", "GTiff",</font></div><div><font face="monospace, monospace">        "-a_nodata", "65535",</font></div><div><font face="monospace, monospace">        "-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",</font></div><div><font face="monospace, monospace">        "-a_ullr", "0.0", "-3650.000", "800.000", "-4415.000"</font></div><div><font face="monospace, monospace">    });</font></div><div><font face="monospace, monospace">var newDs = Gdal.wrapper_GDALTranslate(outputFile, ds, options, null, null);</font></div></div><div><br></div><div><br></div><div class="gmail_extra">Regards,<br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><br>
<br>
Paul<br>
<br>
<div style="font-size:13.3px;font-family:Verdana,Arial,Helvetica,sans-serif"><div style="border:1px solid #e5e5e5;background-color:#f8f8f8;padding:0.8em 0.8em 0.3em 0.8em"><div style="margin:0 0 8px 0"><p style="margin:0"><span><b><img style="float:left;margin-left:5px;margin-right:5px" src="http://www.bontepaarden.nl/bontepaarden/images/newButton.png" alt="" height="120" width="160">Paul Meems </b><br><span>Release manager, configuration manager</span><br><span>and forum moderator of MapWindow GIS.</span><br><a href="http://www.mapwindow.org/" target="_blank"><span>www.mapwindow.org</span></a><br><br><span>Owner of MapWindow.nl - Support for</span><br><span>Dutch speaking users.</span><br><a href="http://www.mapwindow.nl/" target="_blank"><span>www.mapwindow.nl</span></a><br></span></p>
<p style="margin:0px"><b><br></b></p><p style="margin:0px"><b>The MapWindow GIS project has moved to <a href="https://github.com/MapWindow" target="_blank">GitHub</a>!</b></p><p style="font-size:13.3px;margin:0px"><br><a href="https://github.com/MapWindow/MapWinGIS/releases" target="_blank">Download the latest MapWinGIS mapping engine.</a><br></p><p style="font-size:13.3px;margin:0px"><span style="font-size:13.3px"><a href="https://github.com/MapWindow/MapWindow5/releases" target="_blank">Download the latest MapWindow 5 open source desktop application.</a></span></p></div></div><img src="http://p1.wisestamp.com/pixel.png?p=mozilla&v=3.9.12&t=1322134056890&u=482737fd0c4ca423" height="1" width="1"></div>
</div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">2017-01-17 9:05 GMT+01:00 Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>
<div style="font-family:'monospace';font-size:9pt;font-weight:400;font-style:normal"><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">On mardi 17 janvier 2017 08:59:30 CET Paul Meems wrote:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Hi list,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> I'm using GDAL v2.1.2 from GisInternals.com on Win10 with the C#-bindings.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> I'm trying to recreate this gdal_translate command in C#:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> gdal_translate -of GTiff -a_nodata 65535 -a_srs "+proj=stere +lat_0=90</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +lon_0=0 +lat_ts=60 +a=6378.14 +b=6356.75 +x_0=0 y_0=0" -a_ullr 0.0,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> -3650.000, 800.000, -4415.000 "HDF5:\"in.h5\"://image1/<wbr>image_data" "out.tif"</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> This is my C#-code:</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> var options =</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>     new GDALTranslateOptions(new[]</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>     {</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>         "-of", "GTiff",</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>         "-a_nodata", "65535",</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>         // "-a_srs", "\"+proj=stere +lat_0=90 +lon_0=0 +lat_ts=60</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> +a=6378.14 +b=6356.75 +x_0=0 y_0=0\"",</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</span><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Remvoe the \" in the proj.4 string. This is just needed for invokation from a shell, not when passing arguments as a string</p><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>         //"-a_ullr", "0.0, -3650.000, 800.000, -4415.000"</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</span><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Split the four values as 4 separate strings.</p><span class="">
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">>     });</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> var newDs = Gdal.wrapper_GDALTranslate(<wbr>outputFile, ds, options, null, null);</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> The above code works, because I commented the last two GDALTranslateOptions.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> When I enable the -a_srs option I get this error: Failed to process SRS</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> definition</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> When I enable the -a_ullr option I get Unknown option name '-a_ullr'</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> So it seems I'm not doing it right. I tried looking for examples but</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> couldn't find any.</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Can anybody assist?</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Thanks,</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">> Paul</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"> </p>
</span><p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">-- </p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin-top:0px;margin-bottom:0px;margin-left:0px;margin-right:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div></blockquote></div><br></div></div>