-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 01/09/14, 19:43 , Jonathan Greenberg wrote:
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.
This sounds very useful. But to come back to the importing of rgdal,
which was causing my problem: As gdalUtils is quite useful without
rgdal, would it be possible to move rgdal to Enhances and to disable
the functions which require rgdal when rgdal is not installed?
And if rgdal is installed, to use the same gdal installation (I don't
know if this is the case already)?
Just a ciosmetic suggestion: it would be nice if, when loadu=ing the
package via library(gdalUtils), that the gdal version and path could
be printed.
Thanks,
Rainer
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:
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
-- 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