[GRASS-user] Presence/Absence error

Joel Pitt joel.pitt at gmail.com
Thu Sep 14 02:00:05 EDT 2006


On 9/13/06, Moritz Lennert <mlennert at club.worldonline.be> wrote:
> 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
>

Thanks guys! I had some vaque idea how to do it - but the v.to.ascii
command line is really fast - so just what I need.

However one problem is using v.to.rast:

http://static.flickr.com/93/242928408_189e335e04_o.png

This is result of:
create a raster map1 from v.to.rast
place nulls into map2 where map1 cells are not null (basically
subtracting the vector points from map2)

As you can see in the screenshot, some of the points and the raster
cells of map1 don't line up. Ignore the null cells at the bottom of
the map as it is near a coast line and have nothing to do with the
vector.

Any idea why this is? and how to get around it?

Thanks again!

-- 
-Joel

"Wish not to seem, but to be, the best."
                -- Aeschylus




More information about the grass-user mailing list