Maybe a rather simple question, but I could not find an answer. I am trying to extract long, lat, value from a .tiff file of a map of Africa with long/lat and soil acidity as the values.
Here is some information:
class : RasterLayer
dimensions : 9578, 8990, 86106220 (nrow, ncol, ncell)
resolution : 1000, 1000 (x, y)
extent : -4108621, 4881379, -5076086, 4501914 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=laea +lat_0=5 +lon_0=20 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +ellps=WGS84 +towgs84=0,0,0
data source : C:\Users\M17GPPALT.tif
names : M17GPPALT
values : 0, 65535 (min, max)
I want to extract simple long, lat, ph value for each point as an array.
Best Answer
Use
rasterToPoints
- for example:you'll end up with 86 million rows, although cells with NA aren't returned.