[R-sig-Geo] Adding points to Map objects in RgoogleMaps

Greg Snow Greg.Snow at imail.org
Fri Apr 22 18:58:18 CEST 2011


Does the PlotArrowsOnStaticMap in the RgoogleMaps package help?

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-sig-geo-bounces at r-project.org [mailto:r-sig-geo-bounces at r-
> project.org] On Behalf Of luca candeloro
> Sent: Friday, April 22, 2011 5:52 AM
> To: r-sig-geo at r-project.org
> Subject: [R-sig-Geo] Adding points to Map objects in RgoogleMaps
> 
> Hi all,
> I'd like to add points and arrows to visualize connections between
> points in
> a map created with PlotOnStaticMap function.
> Here is my code:
> 
> library(RgoogleMaps)
> library(maptools)
> 
> LatMin=36.5
> LatMax=38.5
> LongMin=12
> LongMax=15.9
> CenterLat=(LatMin+LatMax)/2
> CenterLong=(LongMin+LongMax)/2
> 
> mzoom <- MaxZoom(latrange=c(LatMin,LatMax),
> lonrange=c(LongMin,LongMax),
> size=c(1280, 1280))[[1]]
> 
> Sicilia <- GetMap.bbox(center=c(CenterLat,CenterLong), zoom=8,
> destfile="C:/Sicilia.png", maptype="satellite")
> PlotOnStaticMap(Sicilia)
> 
> POINT1=c(14.6502685546875, 36.923547681089296)
> POINT2=c(14.7052001953125, 37.65338320128765)
> POINT3=c(13.5955810546875, 37.64903402157866)
> POINT4=c(14.3316650390625, 37.4530574713902)
> POINT5=c(13.7054443359375, 37.39634613318923)
> POINT6=c(15.1995849609375, 37.965854128749434)
> #here I'd insert something like arrows() or points() or plot() of a
> graph
> objects from igraph package.
> 
> How may I adjust points coordinates or projections?
> Thanks,
> Luca.
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list