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.
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
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.
The end goal is to have a tif file for whichever state the user wants landcover data for.
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.
Here's an example: USGS provides NLCD tiled by state:
NLCD 2011 Land Cover (2011 Edition, amended 2014), by State: NLCD2011_LC_New_York - Data.gov