Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

3 Answers 3

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
2  
What's the cell size of the raster being clipped? You could also try setting the cell size environment setting for ArcGIS: help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//… –  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
add comment

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

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

You can also use the GDAL utility program GDALWarp - http://www.gdal.org/gdalwarp.html

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

E.g.

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
1  
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
add comment

Your Answer

 
discard

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.