thk686 / rgdal2 Goto Github PK
View Code? Open in Web Editor NEWR bindings to GDAL/OGR
Home Page: http://www.keittlab.org/
R bindings to GDAL/OGR
Home Page: http://www.keittlab.org/
When do you aim for the first CRAN version?
After adding the required NAMESPACE file for the package work, I get a compilation error when installing:
*** arch - i386
c:/Rtools/mingw_32/bin/g++ -I"C:/PROGRA~1/R/R-33~1.2/include" -DNDEBUG -I"C:/Users/glaroc/Documents/R/win-library/3.3/Rcpp/include" -I"d:/Compiler/gcc-4.9.3/local330/include" -O2 -Wall -mtune=core2 -c gdal_rcpp.cpp -o gdal_rcpp.o
gdal_rcpp.cpp:1:24: fatal error: pkg_config.h: No such file or directory
#include "pkg_config.h"
I have Rtools installed on Windows. Any idea what causes this?
If you open a layer that does not have geometry, like a DBF on its own the "as" coerce method to data frame results in an error:
f = system.file("example-data/continents", "continent.dbf", package = "rgdal2")
## ensure the DBF is on its own
dir.create("empty")
file.copy(f, file.path("empty", basename(f)))
l <- openOGRLayer(file.path("empty", basename(f)))
as(l, "data.frame")
#Error: Null pointer passed to function
#In addition: Warning messages:
#1: In RGDAL_GetGeometries(x@handle) :
# GDAL Error 10: Pointer 'hGeom' is NULL in 'OGR_G_Clone'.
# ...
This is because res[[geomfname]] = getGeometries(from)
in setAs('RGDAL2Layer', signature('data.frame'),
does no checks for the the absence of geometry.
Could getGeometries fail gracefully for non-geometry layers?
Cheers, Mike.
Hi,
i am not able to install rgdal2 according to the Readme.md. The installation fails with the error
ERROR: a 'NAMESPACE' file is required
Also, there seems to be a problem with roxygen2:
First time using roxygen2. Upgrading automatically...
Updating roxygen version in /tmp/RtmpmOP7q5/devtools4de8213c4e7d/thk686-rgdal2-451b53c/DESCRIPTION
Loading required package:
Failed with error: 'invalid package name'
The full sequence of commands and messages are attached below. I got similar results also when I tried the same with the Docker image rocker/geospatial
.
Can you please help? Thanks.
~$ R --vanilla
R version 3.3.2 (2016-10-31) -- "Sincere Pumpkin Patch"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R ist freie Software und kommt OHNE JEGLICHE GARANTIE.
Sie sind eingeladen, es unter bestimmten Bedingungen weiter zu verbreiten.
Tippen Sie 'license()' or 'licence()' für Details dazu.
R ist ein Gemeinschaftsprojekt mit vielen Beitragenden.
Tippen Sie 'contributors()' für mehr Information und 'citation()',
um zu erfahren, wie R oder R packages in Publikationen zitiert werden können.
Tippen Sie 'demo()' für einige Demos, 'help()' für on-line Hilfe, oder
'help.start()' für eine HTML Browserschnittstelle zur Hilfe.
Tippen Sie 'q()', um R zu verlassen.
> if (packageVersion("devtools") < 1.6) {
+ install.packages("devtools")
+ }
> devtools::install_github("thk686/rgdal2")
Downloading GitHub repo thk686/rgdal2@master
from URL https://api.github.com/repos/thk686/rgdal2/zipball/master
Installing rgdal2
'/usr/lib/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet \
CMD INSTALL '/tmp/RtmpmOP7q5/devtools4de8213c4e7d/thk686-rgdal2-451b53c' \
--library='/home/matthiashinz/R/x86_64-pc-linux-gnu-library/3.3' \
--install-tests
* installing *source* package ‘rgdal2’ ...
First time using roxygen2. Upgrading automatically...
Updating roxygen version in /tmp/RtmpmOP7q5/devtools4de8213c4e7d/thk686-rgdal2-451b53c/DESCRIPTION
Loading required package:
Failed with error: 'invalid package name'
Loading required package: Rcpp
Loading required package: grid
Loading required package: foreach
Loading required package: iterators
Loading required package: RColorBrewer
Loading required package: roxygen_devtest
Error in .requirePackage(package) :
unable to find required package 'roxygen_devtest'
Calls: <Anonymous> ... makeClassRepresentation -> makeExtends -> .requirePackage
In addition: Warning message:
In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE, :
there is no package called 'roxygen_devtest'
Execution halted
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking size of int... 4
checking size of double... 8
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating src/pkg_config.h
ERROR: a 'NAMESPACE' file is required
* removing ‘/home/matthiashinz/R/x86_64-pc-linux-gnu-library/3.3/rgdal2’
Fehler: Command failed (1)
> sessionInfo()
R version 3.3.2 (2016-10-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
locale:
[1] LC_CTYPE=de_DE.UTF-8 LC_NUMERIC=C
[3] LC_TIME=de_DE.UTF-8 LC_COLLATE=de_DE.UTF-8
[5] LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=de_DE.UTF-8
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] httr_1.2.1 R6_2.2.0 tools_3.3.2 withr_1.0.2
[5] curl_2.3 memoise_1.0.0 git2r_0.18.0 digest_0.6.12
[9] devtools_1.12.0
>
I get issues with read permissions on Debian if installed in /usr/local/lib, with
library(rgdal2)
f = system.file("example-data/continents", package = "rgdal2")
openOGRLayer(f, 1)
#ERROR 4: Unable to open /usr/local/lib/R/site-library/rgdal2/example-data/continents/continent.shp #/usr/local/lib/R/site-library/rgdal2/example-data/continents/continent.SHP.
#ERROR 4: Failed to open file /usr/local/lib/R/site-library/rgdal2/example-data/continents/continent.shp.
#It may be corrupt or read-only file accessed in update mode.
#INFO: Open of `/usr/local/lib/R/site-library/rgdal2/example-data/continents'
# using driver `ESRI Shapefile' successful.
#FAILURE: Couldn't fetch requested layer continent!
Is this expected for package files installed in the /usr/local/lib? (I wouldn't have thought so).
If I start R as super-user it works with no problem.
If I copy the file tree to local it also works for normal user:
file.copy(f, ".", recursive = TRUE)
openOGRLayer("continents", 1)
#INFO: Open of `continents'
# using driver `ESRI Shapefile' successful.
#Layer name: continent
#Geometry: Polygon
#Feature Count: 8
#Extent: (-180.000000, -90.000000) - (180.000000, 83.602203)
#Layer SRS WKT:
#GEOGCS["WGS 84",
# DATUM["WGS_1984",
# SPHEROID["WGS 84",6378137,298.257223563,
# AUTHORITY["EPSG","7030"]],
# AUTHORITY["EPSG","6326"]],
# PRIMEM["Greenwich",0,
# AUTHORITY["EPSG","8901"]],
# UNIT["degree",0.0174532925199433,
# AUTHORITY["EPSG","9122"]],
# AUTHORITY["EPSG","4326"]]
#CONTINENT: String (13.0)
It's no problem if I install as normal user to my user library.
(I get this either with thk686/rgdal2 or with @edzer fork at edzer/rgdal2)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.