[R-sig-Geo] OSX, rgdal, GDAL drivers and HDF4

Shaun Walbridge SWalbridge at esri.com
Tue Jun 2 19:56:39 CEST 2015


Have you tried with the homebrew project? HDF4 isn¹t a default supported
driver, but it¹s easy enough to add:

  brew install hdf4
  # prefer hdf4 links over NetCDF
  brew link --overwrite hdf4
  brew install gdal --complete --enable-unsupported --with-hdf4

  # check what drivers are installed, list should include Œhdf4¹:
  gdal-config --formats

I¹d use that as a starting point.

Cheers,
Shaun



On 6/2/15, 12:11 PM, "Ben Tupper" <btupper at bigelow.org> wrote:

>Hello,
>
>This is my attempt to look before I leap into installing GDAL on OSX.
>(You can probably hear my pitiful groaning and knee-knocking in the
>background.)
>
>I want to read many HDF4 files for which I do not have the GDAL HDF4
>driver installed.  I used William Kyngesburye's nice framework
>(http://www.kyngchaos.com/software:frameworks) to install GDAL but it
>came without the HDF4 driver.
>
>Reading this somewhat dated exchange...
>
>http://r-sig-geo.2731867.n2.nabble.com/Read-HDF-files-td6750856.html
>
>... I think I understand that if I want the HDF4 driver I must build GDAL
>on my system manually.  Is my understanding correct, or is there another
>(easier) way to read HDF4 files directly in R?
>
>Thanks!
>Ben
>
>
>> library(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:
>/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgdal/gdal
> Loaded PROJ.4 runtime: Rel. 4.9.1, 04 March 2015, [PJ_VERSION: 491]
> Path to PROJ.4 shared files:
>/Library/Frameworks/R.framework/Versions/3.2/Resources/library/rgdal/proj
> Linking to sp version: 1.1-0
>> x <- gdalDrivers()
>> any(x$name %in% c("HDF4", "HDF"))
>[1] FALSE
>
>> 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] 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] rgdal_0.9-3 sp_1.1-0
>
>loaded via a namespace (and not attached):
>[1] grid_3.2.0      lattice_0.20-31
>
>
>
>Ben Tupper
>Bigelow Laboratory for Ocean Sciences
>60 Bigelow Drive, P.O. Box 380
>East Boothbay, Maine 04544
>http://www.bigelow.org
>
>_______________________________________________
>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