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?

  • 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. – Michael Stimson Jun 14 '17 at 23:55
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, privacy policy and cookie policy

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