Model builder Extract By Mask spatial reference error

1098
6
12-08-2021 03:18 AM
Labels (1)
Sara_
by
New Contributor III

Hi 

I'm having an issue with model builder. I've a workflow which iterates through to create an IDW for each catchment in a rainfall point file. I then need to use Extract by Mask to clip the IDW raster to the catchment before I reclassify.


When I do this manually using the Extract by Mask tool this works but when I try it as part of my model it hits the error "No spatial reference exists. Failed to execute".

I've checked and the points layer and IDW have spatial references. I've even set a default in the model builder tool. When I try Extract by Mask on it's own in model builder it still won't work but works as a normal geoprocessing tool.

Any thoughts?  

0 Kudos
6 Replies
DanPatterson
MVP Esteemed Contributor

the sampling fc/raster and the IDW should have the same coordinate system and there should be no need to specify one for the output of extract by mask, since it will the same as the inputs.  Have you tried removing that parameter from the model?  If you want something in a different coordinate system, project the result after


... sort of retired...
0 Kudos
Sara_
by
New Contributor III

Hi Dan, thanks for your response. Still getting the same error when I don't specify the coordinate systems. I've also tried the Clip tool but it isn't giving the output honoring the mask  (which is why I usually stick to Extract by Mask). Thanks. 

0 Kudos
curtvprice
MVP Esteemed Contributor

the Clip tool but it isn't giving the output honoring the mask

The Clip tool requires you to check a box to clip to features. Did you do that?

0 Kudos
DanPatterson
MVP Esteemed Contributor

Did you just removed the extract by mask coordinate system? 

And are the extracting raster and the IDW raster in the same coordinate system?


... sort of retired...
0 Kudos
curtvprice
MVP Esteemed Contributor

@Sara_ I have seen this particular error thrown by raster tools when the raster can't be written for some some reason (example: problematic raster pathname). Perhaps you could share more of the geoprocessing message string to this thread (you can copy and paste it as text to get the whole thing), as it may be illuminating to what is wrong.

0 Kudos
RyanDeBruyn
Esri Contributor

Hi @Sara_   

Trying to understand your issue better, 

What version of desktop are you working with? 

Is your mask a raster or feature area?

Perhaps you are able to share you model and data with me and I can try to reproduce on my end? (attach to this thread?)

Suggested to try and troubleshoot.  

1)  Run extractbymask stand alone (the case that works for you).  Create a new model and drag the result from GP Result window into the model. Does this work? If so something in your model is different.

2) Note, as an aside, the IDW does support the environment Mask setting which might eliminate the need to use ExtractByMask if you are only trying to clip all IDW outputs to the same mask area?