Skip to content
Prev 16575 / 29559 Next

readGDAL loses datum

I did notice another thing.  I've attached the .prj file I've been
using along with a raster exported in that projection using ArcGIS.
[...]
PROJ.4 string is:
'+proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0
+datum=NAD83 +units=m +no_defs '
[...]
CRS arguments:
 +proj=aea +lat_1=29.5 +lat_2=45.5 +lat_0=23 +lon_0=-96 +x_0=0 +y_0=0
+datum=NAD83
+units=m +no_defs +ellps=GRS80 +towgs84=0,0,0

There are similar issues with extra Proj4 parameters showing up with
+proj=longlat +datum=WGS84 +no_defs, although these seem to be added
on read and stripped on write, somehow.

wgs84_1 <- SpatialGridDataFrame(GridTopology(c(0, 0), c(1, 1), c(1,
1)), data.frame(band = 1), CRS("+proj=longlat +datum=WGS84 +no_defs"))
writeGDAL(wgs84_1, "wgs84_1.tif")
system("gdalinfo -proj4 wgs84_1.tif")
wgs84_2 <- readGDAL("wgs84_1.tif")
wgs84_2 at proj4string
writeGDAL(wgs84_2, "wgs84_2.tif")
system("gdalinfo -proj4 wgs84_2.tif")

Any idea where the extra +ellps +towgs84 terms are coming from?

Oliver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: attachments.zip
Type: application/zip
Size: 1045 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20121103/1e8e9702/attachment.zip>
Message-ID: <CAPQ=hVKHqY1d_Gcgbbzg1D89QYJocTbY0HMCqEsm_pVoLrrBQA@mail.gmail.com>
In-Reply-To: <CAPQ=hVKkjjyeT+bsTk_vzuP6U67k3oDy1=25euiuPvkuOHVE0Q@mail.gmail.com>