Select to view content in your preferred language

Polygon to Raster - how to prevent model from breaking if raster output is empty?

834
4
12-22-2017 02:12 PM
RossDiamond
New Contributor

Hi, I’m building a model in 10.5 that I hope to replicate for various project extents. The model takes various inputs of pervious and impervious land cover types. For each input, the model clips it to the project extent, converts it to a raster, reclassifies the raster, then combines the rasters with cell statistics.

The only problem I’m having is that if a project extent contains 0 features after being clipped, then the model fails when it tries to convert the empty shapefile to a raster. What can I add into the model to prevent empty rasters from breaking the model? Is there a way to tell the model that after it clips, if it has 0 features then stop that process?

I’ve used GIS for a while, but am fairly new to using modelbuilder, and do not have experience scripting anything in python but would pursue that if it’s the answer to my issue. I've searched around this community but was unable to find a solution. Thanks!

0 Kudos
4 Replies
deleted-user-X3HtcMwsXJDa
Deactivated User

Not sure if this will work but you could use the Get Count tool and set up as a precondition in your model that will prevent the model from executing further if the value is zero.

Geographically yours,

Rusty Wynn

City of Pleasanton

Geographic Information Systems

P.O. Box 520

Pleasanton, Ca, 94566-0802<tel:94566-0802>

(925) 931-5075<tel:(925)%20931-5075>

RossDiamond
New Contributor

Thanks Rusty. I added in Get Count after the polygon clip, and checked off Row Count as a pre-condition to the polygon to raster step, but am not sure how you dictate to the model that the value of row count needs to be >0. 

0 Kudos