0

I have a dataset with lat/long that I intend to plot over a map of NA rivers. The issue I am having is with the projection of the map. The shapefile I am using is a proj=laea and when plotted with ggplot the axes are in UTM(?) rather than lat/long. I havent been able to figure out how to change the projection to something that will plot with lat/long. Right now if I try to change the projection (say to "+init=epsg:4269 +proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs +towgs84=0,0,0") it screws with the map.

rivers <- readOGR(dsn=path.expand("shapefile/data/hydrography_l_rivers_v2.shp"))

proj4string(rivers)
[1] "+proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997 +units=m +no_defs"

rivers<-spTransform(rivers, " +proj=laea +lat_0=45 +lon_0=-100 +x_0=0 +y_0=0 +a=6370997 +b=6370997+units=m +no_defs")

ggplot()+
  geom_line(data=rivers, aes(x=long, y=lat, group=group))
mchen
  • 31
  • 1
  • 1
    Welcome to SO. It's hard to quantify what a 'deformed map' looks like. You might consider opening the data in a GIS and deciding which projection looks best at the national level for your data. Then you can deal with the issue in R. – Tim Assal Apr 20 '20 at 01:27
  • @TimAssal Here is the map produced when i switch the projection to +proj=longlat +ellps=GRS80 +datum=NAD83 +no_defs +towgs84=0,0,0 using spTransform. https://i.stack.imgur.com/cGVZX.png – mchen Apr 20 '20 at 13:13
  • Hmm, yes, I see what you mean. I'd still stick with my previous advice. Open in a GIS and determine the projection you'd like to use. It's tough to suggest much more without a reproducible example. – Tim Assal Apr 20 '20 at 15:36

0 Answers0