Skip to content
Prev 5854 / 29559 Next

how to show polygons from SHP file in Google map?

Jian,

First realize where your R code was trying to
find your shapefile. In your code below you
are searching maptools\shapes and not your code
subdirectory. Maptools is the domain of that
package and you should not put your shapefiles
there but in your own separate user subdirectory.

natSHP.sp <- readShapePoly(system.file("nro2.shp", package="maptools")[1], proj4string=CRS("+init=epsg:2166"))

Then in R, make sure R is pointing to the
directory where your nro2.shp file exists.

This can be done by selecting in R, File,
Change Directory.

Good luck,
Jim Burke
Torleif Markussen Lunde wrote: