Skip to content

plot.Map deprecated, alternative ?

2 messages · Markus Loecher, Roger Bivand

#
Dear all, 
I understand that plot.Map (the default method for plotting shape objects) is deprecated, however I have not found a working method converting my shape file into either a polylist or sp class.
I tried the following 
   p2roads <- read.shape("sf.shp")
  SF.map <- Map2poly(p2roads)
where sf.shp is a shape object of the San Francisco street map, and get the following error message:
   Error in Map2poly(p2roads) : maptype not poly
Are there differences between shape files ? Which other way could I try to convert my shape object so that plot.Spatial will work ?

Thanks !

Markus
#
On Thu, 1 Nov 2007, Markus Loecher wrote:

            
For example:

library(maptools)
getinfo.shape("sf.shp")
# presumably lines
roads <- readShapeLines("sf.shp")
class(roads)
plot(roads, axes=TRUE)

or

library(rgdal)
roads <- readOGR(".", "sf")
class(roads)
plot(roads, axes=TRUE)

Roger