Comments (6)
steps to reproduce in NC sample data set
-
g.region -a raster=elev_ned_30m@PERMANENT align=elev_ned_30m@PERMANENT
-
v.in.region output=myregion
-
quick digitize 1 polygon covering a small part of elev_ned_30m, e.g. mymask
-
r.mask vector=mymask@user1
-
r.mapcalc expression="test = elev_ned_30m@PERMANENT"
-
r.mask -r
-
v.rast.stats map=myregion@user1 raster=test@user1 column_prefix=zs
from grass.
easier, just use the example from the v.rast.stat manual, just choose only number and null_cells in method:
v.rast.stats map=myzipcodes_wake@user1 raster=elevation@PERMANENT column_prefix=elev method=number,null_cells
v.db.select map=myzipcodes_wake@user1 columns=cat,OBJECTID,NAME,elev_number,elev_null_cells where=cat = 12 OR cat = 13
cat|OBJECTID|NAME|elev_number|elev_null_cells
12|17|RALEIGH|43980|43980
13|19|RALEIGH|135806|135806
elev_number and elev_null_cells shows the same figures
from grass.
maybe related:
v.rast.stats: addition of null_cells count - 26ae605
from grass.
easy testing by
g.region -p -a raster=elevation@PERMANENT align=elevation@PERMANENT
projection: 99 (Lambert Conformal Conic)
zone: 0
datum: nad83
ellipsoid: a=6378137 es=0.006694380022900787
north: 228500
south: 215000
west: 630000
east: 645000
nsres: 10
ewres: 10
rows: 1350
cols: 1500
cells: 2025000
v.in.region output=myregion@user1
v.centerpoint input=myregion@user1 output=myregion_cp
v.buffer input=myregion_cp@user1 output=myregion_cp_buffer_250m distance=250
r.mask vector=myregion_cp_buffer_250m@user1
r.mapcalc expression="mytestraster = elevation@PERMANENT"
r.mask -r
v.db.addtable map=myregion@user1
v.rast.stats map=myregion@user1 raster=mytestraster@user1 column_prefix=elev method=number,null_cells
v.db.select map=myregion@user1
cat|elev_number|elev_null_cells
1|1944|1944 <=
r.univar -e map=mytestraster@user1
total null and non-null cells: 2025000
total null cells: 2023056 <=
Of the non-null cells:
----------------------
n: 1944 <=
minimum: 108.462
maximum: 130.415
range: 21.9533
mean: 121.157
mean of absolute values: 121.157
standard deviation: 4.39815
variance: 19.3437
variation coefficient: 3.63013 %
sum: 235528.598342896
1st quartile: 118.196
median (even number of cells): 121.278
3rd quartile: 124.69
90th percentile: 126.597
total null cells: 2023056 by r.univar vs. 1944 by v.rast.stats
from grass.
manually r.univar test with the 2 rasters
r.univar map=mytestraster@user1 zones=myregion_raster@user1
zone 1
total null and non-null cells: 2025000 <=
total null cells: 2023056 <=
Of the non-null cells:
----------------------
n: 1944
minimum: 108.462
maximum: 130.415
range: 21.9533
mean: 121.157
mean of absolute values: 121.157
standard deviation: 4.39815
variance: 19.3437
variation coefficient: 3.63013 %
sum: 235528.598342896
total null cells: 2023056 correctly counted in contrary to 1944 by v.rast.stats
from grass.
Backported in 94c2dc2 and 787f55e
from grass.
Related Issues (20)
- [Bug] Adjust Windows CI workflows for Python 3.12 HOT 1
- [Bug] v.in.ogr: Link to database table is broken after importing a new .shp file HOT 9
- [Bug]: reserved SQL word as an attribute table column name causes multiple failures HOT 15
- [Bug] g.gui.tplot: y values in stvds plots are unordered HOT 4
- [Bug] r.terraflow: fails with grid larger than memory on very small regions HOT 1
- [Bug] CI: releasebranch_8_3 failure for CentOS and OSGeo4W HOT 4
- [Bug] r.proj from EPSG:3031 to EPSG:4326 returns one grid cell HOT 7
- [Bug] db.tables module doesn't see vector map table if table was created with ODBC DB connection
- Ensure consistent type definitions in python functions HOT 1
- [Bug] CI on main failing due to dependencies HOT 4
- Grass GIS version 8.3.2.1 problem HOT 8
- [Bug] CI: Bandit: 1 configuration not found (python-code-quality.yml) HOT 3
- [Bug] PATH setting discrepancy between the main exectable and Python API for scripts on Windows
- [Bug] wxGUI: Nonsense commands end in Success in gconsole OnCmdDone method
- [Bug] Windows CI builds fail to compile r.flow HOT 6
- Renovate naming convention issue HOT 2
- Raster layers cannot be displayed[Bug] HOT 1
- [Bug] wxGUI/history: update cross to green check after updating to current region
- Tests are failing in CI with an ISO format error HOT 6
- r.recode results in integer when floating numbers are expected [Bug] HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grass.