search for: shapefile_without_extension

Displaying 1 result from an estimated 1 matches for "shapefile_without_extension".

2012 May 01
0
Plotting shapefiles on existing maps
...l, not projected coordinates. If you know the projection of the shapefile (or if there is a *.prj file accompanying the *.shp), try using the transform() method in the rgdal package to do this. If there is a *.prj file, this should work: library(rgdal) my_lines <- readOGR(<directory>, <shapefile_without_extension>) my_lines1 <- transform(my_lines, CRS("+proj=longlat +ellps=WGS84")) *I believe the above line should be: my_lines1 <- spTransform(my_lines, CRS("+proj=longlat +ellps=WGS84")) plot(my_lines1, add=TRUE) If not, you'll need to work out exactly what the projection...