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 = ...
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 -> ...
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 ...
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 ...
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....
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"....
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"...
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 ...
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 = ...
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 ...
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 ...
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.
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 ...
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]...
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);...
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 ...
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 ...
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).
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 ...
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 ...
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 ...
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 = ...
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
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 ...
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 ...
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....
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 ...
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....
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 > ...
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)...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
statistics × 422arcgis-desktop × 118
qgis × 95
raster × 87
arcmap × 42
spatial-statistics × 38
arcpy × 34
r × 32
zonal-statistics × 28
python × 21
google-earth-engine × 17
arcgis-10.1 × 17
arcgis-pro × 16
field-calculator × 15
arcgis-10.2 × 14
spatial-analyst × 14
gdal × 13
arcgis-10.0 × 13
attribute-table × 12
arcgis-10.3 × 12
polygon × 10
point × 10
shapefile × 9
vector × 9
census × 9