Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Hello jay laura: thank you for the reply but the lines you have suggested works for python i guess. i only uses c++ code. So i dont think gdal_translate work in c++ coding . Commented Jan 8, 2013 at 17:01
  • 1
    @hardik, gdal_translate is written in C++ and operates independently of the gdal python bindings, here's the code: trac.osgeo.org/gdal/browser/trunk/gdal/apps/gdal_translate.cpp. It's part of the core utility set and a compiled binary is generally installed by default (unless you're not installing and only building from source). Commented Mar 22, 2013 at 16:22
  • 1
    The unprojected command seems inconsistent with the documentation gdal.org/gdal_translate.html, which says -srcwin xoff yoff xsize ysize. Commented Feb 17, 2016 at 18:44
  • Can you explain what you mean by "projected" and "unprojected". My raster has a projection, but I don't want to reproject it — which form is correct? Commented Dec 2, 2019 at 18:59
  • @colllin "projected" means you can specify the coordinates using the coordinate format of the projection (e.g. for example if using EPSG:4326 you can provide 90/180 lat/lon coordinates) and "unprojected" means you specify coordinates as x/y pixel values of the raster. For projected, you can specify the SRS using -projwin_srs. It does not actually reproject anything in the output. Commented May 21, 2021 at 8:08