[R-sig-Geo] probability contour plot on raster file

Lutfor Rahman rahmannorthampton at gmail.com
Wed Nov 18 23:17:01 CET 2015


Dear forum member,

I have spatial cell/pixels (20 thousands cells) with their co-ordinates
with their corresponding values. I would like to crate probability contours
at 50%, 75% and 99% of those values and after that I would like overlay in
world map.

I should creat raster file and adding contours onto raster and bringing map
onto it (Please let me know-am I right? or there is other way of doing
this?). However, I count see any contours created on my raster while I am
using following code.


Can anyone let me know how I can create probability contours at three
different levels (in three colours; 50%, 75% and 99%). Please let me know
how I could transfer this raster with contours in a map like google terrain
map (any particular package).

Any suggestions will be much appreciated.


best regards

Lutfor


##############

Population<-read.csv("rasterfile.csv", header=T)

names(Population)

summary(Population)

x1<-Population$x

y1<-Population$y

value<-Population$values

r <- raster(nrows=664, ncols=341, xmn=-2087158, xmx=1312843, ymn=-3201679,
ymx=3428321)

proj4string(r) <- CRS("+proj=aeqd +ellps=WGS84 +lon_0=110.7985
+lat_0=43.215")

###I have used above projection as these spatial cells extracted from same
projection.###

r1 <- rasterize(cbind(x1, y1), r, value)

plot(r1)
contour(r1, add=T, levels=c(.50, .75, .99))

#############################

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list