1

i want to use subset a large raster image using gdal_translate with srcwin parameter but i want also to give some reference point to be at the center of the output file .

so if the output file size is 2000X2000 pixel for exemple, i want that my given point(lat/lon) to be at the center

How can this be achieved?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
user2475096
  • 247
  • 3
  • 7
  • You can wrap in a python script using subprocess.Popen https://docs.python.org/2/library/subprocess.html, I use that approach and also to write a batch file which can be Popen'ed at the end, just depending on how many iterations are to be called. – Michael Stimson Jun 14 '17 at 23:55

1 Answers1

0

Instead of using -srcwin, try using -projwin. -projwin takes the form -projwin ulx uly lrx lry and works in georeferenced coordinates, so if you know your center point and know the size (2000x2000 pixels) it is very simple to work out the values ulx uly lrx lry relative to your center.

MappaGnosis
  • 33,857
  • 2
  • 66
  • 129