Hello

I am trying to track down the source of an error that has crept up on me in
the last 3-4 months. I was suspicious the issues was related to the release
of GDAL 1.11 in April, but it has taken me a while to confirm.

Essentially, any time use readOGR(), writeOGR() or ogrInfo() on a GeoJSON
file, I get 'GDAL Error 3: Cannot open file'.

The following code reliably reproduces the error for me:

> library(rgdal)
>
> library(maptools)
> nc <- readShapePoly(system.file("shapes/sids.shp",package="maptools")[1],
proj4string=CRS("+proj=longlat +datum=NAD27"))
>
> writeOGR(nc, 'nc.geojson','nc', driver='GeoJSON')

I confirmed the "GeoJSON" drivers are installed and available with

> "GeoJSON" %in% ogrDrivers()$name
> [1] TRUE

and, I also confirmed that ogr2ogr can read/write GeoJSON outside of R, so
the issue seems to only impact rgdal.

My GDAL libraries are all built from Homebrew and then rgdal is built from
source against these libraries. I have the following versions:

> rgdal: version: 0.8-16, (SVN revision 498)
> GDAL 1.11.0, released 2014/04/16
> Path to GDAL shared files: /usr/local/Cellar/gdal/1.11.0/share/gdal
> PROJ.4 runtime: Rel. 4.8.0, 6 March 2012, [PJ_VERSION: 480]
> Path to PROJ.4 shared files: (autodetected)

As a final test, I installed rgdal via

> install.packages("rgdal",type="mac.binary")

With this version of the rgdal library, the code above works successfully.
The 'mac.binary' library appears to install with GDAL 1.9.2. So, I suspect
the issue is related to GDAL 1.11. I am fairly certain the code worked
without issue with GDAL 1.10, but I haven't had a chance to confirm this.

A search for issues related to GeoJSON, GDAL and rgdal has not turned up
any useful clues, so I am suspicious the issue may be isolated to my
machine/setup. That said, a colleague with a similar setup is able to
reproduce the issues.

Any assistance or guidance troubleshooting and resolving this issue would
be appreciated.

cheers
josh

> sessionInfo()
> R version 3.1.1 (2014-07-10)
> Platform: x86_64-apple-darwin13.1.0 (64-bit)
>
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats     graphics  grDevices utils     datasets  methods   base
>
> other attached packages:
> [1] maptools_0.8-30 rgdal_0.8-16    sp_1.0-15
>
> loaded via a namespace (and not attached):
> [1] foreign_0.8-61  grid_3.1.1      lattice_0.20-29 tools_3.1.1

-- 
*Josh M. London, PhDWildlife BiologistPolar Ecosystems ProgramAFSC National
Marine Mammal LaboratoryNOAA Fisheries, Seattle, Washington*

	[[alternative HTML version deleted]]

