+ Reply to Thread
Results 1 to 39 of 39

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

  1. #1
    Jenn Smithyman
    Join Date
    Apr 2010
    Posts
    4
    Points
    0
    Answers Provided
    0


    0

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

    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.

  2. #2
    Donovan Cameron

    Join Date
    Aug 2010
    Posts
    477
    Points
    40
    Answers Provided
    3


    3

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

    You can use a toolbox.

    Its in Data Management Tools -> Raster -> Raster Processing -> Clip

    In here, you can tell it to clip to an irregularly shaped polygon.

    After you specify the shapefile to clip to as your Output Extent, then you also need to ensure that you put a checkmark beside the 'Use Input Features for Clipping Geometry' option.

    Is that what you needed?

  3. #3
    Jenn Smithyman
    Join Date
    Apr 2010
    Posts
    4
    Points
    0
    Answers Provided
    0


    0

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

    Perfect. Thank you.

    For some reason, I thought that would give me extents and not the polygon boundary.

  4. #4
    Tomas Novacek
    Join Date
    May 2010
    Posts
    4
    Points
    0
    Answers Provided
    0


    0

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

    Hi, you can use Spatial Analyst Tool Extract by Mask or Extract by Polygon.
    Tomas

  5. #5
    Matej Tacer
    Join Date
    Sep 2010
    Posts
    27
    Points
    0
    Answers Provided
    0


    0

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

    Hi everybody,

    The tool Extract By Mask seems to work, however, is there a way to get jpg as the output?
    Thank you for your thoughts,

  6. #6
    Donovan Cameron

    Join Date
    Aug 2010
    Posts
    477
    Points
    40
    Answers Provided
    3


    0

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

    Quote Originally Posted by matejt View Post
    Hi everybody,

    The tool Extract By Mask seems to work, however, is there a way to get jpg as the output?
    Thank you for your thoughts,
    You can specify the output type by changing the extension in the output dataset box to Raster.jpg instead of Raster.tif, Raster.img or whatever it currently is.


  7. #7
    Phuksouliya pommated
    Join Date
    Jun 2011
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

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

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

  8. #8
    Jeff Swain

    Join Date
    Nov 2009
    Posts
    749
    Points
    184
    Answers Provided
    21


    0

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

    Quote Originally Posted by SaultDon View Post
    You can use a toolbox.

    Its in Data Management Tools -> Raster -> Raster Processing -> Clip

    In here, you can tell it to clip to an irregularly shaped polygon.

    After you specify the shapefile to clip to as your Output Extent, then you also need to ensure that you put a checkmark beside the 'Use Input Features for Clipping Geometry' option.

    Is that what you needed?
    Don has the correct workflow. Use the clip under Data Management > Raster > Raster Processing. If you do not specify the input geometry, you will receive the bounding extents of the polygon. The output format of the raster is controlled by adding extensions. So .jpg for jpeg, .tif for tiff and so forth. The only limit is the raster to be output must have the band combination/bit depth for the desired format.

    Extract by Mask will also perform the clip, but Spatial Analyst is required.
    Last edited by jbswain; 06-14-2011 at 04:03 AM.
    Esri Education Specialist
    Esri Certified ArcGIS Desktop Professional
    Training Services
    Esri Training | ArcGIS Ideas

  9. #9
    andrea frustaci
    Join Date
    Aug 2010
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

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

    Is there a way to clip a raster with a polygon but keep the outer portion? (ie, to create a donut?)

    Thanks

  10. #10
    Donovan Cameron

    Join Date
    Aug 2010
    Posts
    477
    Points
    40
    Answers Provided
    3


    0

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

    Quote Originally Posted by afrustaci View Post
    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.


  11. #11
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    0

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

    Quote Originally Posted by afrustaci View Post
    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
    Eric Rice
    Product Engineer
    Esri Software Products

  12. #12
    Joe Partlow
    Join Date
    Nov 2010
    Posts
    7
    Points
    0
    Answers Provided
    0


    0

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

    FYI. I am experiencing some strange results as the moment using the Clip tool. See attached ...
    Attached Thumbnails Attached Thumbnails Click image for larger version

Name:	Clip Problem.jpg‎
Views:	1152
Size:	76.7 KB
ID:	9103  

  13. #13
    Donovan Cameron

    Join Date
    Aug 2010
    Posts
    477
    Points
    40
    Answers Provided
    3


    0

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

    Quote Originally Posted by jpartlow View Post
    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.


  14. #14
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    0

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

    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
    Eric Rice
    Product Engineer
    Esri Software Products

  15. #15
    Ray Montgomery
    Join Date
    Sep 2011
    Posts
    4
    Points
    0
    Answers Provided
    0


    0

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

    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?

  16. #16
    Diane McConnaughey
    Join Date
    Apr 2010
    Posts
    46
    Points
    0
    Answers Provided
    0


    0

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

    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.

  17. #17
    Pavan Yadav
    Join Date
    Dec 2009
    Posts
    56
    Points
    7
    Answers Provided
    0


    0

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

    Quote Originally Posted by dmcconna View Post
    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.
    Click image for larger version

Name:	clip.JPG
Views:	714
Size:	50.7 KB
ID:	12735

    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

  18. #18
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    I have a similar issue.

    As per the first image Click image for larger version

Name:	First.jpg
Views:	385
Size:	263.9 KB
ID:	14112, 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 Click image for larger version

Name:	Second.jpg
Views:	373
Size:	48.8 KB
ID:	14113; 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).

  19. #19
    Jeff Swain

    Join Date
    Nov 2009
    Posts
    749
    Points
    184
    Answers Provided
    21


    0

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

    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.
    Esri Education Specialist
    Esri Certified ArcGIS Desktop Professional
    Training Services
    Esri Training | ArcGIS Ideas

  20. #20
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    I want to do this, but the "selected graphics" button is greyed out Click image for larger version

Name:	greyed out.JPG
Views:	332
Size:	188.0 KB
ID:	14287. But I think this won't work because I am using a shapefile, not graphics I just drew in.

    Quote Originally Posted by jbswain View Post
    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,
    Last edited by mark91345; 05-12-2012 at 07:04 PM.

  21. #21
    Jeff Swain

    Join Date
    Nov 2009
    Posts
    749
    Points
    184
    Answers Provided
    21


    1

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

    Right click the layer in the table of contents and then convert it to graphics. Then be sure the graphic is selected and then you can use the Export Data workflow.
    Esri Education Specialist
    Esri Certified ArcGIS Desktop Professional
    Training Services
    Esri Training | ArcGIS Ideas

  22. #22
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    Yes, that did it! Thank you so much.

    Quote Originally Posted by jbswain View Post
    Right click the layer in the table of contents and then convert it to graphics. Then be sure the graphic is selected and then you can use the Export Data workflow.

  23. #23
    Julia Smith
    Join Date
    Feb 2012
    Posts
    19
    Points
    2
    Answers Provided
    0


    0

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

    The "convert to graphics" option doesn't seem to be working for me. The "selected graphics" button is still grayed out, and the polygon layer is selected. Any ideas?

  24. #24
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    1

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

    Julia,

    Did you select the graphic? It doesn't matter if the polygon layer is selected. You can use the Select Elements button to make selections on graphics.

    Eric
    Eric Rice
    Product Engineer
    Esri Software Products

  25. #25
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    Hi Julia,
    Let me work step-by-step with you, as I think I know the problem, but it's best to just do the whole thing:

    1. Right-click on your polygon layer and use the "Convert Features to Graphics"Click image for larger version

Name:	step1.jpg
Views:	291
Size:	131.8 KB
ID:	14997



    2. After turning off the polygon layer, your graphics should be still showing. Now, select the graphics (when I say select, use the black arrow which will create a rectangular border around graphic) Click image for larger version

Name:	step2.JPG
Views:	482
Size:	248.8 KB
ID:	14998

    3. Now, right-click on the Raster | Data | Export Data. Now you should be able to choose "Selected Graphics" AND "Clip Inside". Note that you also want to re-select the Location where you want it saved, as I think there's a bug here (otherwise, for me, it just does nothing at all.) Click image for larger version

Name:	step3.jpg
Views:	306
Size:	100.0 KB
ID:	15000


    4. Since I cannot figure out how to get rid of the graphics I made earlier, I just choose File | New, then add my newly created layer. Let me know if it works for you.

    Quote Originally Posted by smith984 View Post
    The "convert to graphics" option doesn't seem to be working for me. The "selected graphics" button is still grayed out, and the polygon layer is selected. Any ideas?

  26. #26
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    1

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

    Mark,

    To get rid of the graphics you created, just select them and hit the Delete key.

    Eric
    Eric Rice
    Product Engineer
    Esri Software Products

  27. #27
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    Thanks, Eric. It always gets me when the simplest thing (then I forget to do it). Okay, it's making me giggle.

    Quote Originally Posted by erictrice View Post
    Mark,

    To get rid of the graphics you created, just select them and hit the Delete key.

    Eric

  28. #28
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    1

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

    No problem Mark. I just didn't want you to keep having to start blank maps. Is there a reason why you're going through this 'convert to graphics' workflow rather than just hitting the Mask button on the Image Analysis Window? I mentioned this method well before Jeff S. replied to you -technically it was even before you posted the question. Maybe you didn't read the whole thread. You can also Clip with the Image Analysis window - all you need to do for both is select a polygon from your feature class. No conversion to graphics required.
    Eric Rice
    Product Engineer
    Esri Software Products

  29. #29
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    Hi Eric,
    Yes, the problem is I simply don't understand how to use that feature. I tried it, but I was not able to do it. When I was shown the 'convert to graphics' thing, it was just so easy, that I didn't even bother with the other one.

    Quote Originally Posted by erictrice View Post
    No problem Mark. I just didn't want you to keep having to start blank maps. Is there a reason why you're going through this 'convert to graphics' workflow rather than just hitting the Mask button on the Image Analysis Window? I mentioned this method well before Jeff S. replied to you -technically it was even before you posted the question. Maybe you didn't read the whole thread. You can also Clip with the Image Analysis window - all you need to do for both is select a polygon from your feature class. No conversion to graphics required.

  30. #30
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    0

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

    You select the raster you want to Clip/Mask in the Image Analysis window (IAW), from the list of rasters. You also select a polygon (feature class polygon), and then just hit the Clip or Mask button in the IAW. The layer is temporary by default.
    Eric Rice
    Product Engineer
    Esri Software Products

  31. #31
    Julia Smith
    Join Date
    Feb 2012
    Posts
    19
    Points
    2
    Answers Provided
    0


    1

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

    Thank you Mark and Eric, those steps worked for me! I appreciate your assistance.

  32. #32
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    I remember why I had the problem: although I can see the Raster, I cannot figure out how to add the polygon part.Click image for larger version

Name:	img1.jpg
Views:	346
Size:	128.3 KB
ID:	15010


    Quote Originally Posted by erictrice View Post
    You select the raster you want to Clip/Mask in the Image Analysis window (IAW), from the list of rasters. You also select a polygon (feature class polygon), and then just hit the Clip or Mask button in the IAW. The layer is temporary by default.

  33. #33
    Jeff Swain

    Join Date
    Nov 2009
    Posts
    749
    Points
    184
    Answers Provided
    21


    0

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

    You have to 'select' it with the Select button, unless you have changed it, the selection should be cyan blue. Here is the documentation on how to select the polygon feature.
    Esri Education Specialist
    Esri Certified ArcGIS Desktop Professional
    Training Services
    Esri Training | ArcGIS Ideas

  34. #34
    Mark McPherson
    Join Date
    Apr 2012
    Posts
    73
    Points
    1
    Answers Provided
    0


    0

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

    Okay, I followed and it worked.... sorta. As per img1, I was successfully able to create a temporary masked layer Click image for larger version

Name:	img1.jpg
Views:	251
Size:	147.0 KB
ID:	15028


    As per img2, I exported it to a permanent layer (note: both my raster & polygon layers use NAD83 UTM 11) Click image for larger version

Name:	img2.jpg
Views:	220
Size:	154.8 KB
ID:	15029

    But on img3, notice that the bottom portion of my image is "cut off" somehow Click image for larger version

Name:	img3.jpg
Views:	232
Size:	130.5 KB
ID:	15030.
    I'm not worried about the "fringed" effect on the right-hand side of the image, as that's another problem (I originally used Extract by Mask to reduce the size of the original raster... and for some reason, while it did produce a smaller-size raster, it added those fringes on the right... I dunno!)


    Quote Originally Posted by erictrice View Post
    Andrea,

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

    Image Analysis window: Processing section

    Regards,
    Eric

  35. #35
    Eric Rice

    Join Date
    Oct 2009
    Posts
    954
    Points
    474
    Answers Provided
    76


    0

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

    Mark,

    You could try Copy Raster instead of Data > Export to see if that is a viable workaround. I can't reproduce the issue you are experiencing, but it certainly looks like a bug.

    Eric
    Eric Rice
    Product Engineer
    Esri Software Products

  36. #36
    Anne Marcotte
    Join Date
    Jul 2013
    Posts
    1
    Points
    0
    Answers Provided
    0


    0

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

    Quote Originally Posted by jbswain View Post
    Don has the correct workflow. Use the clip under Data Management > Raster > Raster Processing. If you do not specify the input geometry, you will receive the bounding extents of the polygon. The output format of the raster is controlled by adding extensions. So .jpg for jpeg, .tif for tiff and so forth. The only limit is the raster to be output must have the band combination/bit depth for the desired format.

    Extract by Mask will also perform the clip, but Spatial Analyst is required.
    Hi There,
    I followed this process exactly, using a shapefile of a country as the clip for an raster hillshade layer. According to the Results dialog box, the clip performed successfully...However, the .png file that I tried to save did not appear in the directory I specified, nor anywhere else on my computer. Do you have any insights?

  37. #37
    Jeff Swain

    Join Date
    Nov 2009
    Posts
    749
    Points
    184
    Answers Provided
    21


    0

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

    What is the input format prior to the clip? If it is trying to create a 32 bit raster then that is the problem. I would stick to a .tif, Esri GRID or .img format. PNG is usually not an output format for hillshades. Check the Supported Raster Formats for ideas on format and look at .png and notice that you can only have certain output formats.
    Esri Education Specialist
    Esri Certified ArcGIS Desktop Professional
    Training Services
    Esri Training | ArcGIS Ideas

  38. #38
    William Frament
    Join Date
    Sep 2012
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

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

    I would like to clip a raster image with a shapefile of 1:100,000 usgs quads and have the images named with an attribute within the shapefile? Any way to set this up to run and clip serveral at once and have them named?

  39. #39
    Jeff Swain

    Join Date
    Nov 2009
    Posts
    749
    Points
    184
    Answers Provided
    21


    0

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

    You could iterate through the feature classes and clip each one and apply the name that way. I would recommend looking at the information on iterators and in line variables in model builder or consider scripting it in python. The name of the feature being used could be used in the naming that way.
    Esri Education Specialist
    Esri Certified ArcGIS Desktop Professional
    Training Services
    Esri Training | ArcGIS Ideas

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts