R Interface to GeoNode REST API – Allows to perform programmatically from R
geonode4R
is a new package to perform operations of the
GeoNode REST API. It supports CRUD operations (Create, Read, Update,
Delete) and search on GeoNode resources.
If you wish to sponsor geonode4R, do not hesitate to contact me
Many thanks to the following organizations that have provided
fundings for developing the geonode4R
package:
Table of contents
1. Overview
2. Package status
3. Credits
4. User guide
4.1 Installation
4.2 Connect to GeoNode REST API
4.3 Create a resource
4.4 Read a resource
4.5 Delete a resource
5. Issue reporting
Until now, equivalent tools were existing for other programming languages (e.g. Java, Python) but not in R. geonode4R intends to provide R native interface to the GeoNode REST API, in order to facilitate publication of geographic data resources from R to GeoNode.
A first version is being published to CRAN.
The package is at its early stage. It aims to be consolidated together with improvements made on the GeoNode API, and based on feedback of the user community.
Package distributed under MIT license.
If you use geonode4R
, i would be very grateful if you
can add a citation in your published work. By citing
geonode4R
, beyond acknowledging the work, you contribute to
make it more visible and guarantee its growing and sustainability. You
can get the preferred citation by running
citation("geonode4R)
in R.
For now, the package can be installed from Github
Once the devtools package loaded, you can use the install_github to
install geonode4R
By default, package will be installed
from master
which is the current version in development
(likely to be unstable).
The main entry point of geosapi
is the
`GeoNodeManager. To configure it, enter the following line, specifying the base
URL``
of your GeoNode, and your credentials:
geonode <- GeoNodeManager$new(
url = "http://localhost:8080/geonode", #baseUrl of the Geoserver
user = "admin", pwd = "password", #credentials
logger = NULL #logger, for info or debugging purpose
)
By default, the geonode4R
logger is
deactivated. To enable the logger, specify the level of log you wish as
parameter of the above R code. Two logging levels are available:
INFO
: will print the geonode4R
logs. Three
types of messages can be distinguished: INFO
,
WARN
, ERROR
. The latter is generally
associated with a stop
and indicate an blocking error for
the R method executed.DEBUG
will print the above geonode4R
logs,
and report all logs from HTTP requests performed with
cURL
The GeoNodeManager
inherits all methods of resource
dependent managers, to provide the users with a single R interface to
GeoNode REST API operations.
To upload a shapefile or another resource, list the resource files
(e.g. a list of ESRI Shapefiles), and use the upload
method
of the GeoNodeManager
.
To get a resource, you can get it based on a dataset identifier (‘pk’), or get it by UUID or alternate dataset. The below examples show how to perform these tasks.