Automate raster/vector clipping using arcpy

618
5
11-24-2017 01:44 PM
PatrickLandisch
New Contributor

How could I go about creating a script that extracts landcover data for a specific state? I have a global landcover raster and a shp of US states. My end goal is to have the user type in a state and have it return a raster of landcover data for that state. 

0 Kudos
5 Replies
DanPatterson_Retired
MVP Emeritus

It might just be easier to preclip everything to begin with then automate the delivery of the raster based on the name.  There would be little gained to have the same states clipped multiple times unless your underlying data changes frequently

0 Kudos
XanderBakker
Esri Esteemed Contributor

Just wondering where the end user will work with this solution. Is it something you want to provide in a desktop environment where the user may have access to ArcMap or ArcGIS Pro, or is this something you want to provide in a web application? The landcover raster that is returned, what will the end user do with the landcover? Is it just visualization or should the end user be able to perform analysis over the result? You mention clipping, should the landcover be clipped or is zooming in to the state enough?

If it is just visualization and no clipping, you could publish the landcover (depending on the format, this might require an Image Server role) and add a feature layer of states and enable the search by layer option on the web map and the solution is ready to go. 

PatrickLandisch
New Contributor

The end goal is to have a tif file for whichever state the user wants landcover data for. 

0 Kudos
DanPatterson_Retired
MVP Emeritus

so having a pre-made product ready for shipping might be the route to go. If you have the capability to deliver it and in the desired format of course.

curtvprice
MVP Esteemed Contributor