I have a raster image which have to be aligned over the polygon. Both the raster and polygon have the same coordinate system.

The figure shows the raster image which has to be fitted over the RED polygon.


How can I do it guys?

  • I have shape file for the polygon.
    – Borys
    Nov 18, 2014 at 18:47
  • move the polygon to the right and down or the raster to the left and up, Nov 19, 2014 at 5:32

5 Answers 5


If you don't need to stretch or rotate your raster, you can use the Shift tool (Data Management -> Projections and Transformations). Measure the offset in x and y, then run Shift incorporating these values.

edit: this answer assumes ArcGIS, as listed in the original tags

  • Is not it possible to do it using gdal translate and or gdal warp?
    – Borys
    Nov 19, 2014 at 3:15

Are you using ArcMap? Here's a way to form a polygon to your raster dataset:

(1) Multiply your raster by 0 using Raster Calculator. This is to generate a single value raster grid.

(2) Use Raster to Polygon to convert the raster dataset to a boundary polygon. You can choose to smooth the polygon or not.


Export your image to a format where the coordinates are numeric and text, good choices are Tiff + world file, BIL/BSQ (EHDR) or Esri ASCII Grid (AAIGRID). If you choose Tiff/world then you will need to destroy the embedded georeference using photoshop/gimp.

Open the world file/header and edit the coordinates. You should be able to calculate the x & y shift needed so just adjust the numbers by the X and Y required but don't change the cell size or rotation. See documentation on the BIL header, ASCII Grid format and Tiff world file.

If you have a large image then ASCII is not a good choice as the header is internal and you'd be opening a huge text file in notepad, use BIL or Tiff instead as the header is external to the image data and easier to edit in notepad.


Why don't the polygon and image line up? They both have the same coordinate system but does the image have a world file as well? One way to get an image to be located in a particular coordinate space is to georeference it. For example, if you were using ArcMap you would use the Georeferencing toolbar and then add control points where a location on the image is matched to a location on the polygon (e.g. top left corner of image to top left corner of polygon).


Move the polygon to the right and down or the raster to the left and up.

I would shift the Polygon using QGIS edit tools (or Arc) if you have access as opposed to moving the polygon in GDAL warp.

  • how to do that? can it be done using gdalwarp?
    – Borys
    Nov 19, 2014 at 8:55
  • Although this is in good humor, it does not provide an answer to the question. Please elaborate...
    – Aaron
    Nov 19, 2014 at 13:51

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.