Re: [gdal-dev] Clip Raster with Polygon C#

2018-04-03 Thread tval
That was it. Thanks! I had not tried putting the shapefile as an option. -- Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html ___ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev

Re: [gdal-dev] Clip Raster with Polygon C#

2018-04-03 Thread Paul Meems
Here's a snippet of the code I use: using (var ds = GDAL.Open(input, Access.GA_ReadOnly)) { if (ds == null) { throw new Exception("Can't open GDAL dataset: " + input); } var options = new[] { "-of", "vrt", "-overwrite",

[gdal-dev] Clip Raster with Polygon C#

2018-04-02 Thread tval
Is it possible to use the Gdal Warp wrapper or another method for clipping a raster to a polygon? I've tried using Gdal.wrapper_GDALWarpDestName and using input datasets such as a .tif and a .shp, but was unsuccessful. Perhaps I had the wrong options or inputs. Any help would be appreciated. Thanks