Skip to content
Prev 19401 / 29559 Next

misalignment between data projected in R and ArcGIS (Helen Sofaer)

On Thu, 26 Sep 2013, Ralf Sch?fer wrote:

            
The missing information is about the way in which rgdal was installed. For 
my rgdal, installed from source and dynamically linked to the PROJ library 
(GDAL also links to the PROJ library, so PROJ is the crucial component), I 
see:

$ proj +proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 \ 
+datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0
-108.58333 48.75000
-871738.47	1091090.13

So OK, and:
Loading required package: sp
rgdal: version: 0.8-11, (SVN revision 479M)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.10.1, released 2013/08/26
Path to GDAL shared files: /usr/local/share/gdal
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
Path to PROJ.4 shared files: (autodetected)
+y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0")
           [,1]    [,2]
[1,] -871738.5 1091090
+x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0")
CRS("+proj=aea +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 
+datum=NAD83 +units=m +no_defs +ellps=GRS80 +towgs84=0,0,0"))
[1] TRUE

the same in R. The failing component is then the underlying PROJ library. 
Ralf is using OSX, and if both Ralf and Helen are using the CRAN OSX rgdal 
binary, this may be the explanation, but of course will not be if rgdal 
and PROJ were installed in a different way.

I have checked that the CRAN Windows rgdal binary works correctly, using 
PROJ 4.7.1, linked statically, on 64-bit and 32-bit.

Please describe how you installed rgdal, and if it turns out to be the OSX 
CRAN binary, we'll address that - if however you installed PROJ in some 
other way then rgdal from source, we'll need to check those routes 
instead.

This also suggests that (part of) the PROJ.4 test suite should be added to 
rgdal to check the integrity of the projection and datum transformation 
functions.

Thanks for clear examples,

Roger