I have created a polygon shapefile in ArcMap using 7 points(lat,lon) then read this shapefile into R to obtain the CRS. I then created a shape file in R using the
sf package (and the 7 points) and used the CRS obtained from the ArcMap shapefile. When I bring the shapefile created in R into ArcMap I get a warning regarding different coordinate systems. Why would this happen?
7 points (lon and lat) where point 1 = point 7 (closed loop). Create a polygon shapefile in ArcMap and display. Properties in ArcMap show : Geographic Coordinate System: GCS_North_American_1983 Datum: D_North_American_1983
In R I use
rgdal to read in shapefile and obtain CRS
cashes <- rgdal::readOGR(dsn="path",layer="shapefile") cashes@proj4string This results in : "+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0 "
Now I create the shapefile in R using the
sf package (I could use %>%)
Rshapefile <- readxl::read_xlsx(path,sheet="cashes") Rshapefile <- sf::st_as_sf(Rshapefile,coords=c("lon","lat"),crs="+proj=longlat +datum=NAD83 +no_defs +ellps=GRS80 +towgs84=0,0,0 ")
Edit: At this point if i inspect Rshapefile i get this proj4string: +proj=longlat +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +no_defs Note: +datum=NAD83 is dropped.
Rshapefile <- dplyr::summarize(Rshapefile,geometry = sf::st_combine(geometry)) Rshapefile <- sf::st_cast(Rshapefile,"POLYGON") sf::st_write(Rshapefile,dsn=path,layer="Rshapefile",driver="ESRI Shapefile")
I then bring this
Rshapefile into ArcMap and the coordinate systems are different. When I view the properties in ArcMap they show: Geographic Coordinate System: GRS 1980(IUGG, 1980) Datum: D_unknown
Why is this? I must be doing something wrong but I can't figure out what!