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?

1
  • You can wrap in a python script using subprocess.Popen 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. Commented Jun 14, 2017 at 23:55

1 Answer 1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.