>
> It is not working because "cellnumbers" is currently only an argument for
> extracting values from a Raster* for polygons. That's what the docs say.
> But
> I'll also implement if for lines.
>
I did notice that, but there was no ==line== section in the doc I have. Is
my package outdated ?

>
> In your example it is easy to extract cell numbers for the line
>
> I know, but in real life I have random values (i.e. not ordered). Is there
a faster option than creating a copy of the raster with the values of the
cells being the cell number (it's a nice workaround though)?

> r[] = 1:ncell(r)
> > extract(r, l)
> [[1]]
> [1]  4  5  8  9 12 13 16 17
>
> > I'm also not sure I get the order in which the values are returned, but
> it
> > seems
> >  it is not from the begining of the line to the end or reverse.
>
> The values are first in row order, and then in column order.  Not in the
> order of the coordinates of the line(s).
>

I'm trying to think of a way to order these. Do you see a simple solution ?
I'm finally doing a profile from a raster using a line.

Thanks again for your help,
Etienne

>
> Robert
>
> --
> View this message in context:
> http://r-sig-geo.2731867.n2.nabble.com/extract-cell-numbers-from-raster-along-a-line-tp6185643p6186374.html
> Sent from the R-sig-geo mailing list archive at Nabble.com.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

