Count points in raster cells

From GRASS-Wiki
Revision as of 19:03, 9 April 2010 by Neteler (talk | contribs) (new from ML)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Q: How can I count the number of points which fall into a raster cell? I want to count vector points by region resolution (quadrat count) and write the results to a raster map (in order to perform r.mapcalc on these observed frequencies).

A: Use r.in.xyz with 'method=n' which will count points per cell (resolution chosen with g.region) and write a raster map allocating the number count to the cell.

Example:

v.out.ascii input=myvec format=point | r.in.xyz input=- output=myras method=n type=FCELL x=1 y=2 z=3