Hi, I need to crop a DEM raster file with a shapefile. This shapefile has many polygons. I need to calculate several variables after the crop operation. I do not need to write the warped result out to my disk and I intend to use either VRT or MEM once the test is passed.
The shapefile has the same map projection with the raster. I already obtained the vertex coordinates of each polygon and I passed as a polygon using the cutline argument, but the operation has no effect so far. In this way, I am constructing the geometry manually but I am not sure what I have missed, maybe the spatial reference? I assume I can also define the geometry through: poGeometry = poFeature->GetGeometryRef(); but I need a filter to remove unwanted features. These geometries are actually already in the shapefile. The current output are exactly the same as the input raster file, so I suspect the cutline, or hCutline option is not effective. Some details are also discussed here: https://gis.stackexchange.com/questions/371915/crop-raster-file-with-gdal-warp-c-api Please provide some suggestions. Thank you! Best Regards! *Chang Liao, PhD* *Earth Scientist, Atmospheric Sciences & Global Change Division* *Pacific Northwest National Laboratory, WA, USA.* *Email: changliao.climate at gmail.com <changliao.clim...@gmail.com> or chang.liao at pnnl.gov <chang.l...@pnnl.gov>* *Personal Website: http://www.changliao.us <http://www.changliao.us/>* *Lab Website: www.pnnl.gov <https://www.pnnl.gov/science/staff/staff_info.asp?staff_num=9326>*
_______________________________________________ gdal-dev mailing list gdal-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/gdal-dev