[R-sig-Geo] gdalUtils 0.2.0 now on CRAN
Jonathan Greenberg
jgrn at illinois.edu
Thu Jan 9 19:43:20 CET 2014
Tim: thanks! We have something similar, where the package uses a
Sys.which() to see if gdalinfo is available in the PATH as one of its
attempts to find a valid install.
Rainer et al: I pushed version 0.2.3 to R-forge (you'll need to SVN it
until R-forge builds the new package later today/tomorrow) which now
supports a fixed search_path parameter. To use this:
gdal_setInstallation(search_path="/pathto/your/favorite/GDAL/",rescan=TRUE)
If it finds a valid gdalinfo in that path, it will use that one (thus
forcing gdalUtils to use a specific install). If it doesn't find it,
it will search as usual. Note that I updated the help for
gdal_setInstallation to better explain how gdalUtils searches for a
valid install.
Here's the R-forge site:
https://r-forge.r-project.org/projects/gdalutils/
--j
On Thu, Jan 9, 2014 at 12:10 PM, Tim Keitt <tkeitt at utexas.edu> wrote:
> You might also try "gdal-config --prefix". Of course that wont work if
> gdal-config not installed or in the path.
>
> THK
>
>
> On Thu, Jan 9, 2014 at 11:46 AM, Jonathan Greenberg <jgrn at illinois.edu>
> wrote:
>>
>> Rainer:
>>
>> Responses below!
>>
>> On Thu, Jan 9, 2014 at 2:28 AM, Rainer M Krug <Rainer at krugs.de> wrote:
>> > -----BEGIN PGP SIGNED MESSAGE-----
>> > Hash: SHA1
>> >
>> >
>> >
>>
>> >
>> > 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).
>>
>> Quick question: did you try restarting R AFTER you unlinked the
>> homebrew version? Here's why I ask: the first time you run ANY
>> gdalUtils in a session, what it does is spiders your system for
>> working GDAL installations (in fact, it looks for the frameworks
>> first). After this first time, it won't re-scan the drive unless you
>> do one of two things: 1) restart R and re-load GDALUtils, or 2) run
>> gdal_setInstallation(rescan=TRUE)
>>
>> > Question 1:
>> >
>> > Would it be possible, to include the gdal Frameworks in the search path?
>>
>> These are the common locations it searches for, before it attempts a
>> brute-force search of your whole drive:
>>
>> if (.Platform$OS=="unix")
>> {
>> common_locations <- c(
>> # UNIX systems
>> "/usr/bin",
>> "/usr/local/bin",
>> # Mac
>> # Kyngchaos frameworks:
>> "/Library/Frameworks/GDAL.framework/Programs",
>> # MacPorts:
>> "/opt/local/bin"
>> )
>> }
>> if (.Platform$OS=="windows")
>> {
>> common_locations <- c(
>> "C:\\Program Files",
>> "C:\\Program Files (x86)",
>> "C:\\OSGeo4W"
>> )
>> }
>>
>> I use those frameworks, and the function worked for me, but let me
>> know if it failed to find yours (perhaps I'll strip the /Programs from
>> the search path?) It is easy for me to add new search locations, so
>> if there are other common locations for ANY OS just let me know.
>>
>> >
>> > 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.
>>
>> Yes, we can add in this functionality at a future date. Right now,
>> you can check to see what your installs are by:
>> gdal_setInstallation(rescan=TRUE)
>> getOption("gdalUtils_gdalPath")
>>
>> In general, gdalUtils will use the first element of the
>> getOption("gdalUtils_gdalPath"), which is chosen by the most recent
>> version (by date).
>>
>> > 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?
>>
>> Yep, as I said either restart R or run:
>> gdal_setInstallation(rescan=TRUE)
>>
>> >
>> > 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-----
>>
>>
>>
>> --
>> Jonathan A. Greenberg, PhD
>> Assistant Professor
>> Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
>> Department of Geography and Geographic Information Science
>> University of Illinois at Urbana-Champaign
>> 259 Computing Applications Building, MC-150
>> 605 East Springfield Avenue
>> Champaign, IL 61820-6371
>> Phone: 217-300-1924
>> http://www.geog.illinois.edu/~jgrn/
>> AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>
>
>
> --
> http://www.keittlab.org/
--
Jonathan A. Greenberg, PhD
Assistant Professor
Global Environmental Analysis and Remote Sensing (GEARS) Laboratory
Department of Geography and Geographic Information Science
University of Illinois at Urbana-Champaign
259 Computing Applications Building, MC-150
605 East Springfield Avenue
Champaign, IL 61820-6371
Phone: 217-300-1924
http://www.geog.illinois.edu/~jgrn/
AIM: jgrn307, MSN: jgrn307 at hotmail.com, Gchat: jgrn307, Skype: jgrn3007
More information about the R-sig-Geo
mailing list