[GRASS-user] Presence/Absence error
Moritz Lennert
mlennert at club.worldonline.be
Wed Sep 13 05:22:24 EDT 2006
Hamish wrote:
> Joel Pitt wrote:
>> I have a raster map that indicates the predicted area of where a
>> species exists, plus a vector map of points where the species has
>> actually been recorded.
>>
>> I'm trying to work out a simple method for working out the number of
>> correctly predicted occurences (where the vector points overlap with
>> non-null cells in the raster), the number of false positives (where a
>> non-null raster cell exists but no vector point), the number of false
>> negatives (where the point exists but raster cell is null), and the
>> number of correct negatives (the raster cell is null and no point
>> exists).
>
> v.out.ascii | tr '|' ' ' | r.what
>
> (I just updated the help page in CVS; may take a day or 2 to hit the web)
>
> pipe that to "| grep '*'" or "| grep -v '*'" to filter hits or misses.
>
> use v.to.rast + r.mapcalc to find cells which don't contain a vector
> point (or r.what + r.in.xyz). Use r.stats to total up results or
> perhaps make a cover map of all "1" and use r.univar's "sum" to get
> total number of cells. (or easier just "n" of null & non-null cells
> directly from v.to.rast map)
>
>
> see also v.what.rast -
> Uploads raster values at positions of vector points to the table
>
Or (just thinking out loud):
v.to.rast your vector points
then create new raster with r.mapcalc using conditions, such as:
- if map1 and map2:1
- if map1 and not map2: 2
etc
then r.report (with unit=cell_counts) on resulting map.
Moritz
More information about the grass-user
mailing list