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

Rainer M Krug Rainer at krugs.de
Fri Jan 10 09:50:50 CET 2014


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



On 01/09/14, 22:13 , Jonathan Greenberg wrote:
> Ok, pushed a new version (0.2.4) to R-forge following these 
> suggestions (rgdal and raster are now moved to "Suggests", and the 
> examples should hopefully be updated to support it).

OK - It installs and loads with disfunctional rgdal (I assume the
worst case scenario).

I then linked gdal again, and it is using the homebrew version (which
is good).

But I get the following:

###################################
> str(getOption("gdalUtils_gdalPath"))
List of 2
 $ :List of 5
  ..$ path            : chr "/usr/local/bin/"
  ..$ version         :List of 1
  .. ..$ version: chr "1.10.1"
  ..$ date            :List of 1
  .. ..$ date: chr "2013-08-26"
.
.SNIP
.
$ :List of 5
  ..$ path            : chr
"/Library/Frameworks/GDAL.framework/Versions/1.10/Programs/"
  ..$ version         :List of 1
  .. ..$ version: chr "1.10.1"
  ..$ date            :List of 1
  .. ..$ date: chr "2013-08-26"
.
.SNIP
.
###################################

but I have 1.9 installed as well - is it on purpose that gdalUtils
does not find this version as it is older?

> 
> Rainer: would you mind testing this out?  Try it with and without 
> outputRaster=TRUE (it should fail on outputRaster=TRUE if you
> don't have rgdal installed).

Haven't worked with gdalUtils yet - could you tell me which command I
should try with the outputRaster argument?

Cheers,

Rainer

> 
> --j
> 
> On Thu, Jan 9, 2014 at 2:15 PM, Rainer M Krug <Rainer at krugs.de>
> wrote:
> 
> 
> 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
> 
> 
>>>> 
>>>> 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:
>>>> 
>>>> 
>>>>>>> 
>>>> 
>>>> 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
>>>>>>>>> 
>>>> 
>>>>>> 
>>>>>> 
>>>>>> 
>>>>>> -- 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/
>>>> 
>>>> 
>>>> 
> 
> 
> 
> 

- -- 
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/

iQEcBAEBAgAGBQJSz7RqAAoJENvXNx4PUvmCXVgH/0/sTGd62EFLyNV+3P0p8WuJ
nZJQrIOJtQqq8B5Ds7gXY5yvaWxbXqEPgqe1a7sldybrcux7c7srTbslV1aX0rAg
oZHaNvBYwdPfZZFM9JQfZn9XSa2kGYo9VMkLCcjCBo/Bdn4V3ITeoUpuuRqLpsZ5
bl85aR3mOCeKXpQII+1kqWZGgOg6BfnmGWriKy96U2Mi4DwHSpD2qXqr5wkevItZ
ADb8sTJvfmrsUHrzJyOMU2qO1G779Zy4/QrbT/9bQe5fJotw0Rv/pm0091ESxncE
sJZcis1HLauD+i1V74aZmDG8lDGisVaDOqkTtdzgjOUAIeKs7zEcd46UoAmzpOs=
=lofs
-----END PGP SIGNATURE-----



More information about the R-sig-Geo mailing list