aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/cran.scm
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2024-08-26 20:23:59 +0200
committerRicardo Wurmus <rekado@elephly.net>2024-08-26 20:31:17 +0200
commit6b10c8c3344dc7ac2067477629895b1970d541ca (patch)
treebe41c65f8f6a2ec8b94e265ec1cb7f969ad38d92 /gnu/packages/cran.scm
parenta33c8146d4e2794781f20e8278fb1afef7d3ef1a (diff)
downloadguix-6b10c8c3344dc7ac2067477629895b1970d541ca.tar
guix-6b10c8c3344dc7ac2067477629895b1970d541ca.tar.gz
gnu: Add r-rmapshaper.
* gnu/packages/cran.scm (r-rmapshaper): New variable. Change-Id: Iaef97544772fa75c143a2c68206e11a1533e385b
Diffstat (limited to 'gnu/packages/cran.scm')
-rw-r--r--gnu/packages/cran.scm51
1 files changed, 51 insertions, 0 deletions
diff --git a/gnu/packages/cran.scm b/gnu/packages/cran.scm
index da0b02a166..96d24b6516 100644
--- a/gnu/packages/cran.scm
+++ b/gnu/packages/cran.scm
@@ -8297,6 +8297,57 @@ installing the entire GSL.")
a variety of different samplers.")
(license license:expat)))
+(define-public r-rmapshaper
+ (package
+ (name "r-rmapshaper")
+ (version "0.5.0")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (cran-uri "rmapshaper" version))
+ (sha256
+ (base32 "01c1sd02ws3k2dmlj964c4j5jg93x192s3brhmaw4pi4qfjzc21x"))
+ (snippet
+ '(delete-file "inst/mapshaper/mapshaper-browserify.min.js"))))
+ (properties `((upstream-name . "rmapshaper")))
+ (build-system r-build-system)
+ (arguments
+ (list
+ #:modules
+ '((guix build r-build-system)
+ (guix build minify-build-system)
+ (guix build utils)
+ (ice-9 match))
+ #:imported-modules
+ `(,@%r-build-system-modules
+ (guix build minify-build-system))
+ #:phases
+ '(modify-phases (@ (guix build r-build-system) %standard-phases)
+ (add-after 'unpack 'process-javascript
+ (lambda* (#:key inputs #:allow-other-keys)
+ (with-directory-excursion "inst/"
+ (for-each (match-lambda
+ ((source . target)
+ (minify source #:target target)))
+ '(("mapshaper/mapshaper-browserify.js"
+ . "mapshaper/mapshaper-browserify.min.js")))))))))
+ (propagated-inputs (list r-geojsonsf
+ r-jsonify
+ r-readr
+ r-sf
+ r-sp
+ r-v8))
+ (native-inputs (list esbuild r-knitr))
+ (home-page "https://github.com/ateucher/rmapshaper")
+ (synopsis "Client for mapshaper for geospatial operations")
+ (description
+ "This package lets you edit and simplify @code{geojson}, @code{Spatial},
+and @code{sf} objects. This is a wrapper around the @code{mapshaper}
+JavaScript library to perform topologically-aware polygon simplification, as
+well as other operations such as clipping, erasing, dissolving, and converting
+multi-part to single-part geometries.")
+ (license license:expat)))
+
(define-public r-rmdfiltr
(package
(name "r-rmdfiltr")