[R] R software to place points on Yahoo maps

Michael Sumner mdsumner at utas.edu.au
Sun Mar 4 11:47:47 CET 2007


> Is there any R software that create an image from Yahoo maps together 
> with points of known UTM coordinates (or lat/long marked? Note that my 
> region of interest is not covered in sufficient detail by Google maps. 
> It actually does not have to be Yahoo maps as long as it has 
> sufficient coverage of my region but that's the one I have found with 
> coverage of my region. The scale I am interested in is a city block. 
> Thanks.

rgdal in combination with sp. You'll need to georegister the image, as 
the yahoo maps interface is unlikely to provide a format supporting this 
metadata, but you can do that easily with two reference coordinates.

The workflow might go like this (untested).  You could continue the 
query on R-Sig-Geo. Hope this helps.

There are freely available tools for reading image data directly from 
Yahoo, Google and Virtual Earth in georeferenced
versions, but I've only used them via commercial GIS. If you can 
describe the map you want I'd be interested in
exploring that option.

Cheers, Mike.

library(rgdal)
im <- readGDAL("yahooMap.png")  ## a file saved from Yahoo Maps

## create index for RGB colours
col <- SGDF2PCT(im)  ## im is a spatialGridDataFrame with 3 bands

im$ind <- col$idx  ## add the colour index to the data frame

image(im, "ind", col = col$ct)

## BUT you won't be able to plot UTM on this yet

## you'll need to create a new GridTopology with appropriate 
cellcentre.offset and cellsize

ogt <- getGridTopology(im)
. . . find values for offsets and pixel size

gt <- GridTopology(cc.offset, csize,  gt at cells.dim)

## recreate the object
im <- SpatialGridDataFrame(gt, im at data)

image(im, "idx", col = col$ct)
points(utm.x, utm.y)  ## etc.



More information about the R-help mailing list