0

I am trying to merge NDVI data from 2005 to 2018 (two .tif per decade) with a region land use.

For this, I have used "iterate rasters" with 36 of .tif I'll be using, as the 'Input value raster' of the "Zonal Statistics as Table". In the 'Input raster or feature zone data', I used a .shp with the regions I want. Currently, it "works" manually and if the output table is fixed, but it overwrites the other generated tables (of course). Using the %Name%_new however, I had errors (000354, 999999 and 010233) and nothing was generated. I followed the steps in this link to solve my variable problem : gis.mtu.edu/wp-content/uploads/2013/04/Using-ModelBuilder-to-batch-process-files.pdf.

Do you have an idea of what to do? (in order not to overwrite again?)

enter image description here

The zonal statistics table content: enter image description here

EDIT : Bellow is my last modification: enter image description here I do not have errors but the out put is still overwritten. I feel like "iterate rasters" do not do his job properly in the model.

closed as unclear what you're asking by PolyGeo May 21 at 22:59

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • "000354: The name contains invalid characters" – Nour May 21 at 8:19
1

As you have not posted your error messages nor your configuration of your Zonal Statistics as Table element in the model, I can only guess as to what is going on here based on your question title. My guess is that your model is trying to repeatedly overwrite the output table and failing, because the output exists already.

If this is the case, then you can use the Name variable of the iterator to generate a different output for each iteration of the Zonal Statistics as Table.

To do this, include %Name% in the filename of the Zonal Statistics as Table's output table. Eg, make the output something like C:\path\to\geodatabase.gdb\stats_%Name%.

The interator maintains the Name variable using the name of the input file each time. So you can use this with '%' delimeters to have the same substituted into your output in the tool.

  • That's exactly what I did for my Table's output, I mentioned the path and ended with the table name between two %, but it didn't work. I had the error 000354 (where the name contains invalid characters) even if the name I put was a simple Char with a _ . I am really confused – Nour May 21 at 8:18
  • Don’t use your table name. Use the literal text “Name” between percent characters. That is the variable that holds the different names during the iterations. – Son of a Beach May 21 at 9:08
  • Thanks, I have now two errors after rectifying that: 999999 (error of executing function) and 010233 (unable to rename dataset) – Nour May 21 at 9:12
  • I've rerun to model, the error message changed: (ERROR 000883: Output table: .tif_pr'extension is invalid for the output table) yes for sure... the error is then due to the extension of the raster. the only means I now to get rid of is python code but it's kind of complicated to implement with the model builder – Nour May 21 at 9:22
  • 1
    This is a bit much for comments. Please post a new question. But it is os.path.basename(), not os.basename(). – Son of a Beach May 21 at 11:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.