13 votes

how to get max and min from a raster using arcpy?

Create a raster object using the full path to your raster. Raster objects have the properties minimum and maximum. >>> rastFullPath = r"C:\Rasters\rasters.gdb\Slope" >>> rast = ...
Emil Brundage's user avatar
13 votes

Looking for QGIS equivalent of ArcGIS "Summarize"

QGIS has a Statistics Panel that allows you to view a long list of descriptive statistics for whichever vector layer you choose. To open the statistical summary tool, either click View -> ...
ahmadhanb's user avatar
  • 40.5k
10 votes
Accepted

ArcGIS: table statistics range, method?

Here is a python solution, using arcpy to access the data and numpy to calculate the statistical values. Using arcpy.da.SearchCursor() write the values to a list. Use python.numpy.percentile() to ...
bebego's user avatar
  • 1,163
10 votes
Accepted

Performing Kriging in QGIS

The great thing about QGIS is its modular design, based on which you can use the geoprocessing engines of various other systems directly as tools in QGIS (GRASS, SAGA, GDAL, OGR, ...). In order to do ...
Jochen Schwarze's user avatar
10 votes
Accepted

Exporting features when column value between specific percentiles

You can create a new function which returns a percentile value, then, compare the field value. Open Select Feature by Expression tool Create new function in the Function Editor using the script below....
Noura's user avatar
  • 3,409
9 votes
Accepted

Identifying top 10% of raster cells using ArcGIS Desktop

From your comment I understand that you are not looking for percentile but a given percentage of your range. You can use the raster calculator Con("raster" >= (0.9 * ("raster".maximum - "raster"....
radouxju's user avatar
  • 49.4k
9 votes

Exporting features when column value between specific percentiles

You can use Select by expression and paste this expressions (see also screenshots below): For the lowest 10%: "value" <= array_get( array_sort ( array_agg ("value"...
Babel's user avatar
  • 67.2k
8 votes
Accepted

How to create Raster statistics with GDAL externally?

As a workaround you can use command gdalinfo -stats -hist input.tif Selecting the histogram option triggers the creation of input.tif.aux.xml file. EDIT I have learned that actually there is no need ...
user30184's user avatar
  • 63k
7 votes
Accepted

how to get max and min from a raster using arcpy?

That is simply indicating that the value is a Unicode string. You can use this unicode string in most situations. However, if you need to fully control the type, convert it to float format. test = ...
Aaron's user avatar
  • 51.5k
7 votes
Accepted

What is (if there's any) difference between MAUP and Edge Effect

The Modifiable Aerial Unit Problem (MAUP) is a change of support issue associated with arbitrary aggregate units. Two classic examples are census tracks and wildlife game units. These have been found ...
Jeffrey Evans's user avatar
7 votes
Accepted

Calculating percentage of number of features in layer in QGIS

You can use a one-step expression using count() function: count("ID","CLASS") / count("ID") * 100 This will return the percentage of the current class of the total ...
MrXsquared's user avatar
6 votes
Accepted

Finding Median, Max and Min values from Raster Layers in QGIS

You should probably use per-cell calculators like r.series in the QGIS processing toolbox (GRASS commands), which can give you mean, max, min, as well as other statistics on your datasets.
HDunn's user avatar
  • 8,556
6 votes
Accepted

How to automatically sum up values within buffers?

Use the Spatial Join tool in the Analysis toolbox->Overlay toolset with these settings to generate statistics for all of your concentric buffers at once. Target Features: Concentric Ring buffer ...
Richard Fairhurst's user avatar
6 votes
Accepted

Replace Statistics_analysis with SearchCursor?

You can use list comprehensions and cursors to do something like this: def pop_avg(pop_info): zipcode_info = {} for zp in pop_info: try: zipcode_info[zp[0]].append(zp[1]...
Nxaunxau's user avatar
  • 3,923
6 votes

Calculating Statistics Based on Expression in QGIS?

You may use the Statistics by categories algorithm from the Processing Toolbox and set these parameters: Field to calculates statistics on: "Column 2" (or whatever fields that stores the area values);...
mgri's user avatar
  • 16.1k
6 votes

Getting multiband raster's min and max values with Python in QGIS?

Next code works with multi band raster. It uses QgsRasterDataProvider objects to calculate statistic through QgsRasterBandStats objects. layer = iface.activeLayer() extent = layer.extent() provider ...
xunilk's user avatar
  • 29.7k
6 votes

Statistical comparison between different rasters using R?

I thought about subtracting each method raster to the RUSLE raster and then compare the means of the resulting rasters. That is not a great approach as the mean can be zero, but the errors very ...
Robert Hijmans's user avatar
6 votes

Looking for QGIS equivalent of ArcGIS "Summarize"

QGIS 3.14 does this with the "Statistics by Categories" tool under Vector Analysis in the QGIS's Processing Toolbox (Ctrl+Alt+T).
Sideshow Bob's user avatar
  • 2,313
6 votes

Calculating percentage of number of features in layer in QGIS

The solution is to use the function aggregate(). I did it in a two-step process: Tool Aggregate with count as aggregation, and subsequently tool Field Calculator with the following expression (where ...
Honeybear's user avatar
  • 2,334
5 votes

How to get GDAL to create statistics for GTiff in Python

If the statistics are already calculated and included in the file internally, gdalinfo -stats wont create a additional PAM statistics file(.aux.xml) for using GDAL 2.1.0. But its very easy to ...
Manuel's user avatar
  • 297
5 votes
Accepted

How to work with Spatial Autocorrelation (Morans I) on equal weighted point

You cannot use the Moran's I on an unmarked process. The values, at each location, are what the statistic is based on and therefore cannot be absent or uniform. Your only real option, in ArcGIS, for ...
Jeffrey Evans's user avatar
5 votes

Quartiles from Raster Layer band

You can use an adaptation of the next code (by using the path of your particular raster): from osgeo import gdal import numpy as np raster = "/home/zeito/pyqgis_data/utah_demUTM2.tif" dataset = ...
xunilk's user avatar
  • 29.7k
5 votes

Export summary statistics to other format than Excel

Use Table To Table which says that it: Converts an input table to a dBASE or geodatabase table. Name your output table *.csv, for example outtable.csv
BERA's user avatar
  • 68.8k
5 votes

Getting the maximum value of a vector field per each unique value of another vector field using PyQGIS?

If I understand your question, this code should work well: layer = iface.activeLayer() # load the layer as you want max_values = {} unique_val_field = "Code" # set the name for the field containing ...
mgri's user avatar
  • 16.1k
5 votes
Accepted

Summarizing Attributes in ArcGIS Online

You could look at the Summary widget. It is simple enough to configure, just choose the field you want to summarise and define the summary method. You can of course alter the name of the widget/set ...
JClarkson's user avatar
  • 885
5 votes

GRASS - Calculate 90th percentile of a timeseries dataset

The module r.univar can take a comma separated list of rasters as input, and calculates stats on the whole list. Does that help? MAPLIST=`g.list rast pattern="rast*" separator=comma` g....
Micha's user avatar
  • 15.5k
5 votes

Calculating the average of one field dependent on another in QGIS

If you prefer a Processing Tool (Ctrl+Alt+T), you can use the "Statistics by categories" tool: It does create a new layer with no geometries and unique categories per row and different ...
MrXsquared's user avatar
4 votes
Accepted

How to separate out bands from hyperspectral data using R

It is not clear at all what you mean with "I want to seperate each bands.". Apparently you want an array of the values. You can do img <- brick("name.tif") # more efficient than stack a <- as....
Robert Hijmans's user avatar
4 votes

Getting tabular statistics from table using QGIS?

Years later, I had the same question with QGIS 2.18.16, and I came across this thread. The QGIS alternative to the Arc Frequency tool is: Toolbox > QGIS Geoalgorithms > Vector table tools > ...
Stu Smith's user avatar
  • 8,094
4 votes

How to sum up pixel values in QGIS?

You can use pyqgis and create a numpy array and sum: import gdal import numpy as np ds = gdal.Open(r'C:\somefolder\someraster.tif') band1 = ds.GetRasterBand(1).ReadAsArray() s = np.sum(band1) print(s)...
BERA's user avatar
  • 68.8k

Only top scored, non community-wiki answers of a minimum length are eligible