[R-sig-Geo] projection of South American Datum 1969 data

Maren Huck M.Huck at derby.ac.uk
Fri Aug 2 16:46:01 CEST 2013


Dear List-members,
While trying to get to grips with spatial analysis I got seriously stuck when trying to use my own data that are, unfortunately not collected in a standard system.

I am working with data that have been collected in UTM based on the South American Datum 1969  (in Northern Argentina, UTM zone 21J South). (EPSG-code:4618; the ellps name in R seems to be "aust_SA", not SAD69) I would like to plot these on a satellite map from Google. However, the data seem to be slightly shifted. I have found +towgs84 values for SAD69 (-62, -1, -37), but I when I included these in the code nothing seems to change. (see example code below).
In the example code I provide the map from Google, and a transect line where it SHOULD (approximately) be, based on some manual alteration of the Longitude-Latitude values I get from transformation. (Printed on the map in green). I also provide the raw data, which, when converted using the suggested +towgs84 results in the blue line. If I grossly change to +towgs84 values (multiply by 1000) the transect is plotted at exactly the same location (red line), which suggests to me that this information is not really read.
I also found that 
> CRS("+init=espg:4618")
produces the following error
Error in CRS("+init=espg:4618") : no system list, errno: 2

And I find that excluding the argument +ellps=aust_SA and +init=epsg:4618 completely also leads to exactly the same result, i.e., the information that this should be the South American Datum does not seem to be read by R.
I also tried to set the major and minor radius directly with +a=6378160 +b=6356775, but this did also not work.
Is there anything I misunderstood, or anything else I can do to get the little shift 'fixed'? I tried to find answers in the internet, but did not find anything (that I understood; and many of kind-of-similar queries I found did not relate to R). 

####### My codes ##############
# I am working on a PC, MS Windows 7 Enterprise; R vs. 2.15.2 # The raw data #Longitude (West):
y<-c(381776.3, 381823.5, 381874, 381920.5, 381967, 382021, 382075, 382120.5, 382166, 382215, 382257, 382363) #Latitude (South):
x<-c(7127544, 7127555, 7127565, 7127572, 7127579, 7127588, 7127597, 7127607, 7127617, 7127634, 7127638, 7127651)

# manually corrected longitude latitude values:
west<-c(-58.1815, -58.181, -58.1805, -58.1801, -58.1796, -58.1791, -58.1785, -58.1781, -58.1776, -58.1771, -58.1767, -58.1756) south<-c(-25.9664, -25.9663, -25.9662, -25.9662, -25.9661, -25.966, -25.9659, -25.9659, -25.9658, -25.9656, -25.9656, -25.9655)  # The map
library(RgoogleMaps)
bb <- qbbox(c(-25.984194,-25.961097),c(-58.193481,-58.168056))    #, TYPE = "all", margin = list(m=c(1,1,1,1), TYPE = c("perc", "abs")[1]))
Guayc <- GetMap.bbox(bb$lonR, bb$latR,destfile = "Guaycolec.png", maptype = "satellite", zoom=15)

library(mapproj)
library(rgdal)
# Where the transect line should be:
tmp <- PlotOnStaticMap(Guayc, lat = south , lon = west, FUN=lines, col="green", lwd=2)

# What happens if I use the original UTM data
sps1 <- SpatialPoints(cbind(y, x), proj4string = CRS(paste("+proj=utm +zone=21J +init=epsg:4618 +south +ellps=aust_SA +towgs84=-61,-1,-37,0,0,0,0"))) GridTrans<-as.data.frame(spTransform(sps1, CRS("+proj=longlat"))) mygrid <- cbind.data.frame(lat = GridTrans[,"x"], lon=GridTrans[,"y"]) tmp <- PlotOnStaticMap(Guayc, lat = mygrid[,"lat"], lon = mygrid[,"lon"], FUN=lines, lwd=2, col="blue", add=T)

# and if I change the +towgs84 parameters nothing changes!
sps2 <- SpatialPoints(cbind(y, x), proj4string = CRS(paste("+proj=utm +zone=21J +init=epsg:4618 +south +ellps=aust_SA +towgs84=-61000,-1000,-37000,0,0,0,0")))
GridTrans2<-as.data.frame(spTransform(sps2, CRS("+proj=longlat")))
mygrid2 <- cbind.data.frame(lat = GridTrans2[,"x"], lon=GridTrans[,"y"]) tmp <- PlotOnStaticMap(Guayc, lat = mygrid2[,"lat"], lon = mygrid2[,"lon"], FUN=lines, lwd=2, col="red", add=T)



Any suggestions would be greatly appreciated.
Kind regards,


Maren
---------------------
Maren Huck
Dep. of Biological and Forensic Sciences University of Derby Kedleston Road Derby DE22 1GB U.K.
Tel: +44-(0)1332-59 2354

_____________________________________________________________________
The University of Derby has a published policy regarding email and reserves the right to monitor email traffic. If you believe this email was sent to you in error, please notify the sender and delete this email. Please direct any concerns to Infosec at derby.ac.uk.



More information about the R-sig-Geo mailing list