Skip to content
Prev 16624 / 29559 Next

towgs snd prj files

On Wed, 7 Nov 2012, Agustin Lobo wrote:

            
The issue is that where the +towgs84 coefficients are not known with 
complete certainty (the case for ED50, where they differ a good deal 
depending on where you are), they are dropped when converting from PROJ.4 
to the internal representation used by OGR:

library(rgdal)
pt <- matrix(c(10000, 3000000), ncol=2)
spdf <- SpatialPointsDataFrame(SpatialPoints(pt), data=data.frame(ID=1))
proj4string(spdf) <- CRS("+init=epsg:23031")
proj4string(spdf)
td <- tempdir()
writeOGR(spdf, td, "tmp", driver="ESRI Shapefile") 
readLines(paste(td, "tmp.prj", sep="/"))
proj4string(readOGR(td, "tmp"))

If we use OSGB instead, with D_OSGB_1936 rather than D_unknown for its 
datum, the +towgs84 values are preserved:

spdf <- SpatialPointsDataFrame(SpatialPoints(pt), data=data.frame(ID=1))
proj4string(spdf) <- CRS("+init=epsg:27700")
proj4string(spdf)
writeOGR(spdf, td, "tmposgb", driver="ESRI Shapefile")
readLines(paste(td, "tmposgb.prj", sep="/"))
proj4string(readOGR(td, "tmposgb"))

So the logic in OGR is trying to ensure that only information that is 
authoritative is encoded in the output file. QGIS has a "custom" way of 
handling spatial reference, trying to make things "easy" for the user, 
whereas OGR prefers not to guess when it doesn't have authority. ED50 is 
not a standard at all, it is a collection of national (sometimes 
sub-national) standards that have also changed over time. It is only since 
GRS80/WGS84 that we have satellite-based measurements on which to base 
spheroid and datum definitions, hence the importance of having authority 
for transformations to and from WGS84. It doesn't make matters easier that 
the Earth also changes, but these changes are small in comparison with the 
differences induced by poor datum transformation. The datum values 
recognised by PROJ.4 are:

projInfo("datum")

which includes OSGB36, but not ED50. This:

http://www.ogp.org.uk/pubs/373-10.pdf

gives a flavour of the difficulties involved in oil exploration in the 
North Sea when also transforming between ED50 and WGS84 - note that these 
coefficients are very different from those shown in another source:

http://earth-info.nga.mil/GandG/coordsys/onlinedatum/CountryEuropeTable.html

referred to in this thread:

http://lists.osgeo.org/pipermail/gdal-dev/2009-May/020656.html

This is a never-ending story ...

Roger
No, nothing to do with this.