I set up a model to iterate rasters and do a spatial analyst math int geoprocess. i did a subset of my entire raster collection just to make sure it would work. I have three rasters in a FGDB. My output only had two rasters? so I reran and had a different output. same results. I renamed the input rasters, same result? Essentially the iterate is grabbing the last raster and naming the output the same as the first rasters output????? Why is this happening? See circled red boxes for exactly what is happening
Are you using an inline variable to name the outputs?
Darren is correct, you need to use inline variable substitution in the output name of your final raster. The output name of your raster should look like the following:
C:\globeland30\rasters4_work2.gdb\%Name%
The %Name% part will use the name of each input raster to your iterator as the output file name.
Hope that make sense.
Kyle
yes, i have the model setup with that. that is why I am confused why it is overwriting with a name that 1)it isnt and 2)that already ran
I am not sure if this is a bug?
yes i am. that is why i am lost/ confused why it is trying to name/ write something that already ran/ exists
It may help if we can see your model setup.
its the model named:
iterate_rasters_math_int_001
https://drive.google.com/file/d/0B9XYlRVEiA-nQk5GV2pfOW52U0k/view?usp=sharing
FWIW, I think you should have the 'What FGDB do you want' as a precondition before the iteration proceeds.
Zachary,
any idea why this is happening?
updated both preconditions you have suggested - renamed to Output_FGDB - still the same results. not sure how we can be running the same model and have mine give me bad results??? - restarted my machine (sometimes esri software needs that) - nothing. one of those things that is very straight forward and the software gives you bogus results (bang your head against the wall to figure out but can't). nothing like this to finish the work week... GDF software.... thanks for your ideas.
create a new model as I have as mine is created, including the name change. Validate, and save. Run from catalog window. Just try recreating this (humor me, its a short model and shouldn't take long to rebuild).
Justin...time to go home and have a beer. It will work on Monday
It appears that this is a bug in 10.2.1 and 10.2.2. See here (if Curtis Price can't figure it out, neither will I).
Your model works exactly as you report for me, at 10.2.2. None of the above solutions worked for me. What version are you using?
Luckily, the Python alternative is quite straightforward, something like:
>>> arcpy.CheckOutExtension("Spatial") ... arcpy.env.workspace = arcpy.GetParameterAsText(0) # input workspace parameter ... outFolder = arcpy.GetParameterAsText(1) # output workspace parameter ... rasters = arcpy.ListRasters() ... for raster in rasters: ... outRas = arcpy.sa.Int(raster) ... outRas.save(outFolder + '/' + raster)
Los miembros registrados pueden publicar, seguir actualizaciones y más. ¿Nuevo aquí? Regístrate gratis.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.