Clipping a raster file multiple times, based on area-divided polygon

1511
6
Jump to solution
11-24-2020 01:55 PM
mohasmohas
New Contributor

Hello. I have a polygon that is divided at 5 small areas, and a raster file that contains the whole area of my project. I want to clip my raster file according to every area of my polygon, is there a way to do it not manually and end up with a different layer for every small area? Thanks in advance for your time.

0 Kudos
2 Solutions

Accepted Solutions
by Anonymous User
Not applicable

If you have Spatial Analyst you can use extract by Polygon or by Mask. 

See link below. 

https://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/extract-by-polygon.htm

You can batch the GP tool or use Model Builder or use Python if you have to do this multiple times. Depending on what you want to do. 

Hope this helps. 

View solution in original post

6 Replies
by Anonymous User
Not applicable

If you have Spatial Analyst you can use extract by Polygon or by Mask. 

See link below. 

https://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/extract-by-polygon.htm

You can batch the GP tool or use Model Builder or use Python if you have to do this multiple times. Depending on what you want to do. 

Hope this helps. 

mohasmohas
New Contributor

Thank you for your response. Actually i want to use use the extract by mask tool for each row of my polygon's attribute table. Can i model it with Model Builder?

0 Kudos
anner_paldor
New Contributor

Thank you for this, it really helped me. I have a follow-up, I hope it's okay. If I want to save an output for each model iteration in a different name, is there a way to do this? What I'm trying to do is take a DEM, extract chunks of it based on polygons in a polygon layer (which is where the iterate tool came in handy) but then from each extracted chunk I want to save an ASCII file (with raster to ASCII) of a different name (say, based on the FID of the polygon in each respective iteration).  See the attached model graphic if it helps.

Many thanks in advance,

Anner.

0 Kudos
DavidPike
MVP Frequent Contributor

Of course,  it's called in-line variable substitution.

Inline variable substitution—ArcGIS Pro | Documentation  - 'use with an iterator' paragraph

Examples of in-line variable substitution with ModelBuilder system variables—Help | ArcGIS for Deskt... - 'Using the %n% system variable with in-line variable substitution'

 

Basically use %n% which represents the number of each iteration.

Samp%n%.asc  -> Samp1.asc, Samp2.asc, Samp3.asc...

 

 

anner_paldor
New Contributor

This worked perfectly. Thank you so much.