[R-sig-Geo] error projecting with rgdal::project()

Danielle Haulsee dhaulsee at udel.edu
Mon Jun 8 18:17:59 CEST 2015


Hello,

I recently updated R and a bunch of packages and am now finding bits of old
code that no longer run (of course!). Specifically I am having issues with
project() and spTransform(), likely both due to the same issue. It seems to
perhaps be an issue with rgdal or perhaps one of its dependencies because
the problem does not appear related to the r-version.

I ran the following example code on two different machines, both running

R version 3.0.3 (2014-03-06) -- "Warm Puppy", and either got an error or no
error depending on the version of rgdal installed.

*This version was successful. *
require(rgdal)

Loading required package: rgdal
Loading required package: sp
rgdal: version: 0.9-1, (SVN revision 518)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
Path to GDAL shared files:
/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rgdal/gdal
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
Path to PROJ.4 shared files:
/Library/Frameworks/R.framework/Versions/3.0/Resources/library/rgdal/proj
tst <- cbind(c(-75.13574,-75.02346, -74.98747, -74.87270, -74.86581),
c(38.89733, 38.74623, 38.56410, 38.56395, 38.45108))
xy <- project(tst, "+proj=tpeqd +lon_1=-80 +lat_1=33 +lon_2=-75 +lat_2=39")

*This version gives me an error. *
require(rgdal)
Loading required package: rgdal
Loading required package: sp
rgdal: version: 0.8-16, (SVN revision 498)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.9.2, released 2012/10/08
Path to GDAL shared files: /usr/share/gdal
Loaded PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
Path to PROJ.4 shared files: (autodetected)

tst <- cbind(c(-75.13574,-75.02346, -74.98747, -74.87270, -74.86581),
c(38.89733, 38.74623, 38.56410, 38.56395, 38.45108))
xy <- project(tst, "+proj=tpeqd +lon_1=-80 +lat_1=33 +lon_2=-75 +lat_2=39")
*Error in project(tst, "+proj=tpeqd +lon_1=-80 +lat_1=33 +lon_2=-75
+lat_2=39") : *
*  major axis or radius = 0 or not given*

I also get the same error when running R version 3.2.0 (2015-04-16) --
"Full of Ingredients" and rgdal version:
Loading required package: rgdal
Loading required package: sp
rgdal: version: 0.9-2, (SVN revision 526)
Geospatial Data Abstraction Library extensions to R successfully loaded
Loaded GDAL runtime: GDAL 1.11.2, released 2015/02/10
Path to GDAL shared files:
Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491]
Path to PROJ.4 shared files: (autodetected)

Does anyone have any ideas as to what is going on? I'm also getting the
same error (major axis or radius = 0 or not given), when using the
spTransform function. I've tried searching for this error and haven't come
up with much. Let me know if more information is needed. Thanks in advance
for any insight you might have.

  [image: photo]
*Danielle Haulsee*
PhD Candidate, University of Delaware
 m:(717)451-7636 | e:dhaulsee at udel.edu | w:www.orb.ceoe.udel.edu | a:700
Pilottown Rd. Lewes, DE 19958
    Get a signature like this:
<https://ws-stats.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0YW1wLmNvbS8/dXRtX3NvdXJjZT1leHRlbnNpb24mdXRtX21lZGl1bT1lbWFpbCZ1dG1fY2FtcGFpZ249cHJvbW9fNDUiLCAiZSI6ICJwcm9tb180NV9jbGljayJ9>
Click
here!
<https://ws-stats.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0YW1wLmNvbS8/dXRtX3NvdXJjZT1leHRlbnNpb24mdXRtX21lZGl1bT1lbWFpbCZ1dG1fY2FtcGFpZ249cHJvbW9fNDUiLCAiZSI6ICJwcm9tb180NV9jbGljayJ9>

	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list