[GRASS-user] Sampling multispectral data

Daniel Victoria daniel.victoria at gmail.com
Wed Feb 4 05:45:04 EST 2009


Hi Ned,

Check out r.what manual page [1], specially the part about using input
from a text file or, better yet, sending the output from v.out.ascii
to r.what.

Basicaly, what you do after having your points is export their
coordinates using v.out.ascii and pipe it to r.what. The query will be
dumped on the screen. To capture it, just save it to any text file.
Something like this:

v.out.ascii YOUR_POINTS fs=' ' | r.what input=YOUR_RASTERS > FILE_TO_SAVE.txt


[1]: http://grass.osgeo.org/gdp/html_grass63/r.what.html

Daniel

On Wed, Feb 4, 2009 at 8:29 AM, Ned Horning <horning at amnh.org> wrote:
> Greetings,
>
> I am looking into the possibility of using GRASS with the R Random Forest
> algorithm to create a land cover classification. I read the Furlanello,
> Neteler et al. paper (very nice) and some others but I need some help with
> the details. My problem is somewhat different from the Furlanello, Neteler
> et al. paper since my sample data are coming from a multispectral image
> instead of a database. I still have to get up to speed with R and the Random
> Forest algorithm but I have an initial GRASS question.
>
> What I want to do is select a number of samples representing each land cover
> type from a multispectral image. These data would then be input into the
> Random Forest model to create the classification rules. For example, I'm
> thinking that I will need to create vector polygons for each land cover type
> I'm interested in. To keep it simple for this explanation I'll use forest
> and non-forest. I'll digitize a few polygons that represent forest and a few
> more that represent non-forest. Next, I will need to sample the
> multispectral image data by selecting 500 randomly selected pixels that fall
> under the forest polygons and  another 500 pixels from under the non-forest
> polygons. How can I do this in GRASS? I suppose I can run v.random to create
> a vector point layer of random points within each land cover class (specify
> zmin and zmax as the same value?) but then how would I use the point layer
> to get the spectral information from an image group? I will also need to
> format the sample data so that R can read it.
>
> If anyone has advice or resources they can point me to regarding the use of
> Random Forests or CART in GRASS please let me know
>
> All the best,
>
> Ned
>
>
>
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>


More information about the grass-user mailing list