Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a large raster created from values that cover the whole United States and Alaska which are both polygon and polyline features, this raster was caluclated using Spatial Analyst IDW Interpolation. How can I get the raster to clip with the either the polyline of the United States border or the polygon shape of the United States?alt text

UPDATE: 12/21/10

Ok so I followed your advice Swingley and set the cell size environment setting to match the original raster. It gives it a smooth border but instead of having smooth grades of differentiating colors now i have large blocks of differentiating colors.

Good alt text

Bad alt text

Any ideas on how I can fix this and get the Bad raster to look like the orignial (good) raster but keep the bad rasters border?

share|improve this question
up vote 7 down vote accepted

Use Extract by Mask and specify your polygon feature class of the US as the mask.

share|improve this answer
Tried this but it severely killed the resolution of the raster, any way to keep the original res? – Furlong Dec 21 '10 at 0:03
What's the cell size of the raster being clipped? You could also try setting the cell size environment setting for ArcGIS:… – Derek Swingley Dec 21 '10 at 1:25
You are absolutely correct. In some cases the result will be sensitive to the grid origin, too, so a better approach is to set the origin and cellsize to the same as the interpolated grid. Actually, in retrospect it's best to establish the desired projection, specify an explicit raster environment at the outset, create the mask first, and then do the interpolation with the mask in place: that would be easier for both the analyst and the computer. – whuber Dec 21 '10 at 14:48
This works great, thank you guys! – Furlong Dec 21 '10 at 15:35

With GRASS GIS you could rasterize your polygone of the USA ( and then use a mask.

share|improve this answer
I will try that for my next project. – Furlong Dec 21 '10 at 17:50

You can also use the GDAL utility program GDALWarp -

Passing in a -cutline parameter (a feature from any OGR datasource) clips the original raster.


C:\gdal\apps\gdalwarp C:\myraster.tif C:\output.tif -cutline C:\inputfeat.json -dstnodata -9999

In GDAL 1.8 there is a new -crop_to_cutline paramter that may also be useful.

share|improve this answer
only problem with this -cutline parameter is that the resulting raster comes with a mislocation of ~1 pixel... – vascobnunes Jul 14 '11 at 14:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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