-2

enter image description hereenter image description here

I am trying to extract minimum values from about 300 raster files (GeoTIFF) - for example an output table containing raster names against their minimum values. I would like to automate the process. I have searched this and found most results use ArcGIS Pro. Is it is possible to replicate the processes in ArcGIS Desktop (and Model Builder)?

I have tried following python code but got error message.

import arcpy

#Get the geoprocessing result object

Result = arcpy.GetRasterProperties_management("D:\New folder\LOSasc.tif", "MINIMUM")

minresult= Result.getOutput(0)`

error message:

Runtime error Traceback (most recent call last): File "", line 3, in File "c:\program files (x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 14996, in GetRasterProperties raise e ExecuteError: ERROR 001100: Failed because no statistics are available. Failed to execute (GetRasterProperties)

Is this command correct for what I want? Can it be used for extracting min values from all 300 Geotif? Why am I getting such error?

9
  • 2
    Questions need to be able to answer the questions "What have you tried?" and "Where are you stuck?" Right now you only have the task, not a problem. Please Edit the Question to report the software you have chosen, what you tried, and the error or other problem encountered.
    – Vince
    Commented Sep 7, 2022 at 12:06
  • 1
    Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Commented Sep 7, 2022 at 12:11
  • 1
    gdalinfo gives you this information by default, but there's probably a cleaner way Commented Sep 7, 2022 at 12:22
  • 1
    The error message you posted in the duplicate is needed to reopen this. 99% of the time, Pro documentation will be the same as ArcMap, and it certainly is in this case, so dismissing the search results because it's linked to Pro is unwise.
    – Vince
    Commented Sep 8, 2022 at 11:52
  • @coral I have recently done similar process, calculated mean, using modelbuilder. I am not sure, if I can write answer as comment or not, so, it would be better to edit your question and reopen it. Then, I could share the steps needed.
    – Salit
    Commented Sep 8, 2022 at 12:21

2 Answers 2

1

You can iterate the process in ModelBuilder using raster iterator. You may need two models: one for iteration and another for final output.

First, using raster iterator you can access all rasters stored in a GDB/folder one by one. Run zonal statistics to calculate min value for each iteration and save it to a table by joining. This is a sub-model. You model would look something similar.

enter image description here

In step-2, you call the created sub-model. Direct this main-model to raster data source(GDB/folder), vector file containing boundary, and the field based on the joining would take place. Finally, you can export the result as table or excel file. As you can see, I called sub-model "loop" to iterate all raster images.

enter image description here

A model can be added, as sub-model, to another model by simply clicking on "Add data or tool" button and direct it insite toolbox where the model is saved (or created). I mention this, as I had to spent few good minutes to figure it out when I started using modelBuilder - not many resources dictating step-by-step process to add sub-model.

10
  • thank you so much.I appreciate your help. now I am starting to do as you planed and i will ask you if i face problem .
    – coral
    Commented Sep 10, 2022 at 8:40
  • Hi is this solution for a specific location because my GEOTIFS are distributed and not just for one place , they are not in the same size as well .
    – coral
    Commented Sep 11, 2022 at 10:43
  • Hi Mr Salit as you said the first step is like this. I do not know how to solve this error. I choose zone and raster the same ,for example :(aizad.tiff ) is the error about it? I attached image of steps and error above
    – coral
    Commented Sep 11, 2022 at 16:48
  • Hi Mr Salit as you said the first step is like this. I do not know how to solve this error. I choose zone and raster the same ,for example :(aizad.tiff ) is the error about it? I attached image above
    – coral
    Commented Sep 11, 2022 at 16:50
  • I do not see the image you've shared. But, have a look at official documentation of zonal statistics if you are stuck at it. zonalStatistics
    – Salit
    Commented Sep 12, 2022 at 4:36
0

enter image description here hi finally I solved it .thank you so much can I answer my question ?

4
  • Can you put more explanation in your answer? If the other person helped you with this be sure to upvote it. Commented Sep 14, 2022 at 22:02
  • Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Sep 14, 2022 at 22:03
  • hi of course I will try to explain more you know for using zonal statistic as table (that is mentioned by Mr Salit) I have to provide two items ,as you can see in image above one of them is " input raster or feature zone data "and the other one is " input value raster " .so I have to have Boundary or vector file of my Geo tiffs (as shape file format=input raster or feature zone data) for each of them and relate one by one to each other in zonal statistics so I used parse path to get name of tiffs in this procedure and it worked then using raster domain.
    – coral
    Commented Sep 16, 2022 at 5:59
  • at the end I used append item to add or append one by one of minimum value extraction for each GEO TIFF in " output table "of zonal statistic table. model builder diagram shows these steps. please feedback me if is it sufficient or help full or not ?
    – coral
    Commented Sep 16, 2022 at 5:59

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