TransWikia.com

Splitting raster by polygons and defining output names using ArcMap

Geographic Information Systems Asked by novice here on March 1, 2021

I need to split a raster file (DEM) by 2310 polygons (these are boundaries) using ArcGIS for Desktop. I used the Split Raster tool but I have no control over the naming of the output rasters. They automatically get numbers assigned and I don’t know which one is which. The shapefile table contains unique names and codes for each individual boundary (see below) and this is how I need to name my resulting rasters.

How can I split the raster and use a name/code from the polygon layer to name the outputs?

Either of them would work as long as I can later identify them. My ArcPy knowledge is very limited but if there’s a solution that is not too complicated it could work too.

DEM and polygon areas

Attribute table with boundary names and codes

2 Answers

The Split Raster tool allows you to only specify a prefix that will be applied to each of the raster datasets you will create. A number then will be appended to each prefix, starting with 0.

If you want to have control over the names of the rasters, instead of using Split Raster you can make a loop that uses the Extract by Mask tool to clip the raster by one polygon at a time by selecting that polygon before executing the tool.

Here is the documentation of the tool: https://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/extract-by-mask.htm

Answered by Mohannad Adham on March 1, 2021

A fairly simple model will achieve this. Iterate over your featureclass using the extract by mask to "cookie cut" out your raster.

You need to be using inline variable substitution to pass the ID to the output raster name, don't know what that is then read the help file!

Also you'll need to set the snap raster environment setting to ensure consistent alignment and match the cell size of your DEM. The temporary copy of your catchment polygon is used to set the extent environment setting of the extract by mask.

Below is the model that will achieve what you want.

Model

Answered by Hornbydd on March 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP