Qgis or Python: converting a CSV file of simple locations to raster? -


i have csv file follows:

diversity,longitude,latitude 7,114.99638889,-33.85333333 6,114.99790583,-33.85214594 10,115,-33.85416667 2,115.0252075,-33.84447519 

i convert raster file set 'no data' value on of area , values in cells @ long/lat locations.

is there easy way in qgis or python? cheers, steve

not asked for, here how can approach in r

get data:

d <- read.csv('file.csv') d <- cbind(d[,2:3], d[,1]) 

load raster package:

library(raster) 

if data regularly spaced:

r <- rasterfromxyz(d) writeraster(r, 'file.tif') 

else create empty raster , rasterize:

r <- raster(extent(d[,1:2])) res(r) <- 1  # adjust , other parameters see fit r <- rasterize(d[,1:2], d[,3], fun=mean) 

Comments