An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20120404/13b805ce/attachment.pl>
Conversion of points from AGD66 to WGS84?
2 messages · Adam, Michael Sumner
As far as I know, the EPSG 4202 init form is not sufficient, and you
need to specify the datum parameters explicitly. Wherever in the
database "aust_SA" is defined it is not getting the actual parameters
for some reason - I don't know if that requires an install/build
configuration, but I've just done it manually in the past and stored
the values myself.
So,
pts <- matrix(c(145.1167, -37.83333), ncol = 2)
aust_SA <- SpatialPoints(pts, CRS("+init=epsg:4202"))
agd66 <- SpatialPoints(pts, CRS("+proj=longlat +towgs84=-127.8,-52.3,152.9"))
## no difference
spTransform(aust_SA, CRS("+proj=longlat +datum=WGS84 +ellps=WGS84
+towgs84=0,0,0"))
##SpatialPoints:
## coords.x1 coords.x2
##[1,] 145.1167 -37.83333
##Coordinate Reference System (CRS) arguments: +proj=longlat
+datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
## works now
spTransform(agd66, CRS("+proj=longlat +datum=WGS84 +ellps=WGS84
+towgs84=0,0,0"))
##SpatialPoints:
## coords.x1 coords.x2
##[1,] 145.118 -37.83183
##Coordinate Reference System (CRS) arguments: +proj=longlat
+datum=WGS84 +ellps=WGS84 +towgs84=0,0,0
It doesn't seem to matter if I use the 3-parameter towgs84 argument
for AGD66 or the 7-param one listed here, but I don't know the details
of why:
http://www.osgeo.org/pipermail/gdal-dev/2006-February/008090.html
There's also this for what it's worth:
http://www.osgeo.org/pipermail/gdal-dev/2007-November/014762.html
I don't know apart from a matter of experience how to find out if the
EPSG presets are appropriate or not, so I'd just recommend doing some
reading on the topic to convince yourself.
(I checked that transformation above against the presets available in
Manifold GIS, which I happen to have verified for this quite some time
ago so I'm confident that it's right.)
There are several resources on the web for verifying this transformation, i.e.
http://www.ga.gov.au/earth-monitoring/geodesy/geodetic-datums/about.html
Cheers, Mike.
On Wed, Apr 4, 2012 at 2:11 PM, ADAM PETER CARDILINI
<apcar at deakin.edu.au> wrote:
Dear All,
I have a dataset of lon/lat coordinates with about two thirds in datum AGD66/84 and the other third in datum WGS84. From what I have read I think there is about a 200m different between these datum. I want to change all of the AGD66 coordinates to be correct in WGS84 to fix this difference.
My data looks like:
lon ? ? ? ? ? ? ? ? ? ? ? ? ?lat ? ? ? ? ? ? ? ? ? ? ? ? ? datum
145.1167 ? ? ? ? ? ? ?-37.83333 ? ? ? ? ? ? AGD66
144.9756 ? ? ? ? ? ? ?-38.36555 ? ? ? ? ? ? WGS84
So far I have tried 1:
# to choose the pts from the dataset
pts66<-pts[which(pts$datum=='AGD66'),]
# to assign the AGD66 datum
pts66 = SpatialPoints(cbind(pts66$lon,pts66$lat), CRS("+init=epsg:4202"))
# to transform this data to WGS I have tried two different methods
pts66t = spTransform(pts66, CRS("+init=epsg:3033"))
# and
pts66t = spTransform(pts66, CRS("+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0"))
The first of these transformations, using CRS("+init=epsg:3033"), transforms the results to the following:
lon ? ? ? ? ? ? ? ? ? ? ? ? ?lat
11736428 ? ? ? ? ? ? 3368292
While the second, does not result in any transformation:
lon ? ? ? ? ? ? ? ? ? ? ? ? ?lat
145.1167 ? ? ? ? ? ? ?-37.83333
Why are these two transformations different? I had thought they would do the same thing because I have used "+proj=longlat +datum=WGS84 +ellps=WGS84 +towgs84=0,0,0" to reproject raster files from one CRS to WGS84.
How can I get the points to transform and stay in the same lon/lat format?
I just want to get the points that were taken in AGD66 to be at the right spot on the map when I use them in conjunction with raster files in WGS84. I think there must be some fundamental concept I am misunderstanding when working with this data. Can anyone help me out and/or point me in the right direction. Thank you very much for your time and help in advance.
Kind regards,
Adam Cardilini,
PhD Candidate,
Deakin University,
School of life and environmental sciences,
75 Pigdons Rd, Waurn Ponds,
Victoria, 3126
Mob: 0431 566 340
adamcardilini.wordpress.com<http://adamcardilini.wordpress.com/>
? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Michael Sumner Institute for Marine and Antarctic Studies, University of Tasmania Hobart, Australia e-mail: mdsumner at gmail.com