I am looking for the easiest way to programmatically clip a raster to a rectangular extent for testing purposes. I have GDAL and Python installed on a virtual machine and would like to run the code from Jupyter (python/command line) or command line directly. I do not have a polygon with the extent yet. I am not looking for answers that involve QGIS/ ArcGIS or some other GUI.
I found this resource but I was hoping for something more succinct like:
some-command inputraster.tif outputraster.tif -extent [lower left corner, upper right corner]
- Create polygon
- Clip using polygon
I am pretty sure there must be some gdal command out there.