<div dir="ltr">Roger,<div><br></div><div>I have reproduced a seemingly related problem with the cs2cs commandline program and filed a ticket:</div><div><br></div><div> <a href="http://trac.osgeo.org/proj/ticket/229">http://trac.osgeo.org/proj/ticket/229</a></div>
<div><br></div><div>I'll work on the problem this afternoon.</div><div><br></div><div>Best regards,</div><div>Frank</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 6, 2014 at 3:11 PM, Roger Bivand <span dir="ltr"><<a href="mailto:Roger.Bivand@nhh.no" target="_blank">Roger.Bivand@nhh.no</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Thu, 6 Feb 2014, Roger Bivand wrote:<br>
<br>
> We see a problem in 4.9.0 that is not in 4.8.0 in R. The code provoking the<br>
> problem in rgdal 0.8-15 built against 4.9.0 (trunk):<br>
><br>
> <a href="http://cran.r-project.org/src/contrib/rgdal_0.8-15.tar.gz" target="_blank">http://cran.r-project.org/src/contrib/rgdal_0.8-15.tar.gz</a><br>
<br>
</div>A simpler example is:<br>
<br>
minimal install is install.packages(c("sp", "rgdal"))<br>
<br>
library(rgdal)<br>
checkCRSArgs("+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84<br>
+no_defs +towgs84=0,0,0")<br>
<br>
failing with:<br>
<br>
> library(rgdal)<br>
Loading required package: sp<br>
rgdal: version: 0.8-15, (SVN revision 496M)<br>
Geospatial Data Abstraction Library extensions to R successfully loaded<br>
Loaded GDAL runtime: GDAL 1.11dev, released 2013/04/13<br>
Path to GDAL shared files: /usr/local/share/gdal<br>
Loaded PROJ.4 runtime: Rel. 4.9.0, 27 October 2013, [PJ_VERSION: 490]<br>
Path to PROJ.4 shared files: (autodetected)<br>
> checkCRSArgs("+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84<br>
+no_defs +towgs84=0,0,0")<br>
<div class="im HOEnZb">[[1]]<br>
[1] FALSE<br>
<br>
[[2]]<br>
[1] "no options found in 'init' file"<br>
<br>
</div><span class="HOEnZb"><font color="#888888">Roger<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> minimal install is install.packages(c("sp", "spacetime", "rgdal"))<br>
><br>
> library(sp)<br>
> library(spacetime)<br>
> data(air)<br>
> library(rgdal)<br>
> checkCRSArgs(proj4string(rural@sp))<br>
><br>
> which shows:<br>
><br>
>> checkCRSArgs(proj4string(rural@sp))<br>
> [[1]]<br>
> [1] FALSE<br>
><br>
> [[2]]<br>
> [1] "no options found in 'init' file"<br>
><br>
> first time round. The object rural is read in from a saved R object, and has<br>
> a stored projection of:<br>
><br>
> "+init=epsg:4326 +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs<br>
> +towgs84=0,0,0"<br>
><br>
> So when this string goes via checkCRSArgs() to C code (same function name)<br>
> calling:<br>
><br>
><br>
> if (!(pj = pj_init_plus(CHAR(STRING_ELT(args, 0))))) {<br>
> SET_STRING_ELT(VECTOR_ELT(res, 1), 0,<br>
> COPY_TO_USER_STRING(pj_strerrno(*pj_get_errno_ref())));<br>
> UNPROTECT(1);<br>
> return(res);<br>
> }<br>
><br>
> where res is a list with first element FALSE by default, second contains an<br>
> error message on failure (or what pj_get_def() returns on success. This<br>
> around line 292 in:<br>
><br>
> <a href="https://r-forge.r-project.org/scm/viewvc.php/pkg/src/projectit.cpp?view=markup&root=rgdal" target="_blank">https://r-forge.r-project.org/scm/viewvc.php/pkg/src/projectit.cpp?view=markup&root=rgdal</a><br>
><br>
> However, if we then do:<br>
><br>
> checkCRSArgs("+init=epsg:4326")<br>
><br>
> we tickle something in pj_init_plus() and it works, and subsequently:<br>
><br>
> checkCRSArgs(proj4string(rural@sp))<br>
><br>
> works. I cannot see any changes in pj_init.c in the section looking for +init<br>
> between 4.8.0 and 4.9.0 that might affect this. Under rgdal 0.8-15 and 4.8.0,<br>
> there is no trouble, but the issue arises predictably with the same rgdal<br>
> 0.8-15 and current 4.9.0 trunk.<br>
><br>
> I'd be grateful for any advice.<br>
><br>
> Best wishes,<br>
><br>
> Roger<br>
><br>
><br>
<br>
--<br>
Roger Bivand<br>
Department of Economics, Norwegian School of Economics,<br>
Helleveien 30, N-5045 Bergen, Norway.<br>
voice: +47 55 95 93 55; fax +47 55 95 95 43<br>
e-mail: <a href="mailto:Roger.Bivand@nhh.no">Roger.Bivand@nhh.no</a><br>
<br>
_______________________________________________<br>
Proj mailing list<br>
<a href="mailto:Proj@lists.maptools.org">Proj@lists.maptools.org</a><br>
<a href="http://lists.maptools.org/mailman/listinfo/proj" target="_blank">http://lists.maptools.org/mailman/listinfo/proj</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>---------------------------------------+--------------------------------------<br>I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>and watch the world go round - Rush | Geospatial Software Developer<br>
</div>