[R-sig-Geo] gdalUtils 0.2.0 now on CRAN

Rainer M Krug Rainer at krugs.de
Thu Jan 9 09:28:08 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



On 01/08/14, 23:42 , Jonathan Greenberg wrote:
> I would like to announce a new R package "gdalUtils", now on CRAN. 
> gdalUtils is a set of R wrappers for most of the GDAL utility
> programs (http://gdal.org/gdal_utilities.html).  gdalUtils is a
> collaboration between Matteo Mattiuzzi and me.
> 
> gdalUtils requires an already-installed GDAL on your system: 
> http://trac.osgeo.org/gdal/wiki/DownloadingGdalBinaries
> 
> For Windows, I recommend installing QGIS Standalone 
> (http://www.qgis.org/en/site/forusers/download.html) which appears
> to have the most up-to-date binaries of GDAL for the Windows
> operating system including support for HDF4/5 files.
> 
> Note that this is NOT a replacement for Roger Bivand's fantastic
> rgdal package, it is a complementary package that simply provides
> R-wrappers for functions like gdalwarp, gdal_translate, ogr2ogr,
> etc.  We've tried to make the interface more R-like in terms of
> input parameters, and have provided some additional features such
> as (when relevant) returning outputs in Robert Hijman's raster
> format.  The parameter naming and the documentation follows GDAL,
> with permission from Frank Warmerdam (lead GDAL developer).
> 
> We have also provided some value-added functions such as 
> batch_gdal_translate and get_subdatasets (for extracting
> subdataset names from HDF4/5 and NetCDF files).
> 
> I will note the primary motivation for developing this package was 
> initially to provide (finally) HDF4/5 file support to Windows
> users (for Landsat and MODIS processing, among other things).
> However, many of the GDAL functions provide additional capabilities
> that R functions do not currently have, and they are quite a bit
> faster than most of their R equivalents (compare
> projectRaster_rigorous in my spatial.tools package to
> gdalwarp(...,method="mode") for an example).
> 
> When you first fire it up, it may take a bit to search for a valid 
> GDAL install on your computer.  If you have more than one (Windows 
> users may find this), it will use the latest version.  We tried to 
> make this system-agnostic, but let us know if you have any
> problems getting the functions to work.  The best way to test is: 
> library(gdalUtils) gdalinfo(version=TRUE) gdalinfo(formats=TRUE)

Very nice - haven't tried any working examples, but it installs on a
mac without problems and finds the gdal installation installed via
homebrew.

But I have some questions:

The automatic search is nice - but I unlinked gdal via homebrew, i.e.
the links to the binaries and libraries are not in the path anymore,
and I could not load gdalUtils anymore, as the gdalUtils did not find
the libraries anymore (understandable). But it seams, that gdalUtils
did not search for gdal, which is installed as a Framework as well.
Now I removed gdalUtils again and installed it again, with gdal still
unlinked, but it did not install as it did not find the gdal
libraries, despite gdal being available in a framework (see
http://www.kyngchaos.com/software/frameworks for the ones installed -
they are quite popular, and required, among GRASS and QGIS users on Mac).

Question 1:

Would it be possible, to include the gdal Frameworks in the search path?

At the end is a layout of the directory structure of the gdal frameworks.

Question 2:

Is it (or would it) be possible to manually set the installation of
gdal to be used? This would make comparison of versions of gdal as
well as reproducible research much easier.

Question 3:

I can't test it right now, but I assume that gdalUtils does search for
a new gdal installation if it can't find the one used before? Is there
a way of initiating the search (and selection) if a newer version has
been installed?

Thanks for a very neat package,

Rainer

Directory structure of the GDAL.Framework on a MAC:

/Library/Frameworks/GDAL.framework/
├── Headers -> Versions/Current/Headers
├── Programs -> Versions/Current/Programs
├── Resources -> Versions/Current/Resources
├── Versions
│   ├── 1.10
│   │   ├── Headers
│   │   ├── Libraries
│   │   │   └── ogdi
│   │   ├── PlugIns
│   │   ├── Programs
│   │   ├── Python
│   │   │   ├── 2.6
│   │   │   │   └── site-packages
│   │   │   │       └── osgeo
│   │   │   └── 2.7
│   │   │       └── site-packages
│   │   │           └── osgeo
│   │   ├── Resources
│   │   │   ├── doc
│   │   │   │   └── gdal
│   │   │   │       ├── java
│   │   │   │       │   ├── org
│   │   │   │       │   │   └── gdal
│   │   │   │       │   │       ├── gdal
│   │   │   │       │   │       ├── gdalconst
│   │   │   │       │   │       ├── ogr
│   │   │   │       │   │       └── osr
│   │   │   │       │   └── resources
│   │   │   │       └── ogr
│   │   │   └── gdal
│   │   └── unix
│   │       ├── bin
│   │       ├── include -> ../Headers
│   │       └── lib
│   ├── 1.9
│   │   ├── Headers
│   │   ├── Libraries
│   │   │   └── ogdi
│   │   ├── PlugIns
│   │   ├── Programs
│   │   ├── Python
│   │   │   ├── 2.6
│   │   │   │   └── site-packages
│   │   │   │       └── osgeo
│   │   │   └── 2.7
│   │   │       └── site-packages
│   │   │           └── osgeo
│   │   ├── Resources
│   │   │   ├── doc
│   │   │   │   └── gdal
│   │   │   │       ├── java
│   │   │   │       │   ├── org
│   │   │   │       │   │   └── gdal
│   │   │   │       │   │       ├── gdal
│   │   │   │       │   │       ├── gdalconst
│   │   │   │       │   │       ├── ogr
│   │   │   │       │   │       └── osr
│   │   │   │       │   └── resources
│   │   │   │       └── ogr
│   │   │   └── gdal
│   │   └── unix
│   │       ├── bin
│   │       ├── include -> ../Headers
│   │       └── lib
│   └── Current -> 1.10
└── unix -> Versions/Current/unix


> 
> Cheers!
> 
> --j
> 

- -- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Stellenbosch University
South Africa

Tel :       +33 - (0)9 53 10 27 44
Cell:       +33 - (0)6 85 62 59 98
Fax :       +33 - (0)9 58 10 27 44

Fax (D):    +49 - (0)3 21 21 25 22 44

email:      Rainer at krugs.de

Skype:      RMkrug
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.22 (Darwin)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJSzl2YAAoJENvXNx4PUvmCp6sH/3KD9/vKJlBms+OOuRbD2MjS
6PmSXT4e0J2MpUDQbm3xBDMFNPa7EtlWMeYHvAQHdKfRF87/n6ZTcW0wIxIhmIcC
/3q0lx/yipjXScR2EerMyX3B1bVCRNHFgi5BjNnDUrX6lfNm4DD8HqV6Rn5AxJZE
NkSZ+mQPJ7UgqV9awNtd2QlK+qyjq7TeFrprNrKuoXZ8ALJjZSXn70WDh7jARvP6
zD/rjHFB83Kk61+A0TRBeWfXWtVy1CJZCR0cCXoofBNjT8kYu2EUsWtYqj6EmKBX
1ThW6/yTst9t1cs+j6kDhBG3c+rJ14mx5nkOUXRzCk6wfu/bdGMGoVbEPjW4PII=
=kSdZ
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list