How do I clip a raster with a polygon in ArcGIS 10?

245175
41
Jump to solution
09-03-2010 01:42 PM
JennSmithyman
New Contributor II
I have always used Hawth's tools (I have 3D Analyst not Spatial Analyst), but with the upgrade the tools disappeared....  Can I still get Hawth's tools to work with 10 or is there a function to clip by polygon that I missed?

I have approx. 100 images that I need to clip to field boundaries (polygon layer).

Thank you.
Tags (1)
41 Replies
DonovanCameron
Occasional Contributor II
Is there a way to clip a raster with a polygon but keep the outer portion? (ie, to create a donut?)

Thanks


A maybe not so quick solution...

Convert the polygon to a raster with the same extent of your raster.
But make the areas of the polygon equal to NoData and all other areas outside the polygon equal to 0 or some other valid integer.

Then use those as the input in the extract my mask. The polygon area, which has been set to NoData will 'mask out' these portions on the output raster.

I would be interested to know if there was a tool that could automatically do this (I am thinking a checkmark somewhere...)

The above would fit nicely in a small model or python script so it can be ran over and over again in the future if needed.
EricRice
Esri Regular Contributor
Is there a way to clip a raster with a polygon but keep the outer portion? (ie, to create a donut?)


Andrea,

You can use the Mask button on the Image Analysis Window in ArcGIS 10. 

Image Analysis window: Processing section

Regards,
Eric
0 Kudos
JoePartlow
New Contributor III
FYI. I am experiencing some strange results as the moment using the Clip tool.  See attached ...
0 Kudos
DonovanCameron
Occasional Contributor II
FYI. I am experiencing some strange results as the moment using the Clip tool...


Can you verify what projection your datasets are in?

Check to see that they are using the same projection and coordinate system before running the clip.
I've had suspect results when trying to do analysis on datasets that are in different projections.

If you are still getting problems try some of the other suggestions like Extract by Mask.
0 Kudos
EricRice
Esri Regular Contributor
Joe,

Its a bug in the software and I put the tracking number in your other post.  Extract by Mask will work, or getting 10.1 Beta will work (the fix is in beta for Clip).

Best Regards,
Eric
0 Kudos
RayMontgomery
New Contributor III
Please give some thought to allowing a workflow to allow NOT promoting the raster bit depth even when using the "clip to polygon".  Why not leave this under the user's control?

For example, we have some ordinary 8-bit BW historical aerials I want to load to SDE.  I need to clip off the areas valued "0" around the edge (areas should have been "nodata") of some of the images, in order to get a better color matching result when mosaicing to SDE. (If I just load them directly to SDE using the "ignore background value" option, it works, but the imagery has bad tonal matching between photos, hence the need for the color balance/matching etc.) Note that NONE of the area to be extracted from the image is currently nodata.

If I clip using a poly and do the geometry clipping, it promotes to 16 bit, which DOUBLES the size on disk (even though NONE is currently nodata, so it should NOT need to do this). Then I'd be trying to mosaic 8 and 16 bit imagery into the same SDE dataset, so it would end up doubling the whole set to 16 bit, taking up 2x the disk space needed.

But if I set the 0 to be no data, then any black areas in the photo also get to be nodata, leaving holes.

So the only workflow I have come up with is to clip the images, then reclassify each one twice (once to set the current nodata value to 255 and the existing 255 to 254, then again to set the 255 to nodata) to force it back to 8 bit.  So I waste several hours fighting this.

Why does this have to be so hard?  Why can't there be an option similar to the "ignore background color" when doing the clip?
0 Kudos
DianeMcConnaughey
Occasional Contributor
ArcGIS 10.0 SP3 XP  Extract by mask worked for, if the polygon and raster were in the same projection.  It produced a corrupt raster when they were in different projections. (then again, my computer promptly froze up, so maybe something was going on with the network)  Clip in Data management worked if they were in the same projection, but the output included the entire extent of the polygon, not just the area of the polygon.  It froze up when they were in different projections.  So, it seems like things haven't really changed except for the location of the tools.
PavanYadav
Esri Contributor
ArcGIS 10.0 SP3 XP  Extract by mask worked for, if the polygon and raster were in the same projection.  It produced a corrupt raster when they were in different projections. (then again, my computer promptly froze up, so maybe something was going on with the network)  Clip in Data management worked if they were in the same projection, but the output included the entire extent of the polygon, not just the area of the polygon.  It froze up when they were in different projections.  So, it seems like things haven't really changed except for the location of the tools.


Hi Diane,
If �??use input features for clipping geometry�?� option in the Clip (data management) tool is not checked, then the output clips out the minimum bounding rectangle for that feature. To get exact area of the polygon clip feature check the �??use input features for clipping geometry�?� option.
[ATTACH=CONFIG]12735[/ATTACH]

For the Extract by Mask and the Clip (data management) tool, your input raster and clip feature can have different projections. If you encounter any unexpected behavior, please contact Support Services.

Thanks
Pavan
0 Kudos
MarkMcPherson1
New Contributor II
I have a similar issue.

As per the first image [ATTACH=CONFIG]14112[/ATTACH], I have a raster in which I created an irregular polygon which I want to cut out, but KEEP the rest of the raster.
Using Extract by Mask, it removed everything except for the polygon [ATTACH=CONFIG]14113[/ATTACH]; however, what I want is the opposite:
I want to KEEP the raster portion, but remove the polygon-shaped portion .

I'm not sure if I used the wrong tool, or what to do from here (note, everything was projected NAD83 UTM 10, so projections should not be an issue).
0 Kudos
JeffreySwain
Esri Regular Contributor
If you are trying to create a 'doughnut' effect then you can achieve the results with the Export Data function and select 'Inside.'   This should perform the inverse clip that you are trying to create. 

Per the Help,
alternatively, you can check the Clip Inside option to remove the data within the graphic and keep the rest of the data.
0 Kudos