[R-sig-Geo] symbols on a map
Susumu Tanimura
stanimura-ngs at umin.ac.jp
Mon Jun 27 14:33:25 CEST 2005
Hi there,
My today's trial is to put symbols on a map. After reading pnm files
(airport symbol) with read.pnm() from pixmap package, I overlaid the pixmap
objects on the map following their xy coordinates.
library(maptools)
library(pixmap)
airport <- function() {
A <- "airp.shp"
V <- "admin1.shp"
plot((read.shape(V)))
r <- read.pnm("air.ppm")
a <- Map2points(read.shape(A))
for (i in 1:length(a[,1])) addlogo(r,px=c(a[i,1]-0.5,a[i,1]+0.5),py=c(a[i,2]-0.5,a[i,2]+0.5))
}
Unfortunately, resulted map was very ugly because the pnm format dose
not have transparency. For mapping purpose, treating with a picture
format with alpha channel is needed. Dose anyone succeed to put
symbols on a map of R?
It may very happy if I can use metapost, eps, or any other vector
formats for symbology of map.
--
Susumu Tanimura
More information about the R-sig-Geo
mailing list