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

MacQueen, Don macqueen1 at llnl.gov
Mon Jun 8 20:33:06 CEST 2015


If it helps (and since I could do it quickly and easily), I have success
with
  R 3.2.0
  gdal 1.11.2
  rgdal 0.9-3
  sp_1.1-0
  proj.4 4.9.1
(on a Mac; see below)

If I read your email correctly, that is a combination you haven't tried
(you have rgdal 0.9-2 with R 3.2.0).


> require(rgdal)
Loading required package: rgdal
Loading required package: sp
rgdal: version: 0.9-3, (SVN revision 530)
 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:
/Users/macqueen1/Library/R/3.2/library/rgdal/gdal
 Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491]
 Path to PROJ.4 shared files:
/Users/macqueen1/Library/R/3.2/library/rgdal/proj
 Linking to sp version: 1.1-0
> 
> 
> 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")
> 
> 
> sessionInfo()
R version 3.2.0 (2015-04-16)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.9.5 (Mavericks)

locale:
[1] C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] rgdal_0.9-3 sp_1.1-0

loaded via a namespace (and not attached):
[1] grid_3.2.0      lattice_0.20-31
>



I don't know what "autodetected" in the path to proj.4 means, but that's
another difference between mine and yours.

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 6/8/15, 9:17 AM, "Danielle Haulsee" <dhaulsee at udel.edu> wrote:

>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=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0
>YW1wLmNvbS8/dXRtX3NvdXJjZT1leHRlbnNpb24mdXRtX21lZGl1bT1lbWFpbCZ1dG1fY2FtcG
>FpZ249cHJvbW9fNDUiLCAiZSI6ICJwcm9tb180NV9jbGljayJ9>
>Click
>here!
><https://ws-stats.appspot.com/r?rdata=eyJydXJsIjogImh0dHA6Ly93d3cud2lzZXN0
>YW1wLmNvbS8/dXRtX3NvdXJjZT1leHRlbnNpb24mdXRtX21lZGl1bT1lbWFpbCZ1dG1fY2FtcG
>FpZ249cHJvbW9fNDUiLCAiZSI6ICJwcm9tb180NV9jbGljayJ9>
>
>	[[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



More information about the R-sig-Geo mailing list