projects/guix·blob java-team · refs

4641 lines · 179.6 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Leo Famulari <[email protected]>
3;;; Copyright © 2016 Alex Griffin <[email protected]>
4;;; Copyright © 2017, 2018 Björn Höfling <[email protected]>
5;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <[email protected]>
6;;; Copyright © 2018, 2023-2025 Ricardo Wurmus <[email protected]>
7;;; Copyright © 2018, 2019, 2026 Arun Isaac <[email protected]>
8;;; Copyright © 2018 Joshua Sierles, Nextjournal <[email protected]>
9;;; Copyright © 2018, 2019, 2020, 2021 Julien Lepiller <[email protected]>
10;;; Copyright © 2019-2023, 2025 Guillaume Le Vaillant <[email protected]>
11;;; Copyright © 2019-2023 Efraim Flashner <[email protected]>
12;;; Copyright © 2019, 2021 Wiktor Żelazny <[email protected]>
13;;; Copyright © 2019, 2020 Hartmut Goebel <[email protected]>
14;;; Copyright © 2020, 2022 Marius Bakke <[email protected]>
15;;; Copyright © 2020 Christopher Baines <[email protected]>
16;;; Copyright © 2020–2024 Felix Gruber <[email protected]>
17;;; Copyright © 2021, 2023-2025 Sharlatan Hellseher <[email protected]>
18;;; Copyright © 2021, 2023, 2024, 2025 Vinicius Monego <[email protected]>
19;;; Copyright © 2021 Clément Lassieur <[email protected]>
20;;; Copyright © 2021, 2022 Nikolay Korotkiy <[email protected]>
21;;; Copyright © 2022 Patrick Noll <[email protected]>
22;;; Copyright © 2022 Roman Scherer <[email protected]>
23;;; Copyright © 2022-2023, 2026 Maxim Cournoyer <[email protected]>
24;;; Copyright © 2022 Denis 'GNUtoo' Carikli <[email protected]>
25;;; Copyright © 2024 Wilko Meyer <[email protected]>
26;;; Copyright © 2024 Jonathan Brielmaier <[email protected]>
27;;; Copyright © 2025, 2026 Mattia Bunel <[email protected]>
28;;; Copyright © 2025 Andreas Enge <[email protected]>
29;;; Copyright © 2025 Lars Bilke <[email protected]>
30;;; Copyright © 2025 Nicolas Graves <[email protected]>
31;;; Copyright © 2025 Nguyễn Gia Phong <[email protected]>
32;;; Copyright © 2025 Brice Waegeneire <[email protected]>
33;;;
34;;; This file is part of GNU Guix.
35;;;
36;;; GNU Guix is free software; you can redistribute it and/or modify it
37;;; under the terms of the GNU General Public License as published by
38;;; the Free Software Foundation; either version 3 of the License, or (at
39;;; your option) any later version.
40;;;
41;;; GNU Guix is distributed in the hope that it will be useful, but
42;;; WITHOUT ANY WARRANTY; without even the implied warranty of
43;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44;;; GNU General Public License for more details.
45;;;
46;;; You should have received a copy of the GNU General Public License
47;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
48
49(define-module (gnu packages geo)
50 #:use-module ((guix licenses) #:prefix license:)
51 #:use-module (guix build-system ant)
52 #:use-module (guix build-system cmake)
53 #:use-module (guix build-system glib-or-gtk)
54 #:use-module (guix build-system gnu)
55 #:use-module (guix build-system go)
56 #:use-module (guix build-system meson)
57 #:use-module (guix build-system pyproject)
58 #:use-module (guix build-system qt)
59 #:use-module (guix build-system r)
60 #:use-module (guix build-system zig)
61 #:use-module (guix download)
62 #:use-module (guix gexp)
63 #:use-module (guix git-download)
64 #:use-module (guix packages)
65 #:use-module (guix svn-download)
66 #:use-module (guix utils)
67 #:use-module (gnu packages)
68 #:use-module (gnu packages algebra)
69 #:use-module (gnu packages astronomy)
70 #:use-module (gnu packages audio)
71 #:use-module (gnu packages autotools)
72 #:use-module (gnu packages backup)
73 #:use-module (gnu packages base)
74 #:use-module (gnu packages bash)
75 #:use-module (gnu packages bison)
76 #:use-module (gnu packages boost)
77 #:use-module (gnu packages build-tools)
78 #:use-module (gnu packages busybox)
79 #:use-module (gnu packages c)
80 #:use-module (gnu packages nss)
81 #:use-module (gnu packages check)
82 #:use-module (gnu packages cmake)
83 #:use-module (gnu packages compression)
84 #:use-module (gnu packages cpp)
85 #:use-module (gnu packages cups)
86 #:use-module (gnu packages curl)
87 #:use-module (gnu packages cran)
88 #:use-module (gnu packages databases)
89 #:use-module (gnu packages datastructures)
90 #:use-module (gnu packages digest)
91 #:use-module (gnu packages docbook)
92 #:use-module (gnu packages documentation)
93 #:use-module (gnu packages elf)
94 #:use-module (gnu packages compiler-tools)
95 #:use-module (gnu packages fonts)
96 #:use-module (gnu packages fontutils)
97 #:use-module (gnu packages freedesktop)
98 #:use-module (gnu packages fribidi)
99 #:use-module (gnu packages gcc)
100 #:use-module (gnu packages gettext)
101 #:use-module (gnu packages ghostscript)
102 #:use-module (gnu packages gl)
103 #:use-module (gnu packages glib)
104 #:use-module (gnu packages gnome)
105 #:use-module (gnu packages golang-build)
106 #:use-module (gnu packages golang-check)
107 #:use-module (gnu packages golang-web)
108 #:use-module (gnu packages golang-xyz)
109 #:use-module (gnu packages gps)
110 #:use-module (gnu packages graphics)
111 #:use-module (gnu packages graphviz)
112 #:use-module (gnu packages gtk)
113 #:use-module (gnu packages haskell-apps)
114 #:use-module (gnu packages haskell-xyz)
115 #:use-module (gnu packages icu4c)
116 #:use-module (gnu packages image)
117 #:use-module (gnu packages image-processing)
118 #:use-module (gnu packages imagemagick)
119 #:use-module (gnu packages java)
120 #:use-module (gnu packages kde-frameworks)
121 #:use-module (gnu packages libunwind)
122 #:use-module (gnu packages libusb)
123 #:use-module (gnu packages linux)
124 #:use-module (gnu packages logging)
125 #:use-module (gnu packages lua)
126 #:use-module (gnu packages machine-learning)
127 #:use-module (gnu packages maths)
128 #:use-module (gnu packages mpi)
129 #:use-module (gnu packages multiprecision)
130 #:use-module (gnu packages ncurses)
131 #:use-module (gnu packages pcre)
132 #:use-module (gnu packages pdf)
133 #:use-module (gnu packages perl)
134 #:use-module (gnu packages photo)
135 #:use-module (gnu packages pkg-config)
136 #:use-module (gnu packages pretty-print)
137 #:use-module (gnu packages prometheus)
138 #:use-module (gnu packages protobuf)
139 #:use-module (gnu packages pulseaudio)
140 #:use-module (gnu packages python)
141 #:use-module (gnu packages python-build)
142 #:use-module (gnu packages python-check)
143 #:use-module (gnu packages python-crypto)
144 #:use-module (gnu packages python-science)
145 #:use-module (gnu packages python-web)
146 #:use-module (gnu packages python-xyz)
147 #:use-module (gnu packages qt)
148 #:use-module (gnu packages readline)
149 #:use-module (gnu packages sdl)
150 #:use-module (gnu packages specifications)
151 #:use-module (gnu packages speech)
152 #:use-module (gnu packages sqlite)
153 #:use-module (gnu packages statistics)
154 #:use-module (gnu packages swig)
155 #:use-module (gnu packages textutils)
156 #:use-module (gnu packages time)
157 #:use-module (gnu packages tls)
158 #:use-module (gnu packages version-control)
159 #:use-module (gnu packages video)
160 #:use-module (gnu packages web)
161 #:use-module (gnu packages webkit)
162 #:use-module (gnu packages wget)
163 #:use-module (gnu packages wxwidgets)
164 #:use-module (gnu packages xml)
165 #:use-module (gnu packages xorg)
166 #:use-module (gnu packages zig))
167
168(define-public gmt
169 (package
170 (name "gmt")
171 (version "6.6.0")
172 (source
173 (origin
174 (method url-fetch)
175 (uri (string-append "https://github.com/GenericMappingTools/gmt/"
176 "releases/download/"
177 version "/gmt-" version "-src.tar.xz"))
178 (sha256
179 (base32 "10hhpp6qwbhyk4xgd7xs1xw2d51fq22q64z57i329jcg3fqrib0q"))))
180 (build-system cmake-build-system)
181 (arguments (list #:tests? #false)) ;tests need costline data and caches
182 (inputs
183 (list curl ffmpeg fftw gdal geos ghostscript netcdf openblas pcre2))
184 (native-inputs
185 (list graphicsmagick pkg-config))
186 (home-page "https://www.generic-mapping-tools.org/")
187 (synopsis "Generic mapping tools")
188 (description "GMT is a collection of about 100 command-line tools for
189manipulating geographic and Cartesian data sets (including filtering, trend
190fitting, gridding, projecting, etc.) and producing high-quality illustrations
191ranging from simple x-y plots via contour maps to artificially illuminated
192surfaces, 3D perspective views and animations. The GMT supplements add
193another 50 more specialized and discipline-specific tools. GMT supports over
19430 map projections and transformations and requires support data such as GSHHG
195coastlines, rivers, and political boundaries and optionally DCW country
196polygons.")
197 (license license:lgpl3+)))
198
199(define-public libaec
200 (package
201 (name "libaec")
202 (version "1.0.6")
203 (source
204 (origin
205 (method git-fetch)
206 (uri (git-reference
207 (url "https://gitlab.dkrz.de/k202009/libaec")
208 (commit (string-append "v" version))))
209 (file-name (git-file-name name version))
210 (sha256
211 (base32 "14myrmmiz9z6wgxqywf3a63cq514vrzsd6z4zvpwigvawlk30iip"))))
212 (build-system cmake-build-system)
213 (home-page "https://gitlab.dkrz.de/k202009/libaec")
214 (synopsis "Adaptive Entropy Coding library")
215 (description "Libaec provides fast lossless compression of 1 up to 32 bit
216wide signed or unsigned integers (samples). The library achieves best results
217for low entropy data as often encountered in space imaging instrument data or
218numerical model output from weather or climate simulations. While floating
219point representations are not directly supported, they can also be efficiently
220coded by grouping exponents and mantissa.")
221 (license license:bsd-2)))
222
223(define-public eccodes
224 (package
225 (name "eccodes")
226 (version "2.27.0")
227 (source
228 (origin
229 (method url-fetch)
230 (uri (string-append
231 "https://confluence.ecmwf.int/download/attachments/45757960/"
232 "eccodes-" version "-Source.tar.gz"))
233 (sha256
234 (base32 "16cw4v2d0kjq6gq04paqny0sh5jymn70w449mig7m5h3spzv7rgd"))))
235 (build-system cmake-build-system)
236 (arguments
237 `(#:configure-flags '("-DENABLE_MEMFS=ON" "-DENABLE_PNG=ON")
238 #:validate-runpath? #f))
239 (inputs
240 (list jasper libaec libjpeg-turbo libpng netcdf openjpeg))
241 (native-inputs
242 (list gfortran perl pkg-config python))
243 (home-page "https://confluence.ecmwf.int/display/ECC")
244 (synopsis "Library for handling the GRIB, BUFR and GTS file formats")
245 (description "ecCodes is a package developed by @acronym{ECMWF, European
246Centre for Medium-Range Weather Forecasts} which provides an application
247programming interface and a set of tools for decoding and encoding messages in
248the @acronym{WMO, World Meteorological Organization} FM-92 GRIB, WMO FM-94
249BUFR and WMO GTS abbreviated header formats.")
250 (license license:asl2.0)))
251
252(define-public cdo
253 (package
254 (name "cdo")
255 (version "2.5.1")
256 (source
257 (origin
258 (method url-fetch)
259 (uri (string-append
260 "https://code.mpimet.mpg.de/attachments/download/29864/cdo-"
261 version ".tar.gz"))
262 (sha256
263 (base32 "1lapakdapccian650ifkwwasgkqr2k9m1qf8qd3ybgschqggk2s1"))))
264 (build-system gnu-build-system)
265 (arguments
266 (list #:configure-flags
267 #~(list (string-append "--with-curl="
268 #$(this-package-input "curl"))
269 (string-append "--with-eccodes="
270 #$(this-package-input "eccodes"))
271 (string-append "--with-fftw3="
272 #$(this-package-input "fftw"))
273 (string-append "--with-hdf5="
274 #$(this-package-input "hdf5"))
275 (string-append "--with-netcdf="
276 #$(this-package-input "netcdf"))
277 (string-append "--with-proj="
278 #$(this-package-input "proj"))
279 (string-append "--with-udunits2="
280 #$(this-package-input "udunits"))
281 (string-append "--with-libxml2="
282 #$(this-package-input "libxml2")))
283 ;; Some tests can fail on machines with many threads.
284 #:parallel-tests? #f))
285 (inputs
286 (list curl eccodes fftw hdf5 libaec libxml2 netcdf proj udunits))
287 (native-inputs
288 (list pkg-config python-wrapper))
289 (home-page "https://code.mpimet.mpg.de/projects/cdo")
290 (synopsis "Climate data operators")
291 (description "@acronym{CDO, Climate Data Operators} is a collection of command-line
292operators to manipulate and analyse climate and NWP model data. Supported
293data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG. There are more
294than 600 operators available.")
295 (license license:bsd-3)))
296
297(define-public h3
298 (package
299 (name "h3")
300 (version "4.4.1")
301 (source
302 (origin
303 (method git-fetch)
304 (uri (git-reference
305 (url "https://github.com/uber/h3")
306 (commit (string-append "v" version))))
307 (file-name (git-file-name name version))
308 (sha256
309 (base32 "1ijnbr4a54ph7bkn8waqwgnxmxlylv9yly9mwjdj69lkmdfjgaml"))))
310 (build-system cmake-build-system)
311 (arguments
312 (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
313 (home-page "https://h3geo.org/")
314 (synopsis "Hexagonal hierarchical geospatial indexing system")
315 (description "H3 is a geospatial indexing system using a hexagonal grid
316that can be (approximately) subdivided into finer and finer hexagonal grids,
317combining the benefits of a hexagonal grid with S2's hierarchical
318subdivisions.")
319 (license license:asl2.0)))
320
321(define-public python-h3
322 (package
323 (name "python-h3")
324 (version "4.4.2")
325 (source
326 (origin
327 (method git-fetch)
328 (uri (git-reference
329 (url "https://github.com/uber/h3-py")
330 (commit (string-append "v" version))))
331 (file-name (git-file-name name version))
332 (sha256
333 (base32 "02gry51hn8x2bl80y1ipcyrg0ghcif4vjch26qil215wdzz1yrzv"))
334 (modules '((guix build utils)))
335 ;; Remove bundled H3 lib.
336 (snippet #~(begin (delete-file-recursively "src/h3lib")))))
337 (build-system pyproject-build-system)
338 (arguments
339 (list
340 #:phases
341 #~(modify-phases %standard-phases
342 ;; Use packaged in Guix h3 source.
343 (add-after 'unpack 'patch-cmakelists
344 (lambda _
345 (substitute* "CMakeLists.txt"
346 (("add_subdirectory\\(src/h3lib\\)")
347 (string-append
348 "include_directories(" #$(this-package-input "h3")
349 "/include/h3)\n"
350 "link_directories(" #$(this-package-input "h3")
351 "/lib)\n"))
352 ((".*CMAKE_CURRENT_BINARY_DIR.*")
353 (string-append #$(this-package-input "h3")
354 "/include/h3/h3api.h\n"))))))))
355 (native-inputs
356 (list cmake-minimal
357 python-cython
358 python-numpy
359 python-pytest
360 python-scikit-build-core))
361 (inputs (list h3))
362 (home-page "https://uber.github.io/h3-py")
363 (synopsis "Python bindings for H3")
364 (description "This package provides a Python bindings for H3, a
365hierarchical hexagonal geospatial indexing system")
366 (license license:asl2.0)))
367
368(define-public geos
369 (package
370 (name "geos")
371 (version "3.12.1")
372 (source (origin
373 (method url-fetch)
374 (uri (string-append "http://download.osgeo.org/geos/geos-"
375 version
376 ".tar.bz2"))
377 (sha256
378 (base32
379 "00qdk9a4048pzfj2rhzkfw3lvm642znf6kr4x29i3d94494pxsnn"))))
380 (build-system cmake-build-system)
381 (arguments
382 `(#:phases
383 (modify-phases %standard-phases
384 ,@(if (or (target-x86-32?) (target-arm32?))
385 '((add-after 'unpack 'disable-broken-tests
386 (lambda _
387 ;; This test fails due to limited accuracy.
388 (delete-file "tests/xmltester/tests/general/TestCentroid.xml")
389 (with-directory-excursion "tests/unit"
390 ;; These also fail due to limited accuracy.
391 (delete-file "algorithm/MinimumAreaRectangleTest.cpp")
392 (delete-file "capi/GEOSMinimumRotatedRectangleTest.cpp")
393 ;; It is unclear why these fail, but I'm guessing:
394 ;; limited accuracy.
395 (delete-file "linearref/LengthIndexedLineTest.cpp")
396 (delete-file "math/DDTest.cpp")))))
397 '())
398 (add-after
399 'unpack 'patch-test-shebangs
400 (lambda _
401 (substitute* '("tests/xmltester/testrunner.sh"
402 "tests/xmltester/safe_to_xml.sh")
403 (("/bin/sh") (which "sh"))))))))
404 (inputs
405 (list glib))
406 (home-page "https://libgeos.org/")
407 (synopsis "Geometry Engine for Geographic Information Systems")
408 (description
409 "GEOS provides a spatial object model and fundamental geometric
410functions. It is a C++ port of the Java Topology Suite (JTS). As such,
411it aims to contain the complete functionality of JTS in C++. This
412includes all the OpenGIS Simple Features for SQL spatial predicate
413functions and spatial operators, as well as specific JTS enhanced
414topology functions.")
415 (license (list license:lgpl2.1+ ; Main distribution.
416 license:zlib ; tests/xmltester/tinyxml/*
417 license:public-domain)))) ; include/geos/timeval.h
418
419(define-public gnome-maps
420 (package
421 (name "gnome-maps")
422 (version "50.0")
423 (source (origin
424 (method url-fetch)
425 (uri (string-append "mirror://gnome/sources/" name "/"
426 (version-major version) "/"
427 name "-" version ".tar.xz"))
428 (sha256
429 (base32
430 "0vins6a8ca6qdy4v5q97bw3hcq0mljr3my5hjfkliw1cpldf0rha"))))
431 (build-system meson-build-system)
432 (arguments
433 (list
434 #:glib-or-gtk? #t
435 #:phases
436 #~(modify-phases %standard-phases
437 (add-after 'unpack 'skip-cache-and-database-updates
438 (lambda _
439 (substitute* "meson.build"
440 (("([a-z_]*): true" all option)
441 (cond ; cond rather than match saves an import
442 ((member option '("gtk_update_icon_cache"
443 "update_desktop_database"))
444 (string-append option ": false"))
445 (else all))))))
446 (add-after 'install 'wrap
447 (lambda _
448 (wrap-program (string-append #$output "/bin/gnome-maps")
449 `("GI_TYPELIB_PATH" ":" prefix
450 (,(getenv "GI_TYPELIB_PATH"))))))
451 (delete 'check) ;moved after install
452 (add-after 'wrap 'check
453 (lambda* (#:key native-inputs inputs #:allow-other-keys #:rest args)
454 ;; for timeTest
455 (setenv "TZDIR"
456 (search-input-directory (or native-inputs inputs)
457 "share/zoneinfo"))
458 ;; This workaround is made necessary by a custom patch to our
459 ;; gobject-introspection package that causes it to always use
460 ;; absolute paths for the shared objects referenced by the
461 ;; typelibs.
462 (let* ((src (string-append #$output
463 "/lib/gnome-maps/libgnome-maps.so.0"))
464 (dest (string-append #$output "/lib/libgnome-maps.so.0")))
465 (symlink src dest)
466 (apply (assoc-ref %standard-phases 'check) args)
467 (delete-file dest)))))))
468 (native-inputs
469 (list blueprint-compiler
470 gettext-minimal
471 `(,glib "bin")
472 gobject-introspection
473 (libc-utf8-locales-for-target)
474 libportal
475 pkg-config
476 tzdata-for-tests))
477 (inputs
478 (list bash-minimal
479 folks
480 evolution-data-server
481 geoclue
482 geocode-glib
483 gjs
484 glib
485 glib-networking
486 gnome-online-accounts
487 gsettings-desktop-schemas
488 gtk
489 libadwaita
490 libgee
491 libgweather
492 librest
493 librsvg
494 libsecret
495 libshumate
496 libsoup
497 libxml2
498 webkitgtk))
499 (synopsis "Graphical map viewer and wayfinding program")
500 (description "GNOME Maps is a graphical map viewer. It uses map data from
501the OpenStreetMap project. It can provide directions for walking, bicycling,
502and driving.")
503 (home-page "https://wiki.gnome.org/Apps/Maps")
504 (license license:gpl2+)))
505
506(define-public libgeotiff
507 (package
508 (name "libgeotiff")
509 (version "1.7.1")
510 (source
511 (origin
512 (method url-fetch)
513 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
514 version ".tar.gz"))
515 (patches
516 (search-patches "libgeotiff-fix-tests-with-proj-9.1.1.patch"
517 "libgeotiff-fix-tests-with-proj-9.3.0.patch"
518 "libgeotiff-fix-tests-with-proj-9.3.1.patch"
519 "libgeotiff-fix-tests-on-i386.patch"))
520 (sha256
521 (base32 "1mjmgv48x51ppax5dnb6lq7z600czxll53bx6jbzqwd4m93i7aq5"))
522 (modules '((guix build utils)))
523 (snippet
524 '(begin
525 ;; Remove .csv files, distributed from EPSG under a restricted
526 ;; license. See LICENSE for full license text.
527 (for-each delete-file (find-files "." "\\.csv$"))
528 #t))))
529 (build-system gnu-build-system)
530 (inputs
531 (list libjpeg-turbo libtiff zlib))
532 (propagated-inputs
533 (list ;; libgeotiff headers include proj headers, so ensure those are available.
534 proj))
535 (arguments
536 `(#:configure-flags
537 (list "--disable-static"
538 "--with-zlib" "--with-jpeg"
539 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
540 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
541 (description "libgeotiff is a library on top of libtiff for reading and
542writing GeoTIFF information tags.")
543 (home-page "https://trac.osgeo.org/geotiff/")
544 ;; This is a mixture of various contributions under different licenses.
545 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
546 ;; states, as its commercial redistribution is restricted. Hence, we have
547 ;; removed it from the package.
548 (license (list license:public-domain
549 license:x11
550 license:bsd-3
551 (license:non-copyleft "file://LICENSE"
552 "See LICENSE in the distribution.")))))
553
554(define-public mepo
555 (package
556 (name "mepo")
557 (version "1.3.4")
558 (source
559 (origin
560 (method git-fetch)
561 (uri (git-reference
562 (url "https://git.sr.ht/~mil/mepo")
563 (commit version)))
564 (file-name (git-file-name name version))
565 (sha256
566 (base32 "0cz4ihz4mw1v47x3xycyayfs28xlns2war2dif31awzg02a3rlfl"))))
567 (build-system zig-build-system)
568 (arguments
569 (list #:install-source? #f
570 #:zig zig-0.14
571 #:zig-release-type "safe"
572 #:phases
573 #~(modify-phases %standard-phases
574 (add-after 'unpack 'patch-geoclue-demos-path
575 (lambda* (#:key inputs #:allow-other-keys)
576 (substitute* "scripts/mepo_ui_menu_user_pin_updater.sh"
577 (("/usr/libexec/geoclue-2.0/demos/agent")
578 (search-input-file
579 inputs
580 "libexec/geoclue-2.0/demos/agent"))
581 (("/usr/libexec/geoclue-2.0/demos/where-am-i")
582 (search-input-file
583 inputs
584 "libexec/geoclue-2.0/demos/where-am-i")))))
585 (add-after 'install 'wrap-scripts
586 (lambda* (#:key inputs #:allow-other-keys)
587 (let ((bin-dirs
588 (map (lambda (bin)
589 (dirname (search-input-file inputs bin)))
590 '("bin/column" ;util-linux
591 "bin/gpspipe" ;gpsd
592 "bin/jq"
593 "bin/xargs" ;busybox
594 "bin/xwininfo"
595 "bin/zenity"))))
596 (for-each (lambda (script)
597 (wrap-program
598 (string-append #$output "/bin/" script)
599 `("PATH" ":" prefix ,bin-dirs)))
600 '("mepo_dl.sh"
601 "mepo_generated_osmtags.sh"
602 "mepo_geojson_import.sh"
603 "mepo_ui_central_menu.sh"
604 "mepo_ui_helper_menu.sh"
605 "mepo_ui_helper_pref_pan.sh"
606 "mepo_ui_menu_dbg_queueclear.sh"
607 "mepo_ui_menu_dbg_queuedownloadinteractive.sh"
608 "mepo_ui_menu_dbg_queuedownloadnoninteractive.sh"
609 "mepo_ui_menu_pin_drop.sh"
610 "mepo_ui_menu_pref_fontsize.sh"
611 "mepo_ui_menu_pref_network.sh"
612 "mepo_ui_menu_pref_stateload.sh"
613 "mepo_ui_menu_pref_statesave.sh"
614 "mepo_ui_menu_pref_url.sh"
615 "mepo_ui_menu_pref_zoom.sh"
616 "mepo_ui_menu_reposition_nominatim.sh"
617 "mepo_ui_menu_route_graphhopper.sh"
618 "mepo_ui_menu_route_mobroute.sh"
619 "mepo_ui_menu_search_nominatim.sh"
620 "mepo_ui_menu_search_overpass.sh"
621 "mepo_ui_menu_user_pin_updater.sh"))))))))
622 (native-inputs (list pkg-config))
623 ;; TODO: package Mobroute
624 (inputs (list bash-minimal busybox curl geoclue gpsd jq ncurses
625 sdl2 sdl2-gfx sdl2-image sdl2-ttf
626 util-linux xwininfo zenity))
627 (home-page "https://mepo.lrdu.org")
628 (synopsis "OpenStreetMap map viewer")
629 (description
630 "Mepo is a fast, simple, and hackable OSM map viewer for desktop and
631mobile Linux devices. It supports Wayland and X Windows.
632
633Mepo works both offline and online, features a minimalist both touch/mouse
634and keyboard compatible interface, and offers a simple and powerful JSON API
635to allow the user to change and add functionality such as adding their own
636search and routing scripts, adding arbitrary buttons/keybindings to the UI,
637and more.")
638 (license license:gpl3+)))
639
640(define-public librasterlite2
641 (package
642 (name "librasterlite2")
643 (version "1.1.0-beta1")
644 (source
645 (origin
646 (method url-fetch)
647 (uri (string-append
648 "https://www.gaia-gis.it/gaia-sins/librasterlite2-sources/"
649 "librasterlite2-" version ".tar.gz"))
650 (sha256
651 (base32
652 "1x24gqp4hsq97c31ncwxblab0x0863q8v1z42jil7lvsq3glqa7p"))))
653 (build-system gnu-build-system)
654 (native-inputs
655 (list pkg-config))
656 (inputs
657 (list cairo
658 curl
659 freetype
660 freexl
661 giflib
662 libgeotiff
663 libjpeg-turbo
664 libpng
665 librttopo
666 libspatialite
667 libtiff
668 libwebp
669 libxml2
670 lz4
671 minizip
672 openjpeg
673 proj
674 sqlite
675 `(,zstd "lib")))
676 (synopsis "Library to work with huge raster coverages using a SpatiaLite")
677 (description
678 "librasterlite2 is a library that stores and retrieves huge raster
679coverages using a SpatiaLite DBMS.")
680 (home-page "https://www.gaia-gis.it/fossil/librasterlite2/index")
681 ;; For the genuine librasterlite-sources holds:
682 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
683 ;; Files under src/control_points are from GRASS
684 ;; and are licensed under GPL2+ only.
685 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
686 ;; The tools supporting the library (both rl2tool and wmslite) are
687 ;; licensed under the GPL v3 (or any subsequent version) terms.
688 ;; The test/*.svg files are placed in the public domain, except for
689 ;; test/Car_Yellow.svg which is licensed under the Free Art License 1.3.
690 (license (list license:gpl2+
691 license:gpl3+
692 license:lal1.3
693 license:lgpl2.1+
694 license:mpl1.1
695 license:public-domain))))
696
697(define-public librttopo
698 (package
699 (name "librttopo")
700 (version "1.1.0")
701 (source
702 (origin
703 (method git-fetch)
704 (uri (git-reference
705 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
706 (commit (string-append "librttopo-" version))))
707 (file-name (git-file-name name version))
708 (sha256
709 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
710 (build-system gnu-build-system)
711 (arguments
712 `(#:phases
713 (modify-phases %standard-phases
714 (add-after 'unpack 'patch-autogen
715 (lambda _
716 (let ((autoconf (which "autoconf"))
717 (autoheader (which "autoheader"))
718 (aclocal (which "aclocal"))
719 (automake (which "automake"))
720 (libtoolize (which "libtoolize")))
721 (substitute* "autogen.sh"
722 (("`which autoconf 2>/dev/null`") autoconf)
723 (("`which autoheader 2>/dev/null`") autoheader)
724 (("ACLOCAL=.*$")
725 (string-append "ACLOCAL=" aclocal "\n"))
726 (("AUTOMAKE=.*$")
727 (string-append "AUTOMAKE=" automake "\n"))
728 (("LIBTOOLIZE=.*$")
729 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
730 #t)))))
731 (native-inputs
732 (list autoconf automake libtool pkg-config))
733 (inputs
734 (list geos))
735 (synopsis "Library to handle SQL/MM topologies")
736 (description
737 "The RT Topology Library exposes an API to create and manage standard
738(ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
739 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
740 (license license:gpl2+)))
741
742(define-public libspatialite
743 (package
744 (name "libspatialite")
745 (version "5.1.0")
746 (source
747 (origin
748 (method url-fetch)
749 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
750 "libspatialite-sources/libspatialite-"
751 version ".tar.gz"))
752 (sha256
753 (base32
754 "102hc18fvwr1kw8aap53zqi8r0l52b8wa00lvlbf1zys979jvgj3"))
755 (patches (search-patches "libspatialite-libxml2-2.14.patch"))))
756 (build-system gnu-build-system)
757 (native-inputs
758 (list pkg-config))
759 (inputs
760 (list freexl
761 geos
762 librttopo
763 libxml2
764 minizip
765 proj
766 sqlite))
767 (arguments
768 `(#:configure-flags
769 '("--enable-rttopo=yes")
770 ;; FIXME: Several tests fail with Proj 9.
771 #:tests? #f
772 #:phases
773 (modify-phases %standard-phases
774 ;; 1 test is failing, ignore it:
775 (add-after 'unpack 'ignore-broken-tests
776 (lambda _
777 (substitute* '("test/Makefile.in")
778 (("check_wms\\$\\(EXEEXT\\) check_drop_rename\\$\\(EXEEXT\\) ")
779 "check_wms$(EXEEXT) ")))))))
780 (synopsis "Extend SQLite to support Spatial SQL capabilities")
781 (description
782 "SpatiaLite is a library intended to extend the SQLite core to support
783fully fledged Spatial SQL capabilities.")
784 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
785 ;; For the genuine libspatialite-sources holds:
786 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
787 ;; Files under src/control_points are from GRASS
788 ;; and are licensed under GPL2+ only.
789 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
790 (license (list license:gpl2+
791 license:lgpl2.1+
792 license:mpl1.1
793 license:public-domain))))
794
795(define-public iphreeqc
796 (package
797 (name "iphreeqc")
798 (version "3.5.0-4")
799 (source
800 (origin
801 (method git-fetch)
802 (uri (git-reference
803 (url "https://github.com/ufz/iphreeqc")
804 (commit version)))
805 (file-name (git-file-name name version))
806 (sha256
807 (base32 "16yrq7sd8065nz477kmgpcwwry8dqcshbkn5b77hqv56yqgd00h2"))))
808 (build-system cmake-build-system)
809 (arguments
810 `(#:tests? #f
811 #:configure-flags (list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")))
812 (home-page "https://www.usgs.gov/software/phreeqc-version-3")
813 (synopsis "C++ library for performing aqueous geochemical calculations")
814 (description
815 "PHREEQC implements several types of aqueous models including two
816ion-association aqueous models. This package contains modifications for
817OpenGeoSys")
818 (license license:public-domain)))
819
820(define-public ogs-serial
821 (package
822 (name "ogs-serial")
823 (version "6.5.9")
824 (source
825 (origin
826 (method git-fetch)
827 (uri (git-reference
828 (url "https://gitlab.opengeosys.org/ogs/ogs.git")
829 (commit version)))
830 (file-name (git-file-name name version))
831 (sha256
832 (base32 "157abg8fw7kgv7banvsl74q8wa9a7xmcqrndiklmzjaqhg8wk8nh"))))
833 (build-system cmake-build-system)
834 (arguments
835 (list
836 #:build-type "Release"
837 #:configure-flags
838 #~(list "-GNinja" "-DOGS_USE_MFRONT=ON"
839 "-DOGS_USE_NETCDF=ON"
840 (string-append "-DMFrontGenericInterface_DIR="
841 #$(this-package-input "mgis")
842 "/share/mgis/cmake"))
843 #:phases
844 #~(modify-phases %standard-phases
845 (add-before 'configure 'set-env
846 (lambda _
847 (setenv "NINJAFLAGS"
848 (string-append "-k1" " -j"
849 (number->string (parallel-job-count))))))
850 (replace 'build
851 (lambda* (#:key parallel-build? #:allow-other-keys)
852 (apply invoke "cmake" "--build" "."
853 (if parallel-build?
854 `("--parallel" ,(number->string (parallel-job-count)))
855 '()))))
856 (replace 'check
857 (lambda* (#:key tests? #:allow-other-keys)
858 (when tests?
859 (invoke "cmake" "--build" "." "-t" "test"))))
860 (replace 'install
861 (lambda _
862 (invoke "cmake" "--install" ".")
863 ;; Fix missing executable permissions
864 (chmod (string-append #$output "/lib/libOgsMFrontBehaviour.so")
865 #o755))))))
866 (native-inputs
867 (list git
868 ninja
869 pybind11-2))
870 (inputs
871 (list boost
872 eigen
873 exprtk
874 hdf5
875 iphreeqc
876 nlohmann-json
877 libxml2
878 mgis
879 netcdf
880 netcdf-cxx4
881 python
882 range-v3
883 spdlog
884 tclap
885 tfel
886 vtk
887 xdmf
888 xmlpatch
889 zlib))
890 (propagated-inputs
891 (list metis)) ;to get mpmetis into PATH
892 (home-page "https://www.opengeosys.org")
893 (synopsis "Simulation of coupled processes in porous and fractured media")
894 (description
895 "OpenGeoSys (OGS) is a scientific open source project for the development
896of numerical methods for the simulation of thermo-hydro-mechanical-chemical
897(THMC) processes in porous and fractured media. OGS is implemented in C++, it
898is object-oriented with an focus on the numerical solution of coupled
899multi-field problems (multi-physics). Parallel versions of OGS are available
900relying on both MPI and OpenMP concepts. Application areas of OGS are
901currently CO2 sequestration, geothermal energy, water resources management,
902hydrology and waste deposition.")
903 (properties '((tunable? . #t)))
904 (license license:bsd-3)))
905
906(define-public ogs-petsc
907 (package
908 (inherit ogs-serial)
909 (name "ogs-petsc")
910 (inputs (modify-inputs inputs
911 (prepend openmpi petsc-openmpi)
912 (replace "hdf5" hdf5-parallel-openmpi)
913 (replace "netcdf-cxx4" netcdf-cxx4-parallel-openmpi)))
914 (native-inputs (modify-inputs native-inputs
915 (prepend pkg-config)))
916 (arguments
917 (substitute-keyword-arguments arguments
918 ((#:configure-flags flags)
919 #~(cons* "-DOGS_USE_PETSC=ON" "-DCMAKE_C_COMPILER=mpicc"
920 "-DCMAKE_CXX_COMPILER=mpic++"
921 #$flags))))
922 (synopsis "OpenGeoSys with PETSc (parallel processing) support")))
923
924(define-public proj
925 (package
926 (name "proj")
927 (version "9.7.1")
928 (source
929 (origin
930 (method url-fetch)
931 (uri (string-append "http://download.osgeo.org/proj/proj-"
932 version ".tar.gz"))
933 (sha256
934 (base32
935 "03r6mspfv22fs4x4jcgv25v9gsj5k6zy8incvyf94qf50g47s2bc"))))
936 (build-system cmake-build-system)
937 (arguments
938 (if (target-32bit?)
939 (list
940 #:phases
941 '(modify-phases %standard-phases
942 (add-after 'unpack 'patch-tests
943 (lambda _
944 ;; These regression tests fail due to accuracy problems.
945 (substitute* "test/unit/test_factory.cpp"
946 (("^TEST\\(factory, AuthorityFactory_createUnitOfMeasure_linear_us_survey_foot\\) \\{" m)
947 (string-append m "\nGTEST_SKIP();\n")))
948 (substitute* "test/unit/test_grids.cpp"
949 (("^TEST_F\\(GridTest, VerticalShiftGridSet_gtx\\) \\{" m)
950 (string-append m "\nGTEST_SKIP();\n")))
951 (substitute* "test/unit/test_defmodel.cpp"
952 (("^TEST\\(defmodel, evaluator_horizontal_unit_metre\\) \\{" m)
953 (string-append m "\nGTEST_SKIP();\n")))
954 ;; These regression tests fail due to accuracy problems.
955 (substitute* "test/CMakeLists.txt"
956 (("proj_add_gie_test\\(\"4D-API-cs2cs-style\".+") "")
957 (("proj_add_gie_test\\(\"Builtins\".+") "")
958 (("proj_add_gie_test\\(\"peirce_q\".+") ""))))))
959 '()))
960 (native-inputs (list googletest pkg-config))
961 (propagated-inputs (list curl libtiff sqlite)) ;required by proj.pc
962 (home-page "https://proj.org/")
963 (synopsis "Coordinate transformation software")
964 (description
965 "Proj is a generic coordinate transformation software that transforms
966geospatial coordinates from one @acronym{CRS, coordinate reference system}
967to another. This includes cartographic projections as well as geodetic
968transformations. Proj includes command line applications for easy
969conversion of coordinates from text files or directly from user input.
970In addition, Proj also exposes an application programming interface that
971lets developers use the functionality of Proj in their own software.")
972 (license (list license:expat
973 ;; src/projections/patterson.cpp
974 license:asl2.0
975 ;; src/geodesic.*, src/tests/geodtest.cpp
976 license:x11))))
977
978(define-public python-obspy
979 (package
980 (name "python-obspy")
981 (version "1.5.1")
982 (source
983 (origin
984 (method url-fetch)
985 (uri (pypi-uri "obspy" version))
986 (sha256
987 (base32 "0m4c5qkkrl4fr1p0061qap605qvwybqyjvnbj5ml6v9b0l5hm6cm"))))
988 (build-system pyproject-build-system)
989 (arguments
990 (list
991 #:phases
992 #~(modify-phases %standard-phases
993 ;; Rebuild shared libraries to run tests
994 (add-before 'check 'build-extensions
995 (lambda _
996 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
997 (native-inputs
998 (list python-packaging
999 python-pyproj
1000 python-pytest))
1001 (propagated-inputs
1002 (list python-decorator
1003 python-lxml
1004 python-matplotlib
1005 python-numpy
1006 python-requests
1007 python-scipy
1008 python-setuptools
1009 python-sqlalchemy))
1010 (home-page "https://www.obspy.org")
1011 (synopsis "Python framework for seismological observatories")
1012 (description
1013 "@code{ObsPy} is a project dedicated to provide a Python framework for
1014processing seismological data. It provides parsers for common file formats,
1015clients to access data centers and seismological signal processing routines
1016which allow the manipulation of seismological time series.
1017
1018The goal of the ObsPy project is to facilitate rapid application development
1019for seismology.")
1020 (license license:lgpl3)))
1021
1022(define-public python-osm2geojson
1023 (package
1024 (name "python-osm2geojson")
1025 (version "0.3.2")
1026 (source
1027 (origin
1028 (method git-fetch)
1029 (uri (git-reference
1030 (url "https://github.com/aspectumapp/osm2geojson")
1031 (commit (string-append "v" version))))
1032 (file-name (git-file-name name version))
1033 (sha256
1034 (base32 "1kxam3701hc26ij9lzl34dk0jqvvzwplqfj4x4acqv02hw4r25ql"))))
1035 (build-system pyproject-build-system)
1036 (arguments
1037 (list
1038 #:phases
1039 #~(modify-phases %standard-phases
1040 (add-after 'unpack 'fix-script-load
1041 ;; XXX: It's fixed the same way in upcoming release.
1042 (lambda _
1043 (substitute* "osm2geojson/__main__.py"
1044 (("exit\\(main\\(sys.argv\\[1:\\]\\)\\)")
1045 "if __name__ == '__main__':
1046 exit(main(sys.argv[1:]))")))))))
1047 (propagated-inputs (list python-requests python-shapely))
1048 (native-inputs (list python-pytest python-setuptools))
1049 (home-page "https://github.com/aspectumapp/osm2geojson")
1050 (synopsis "Parse OSM and Overpass JSON")
1051 (description
1052 "This package implements functions to convert OpenStreetMap and Overpass
1053API data (JSON or XML) to GeoJSON or @url{https://shapely.readthedocs.io/,
1054Shapely} geometries.")
1055 (license license:expat)))
1056
1057(define-public python-ppigrf
1058 (package
1059 (name "python-ppigrf")
1060 ;; 2.1.0 is not tagged, PyPI has no test data.
1061 (properties '((commit . "5c45795b9865a9e31ef2f066588473c6a103d629")
1062 (revision . "0")))
1063 (version (git-version "2.1.0"
1064 (assoc-ref properties 'revision)
1065 (assoc-ref properties 'commit)))
1066 (source
1067 (origin
1068 (method git-fetch)
1069 (uri (git-reference
1070 (url "https://github.com/IAGA-VMOD/ppigrf")
1071 (commit (assoc-ref properties 'commit))))
1072 (file-name (git-file-name name version))
1073 (sha256
1074 (base32 "0iwshgw81kkwkn0s1bnqvvr851x5fynpc70kz50fgfsfqkskaxjl"))))
1075 (build-system pyproject-build-system)
1076 (native-inputs
1077 (list python-pytest
1078 python-setuptools))
1079 (propagated-inputs
1080 (list python-numpy
1081 python-pandas))
1082 (home-page "https://github.com/IAGA-VMOD/ppigrf")
1083 (synopsis "International Geomagnetic Reference Field in Python")
1084 (description
1085 "Pure Python code to calculate @acronym{IGRF, International Geomagnetic
1086Reference Field} model predictions. The IGRF is a model of the Earth's main
1087magnetic field that is updated every 5 years.")
1088 (license license:expat)))
1089
1090(define-public python-pyogrio
1091 (package
1092 (name "python-pyogrio")
1093 (version "0.13.0")
1094 (source
1095 (origin
1096 (method git-fetch)
1097 (uri (git-reference
1098 (url "https://github.com/geopandas/pyogrio")
1099 (commit (string-append "v" version))))
1100 (file-name (git-file-name name version))
1101 (sha256
1102 (base32 "16y27sl01dksg32gfc9kq05kjd54l9q3qznigckiscn28kbyq4xw"))))
1103 (properties
1104 `((updater-extra-inputs . ("gdal"))))
1105 (build-system pyproject-build-system)
1106 (arguments
1107 (list
1108 ;; tests: 308 passed, 70 skipped, 7 deselected, 1 warning
1109 #:test-flags
1110 #~(list "--pyargs" "pyogrio"
1111 ;; These tests need Internet access.
1112 (string-append "--deselect=tests/test_core.py"
1113 "::test_list_drivers_details_help_topic_url")
1114 "--deselect=tests/test_path.py::test_url"
1115 "--deselect=tests/test_path.py::test_url_with_zip"
1116 "--deselect=tests/test_path.py::test_uri_s3")
1117 #:phases
1118 #~(modify-phases %standard-phases
1119 (add-before 'check 'remove-local-source
1120 (lambda _
1121 (delete-file-recursively "pyogrio"))))))
1122 (propagated-inputs (list python-certifi python-numpy python-packaging))
1123 (inputs (list gdal))
1124 (native-inputs
1125 (list python-cython
1126 python-pytest
1127 python-setuptools
1128 python-tomli
1129 python-versioneer))
1130 (home-page "https://pyogrio.readthedocs.io/en/latest/")
1131 (synopsis "Vectorized spatial vector file format I/O using GDAL/OGR")
1132 (description "Pyogrio provides a GeoPandas-oriented API to OGR vector data
1133sources, such as ESRI Shapefile, GeoPackage, and GeoJSON. Vector data sources
1134have geometries, such as points, lines, or polygons, and associated records
1135with potentially many columns worth of data. Pyogrio uses a vectorized
1136approach for reading and writing GeoDataFrames to and from OGR vector data
1137sources in order to give you faster interoperability. It uses pre-compiled
1138bindings for GDAL/OGR so that the performance is primarily limited by the
1139underlying I/O speed of data source drivers in GDAL/OGR rather than multiple
1140steps of converting to and from Python data types within Python.")
1141 (license license:expat)))
1142
1143(define-public python-pyproj
1144 (package
1145 (name "python-pyproj")
1146 (version "3.7.2")
1147 (source
1148 (origin
1149 (method git-fetch)
1150 (uri (git-reference
1151 (url "https://github.com/pyproj4/pyproj")
1152 (commit version)))
1153 (file-name (git-file-name name version))
1154 (sha256
1155 (base32 "114ibabbgpmaw7nz49mq5hap8gmqzbwpl5c5n0yav6jw1kighpar"))))
1156 (build-system pyproject-build-system)
1157 (arguments
1158 (list
1159 #:test-flags
1160 #~(list
1161 ;; Test configuration issues.
1162 "--ignore=test/test_datadir.py"
1163 "-k" (string-join
1164 ;; Network is required.
1165 (list "not test_sync_download"
1166 "test_sync_download__directory"
1167 "test_sync_download__system_directory"
1168 "test_sync__download_grids"
1169 "test_get_transform_grid_list"
1170 "test__load_grid_geojson_old_file"
1171 "test_transformer_group__download_grids"
1172 ;; XXX: Some incompatibility issues.
1173 "test_datum_horizontal"
1174 "test_sub_crs "
1175 "test_sync__area_of_use__list"
1176 "test_sync__bbox__list"
1177 "test_sync__file__list"
1178 "test_sync__source_id__list")
1179 " and not "))
1180 #:phases
1181 #~(modify-phases %standard-phases
1182 (add-after 'unpack 'set-proj-path
1183 (lambda* (#:key #:allow-other-keys)
1184 (let ((proj #$(this-package-input "proj")))
1185 (setenv "PROJ_DIR" proj)
1186 (substitute* "pyproj/datadir.py"
1187 (("(internal_datadir = ).*$" all var)
1188 (string-append var "Path(\"" proj
1189 "/share/proj\")\n"))))))
1190 (add-before 'check 'remove-local-pyproj
1191 (lambda _
1192 ;; This would otherwise interfere with finding the installed
1193 ;; pyproj when running tests.
1194 (delete-file-recursively "pyproj"))))))
1195 (inputs
1196 (list proj))
1197 (propagated-inputs
1198 (list python-certifi))
1199 (native-inputs
1200 (list python-cython
1201 python-numpy
1202 python-pandas
1203 python-pytest
1204 python-setuptools
1205 python-xarray))
1206 (home-page "https://github.com/pyproj4/pyproj")
1207 (synopsis "Python interface to PROJ")
1208 (description
1209 "This package provides a Python interface to PROJ, a cartographic
1210projections and coordinate transformations library.")
1211 (license license:expat)))
1212
1213(define-public python-fiona
1214 (package
1215 (name "python-fiona")
1216 (version "1.10.1")
1217 (source
1218 (origin
1219 (method git-fetch)
1220 (uri (git-reference
1221 ;; TODO: Unvedor fiona/_vendor/snuggs.py and
1222 ;; fiona/_vendor/munch.
1223 (url "https://github.com/Toblerity/Fiona")
1224 (commit version)))
1225 (file-name (git-file-name name version))
1226 (sha256
1227 (base32 "0xribbcy5wvrm5y3bq281dry86vhjcnphg9772yp9s3y30y7mlz4"))))
1228 (build-system pyproject-build-system)
1229 (arguments
1230 (list
1231 ;; tests: 757 passed, 161 skipped, 24 deselected, 1 xfailed, 6 xpassed
1232 #:test-flags
1233 #~(list "-m" "not network and not wheel"
1234 #$@(map (lambda (test) (string-append "--deselect=tests/" test))
1235 ;; UserWarning: The parameter --where is used more than
1236 ;; once. Remove its duplicate as parameters should be
1237 ;; unique.
1238 (list "test_fio_cat.py::test_bbox_json_yes"
1239 "test_fio_cat.py::test_bbox_no"
1240 "test_fio_cat.py::test_bbox_where"
1241 "test_fio_cat.py::test_bbox_yes"
1242 "test_fio_cat.py::test_bbox_yes_two_files"
1243 "test_fio_cat.py::test_dst_crs_epsg3857"
1244 "test_fio_cat.py::test_multi_layer"
1245 "test_fio_cat.py::test_one"
1246 "test_fio_cat.py::test_two"
1247 "test_fio_cat.py::test_vfs"
1248 "test_fio_cat.py::test_where_no"
1249 "test_fio_cat.py::test_where_yes"
1250 "test_fio_cat.py::test_where_yes_two_files"
1251 ;; FileNotFoundError:
1252 ;; https://github.com/Toblerity/Fiona/files/\
1253 ;; 11151652/coutwildrnp.zip
1254 "test_pyopener.py::test_opener_fsspec_zip_http_fs")))
1255 #:phases
1256 #~(modify-phases %standard-phases
1257 (add-before 'check 'remove-local-source
1258 (lambda _
1259 (delete-file-recursively "fiona"))))))
1260 (inputs
1261 (list gdal))
1262 (propagated-inputs
1263 (list python-attrs
1264 python-certifi
1265 python-click
1266 python-click-plugins
1267 python-cligj))
1268 (native-inputs
1269 (list gdal ; for gdal-config
1270 python-boto3
1271 python-cython
1272 python-fsspec
1273 python-pyparsing ;for vendored snuggs
1274 python-pytest
1275 python-pytz
1276 python-setuptools
1277 python-shapely))
1278 (home-page "https://github.com/Toblerity/Fiona")
1279 (synopsis "Fiona reads and writes spatial data files")
1280 (description
1281 "Fiona is GDAL’s neat and nimble vector API for Python programmers. Fiona
1282is designed to be simple and dependable. It focuses on reading and writing
1283data in standard Python IO style and relies upon familiar Python types and
1284protocols such as files, dictionaries, mappings, and iterators instead of
1285classes specific to OGR. Fiona can read and write real-world data using
1286multi-layered GIS formats and zipped virtual file systems and integrates
1287readily with other Python GIS packages such as pyproj, Rtree, and Shapely.")
1288 (license license:bsd-3)))
1289
1290(define-public python-geopack
1291 (package
1292 (name "python-geopack")
1293 ;; See: <https://github.com/tsssss/geopack/issues/26>.
1294 (properties '((commit . "8c5f0e0f6752604c5a6f57bac752059e0f85edbb")
1295 (revision . "0")))
1296 (version (git-version "1.0.13"
1297 (assoc-ref properties 'revision)
1298 (assoc-ref properties 'commit)))
1299 (source
1300 (origin
1301 (method git-fetch)
1302 (uri (git-reference
1303 (url "https://github.com/tsssss/geopack")
1304 (commit (assoc-ref properties 'commit))))
1305 (file-name (git-file-name name version))
1306 (sha256
1307 (base32 "0ywqg9j09mhpfb9dcjmnlvh26s0v4lvzfwdmlivgx9ypamafa117"))))
1308 (build-system pyproject-build-system)
1309 (arguments
1310 (list
1311 ;; XXX Reported upstream <https://github.com/tsssss/geopack/issues/21>.
1312 #:tests? #f
1313 #:phases
1314 #~(modify-phases %standard-phases
1315 (add-after 'unpack 'set-version
1316 (lambda _
1317 (substitute* "setup.py"
1318 (("1.0.12") "1.0.13")))))))
1319 (native-inputs
1320 (list python-setuptools))
1321 (propagated-inputs
1322 (list python-numpy python-scipy))
1323 (home-page "https://github.com/tsssss/geopack")
1324 (synopsis "Python version of geopack and Tsyganenko models")
1325 (description
1326 "Python version of geopack and Tsyganenko models, compatible with
1327@code{geopack05} and @code{geopack08}.")
1328 (license license:expat)))
1329
1330(define-public python-geopandas
1331 (package
1332 (name "python-geopandas")
1333 (version "1.1.4")
1334 (source
1335 (origin
1336 (method git-fetch)
1337 (uri (git-reference
1338 (url "https://github.com/geopandas/geopandas")
1339 (commit (string-append "v" version))))
1340 (file-name (git-file-name name version))
1341 (sha256
1342 (base32 "14lbxcmn4zr9vxbg5vlhfr2ng9ybz8fb3xl9dpgj3fkq80m18agb"))
1343 (snippet #~(delete-file "versioneer.py"))))
1344 (build-system pyproject-build-system)
1345 (arguments
1346 (list
1347 ;; tests: 2022 passed, 400 skipped, 25 xfailed, 2 xpassed, 167 warnings
1348 #:test-flags
1349 ;; Disable tests that require internet access.
1350 #~(list "-m" "not web"
1351 "--numprocesses" (number->string (min 8 (parallel-job-count))))
1352 #:phases
1353 #~(modify-phases %standard-phases
1354 (add-before 'check 'pre-check
1355 (lambda _
1356 (setenv "HOME" "/tmp"))))))
1357 (propagated-inputs
1358 (list python-numpy
1359 python-packaging
1360 python-pandas
1361 python-pyogrio
1362 python-pyproj
1363 python-shapely))
1364 (native-inputs
1365 (list python-pytest
1366 python-pytest-xdist
1367 python-setuptools
1368 python-versioneer
1369 tzdata-for-tests))
1370 (home-page "https://geopandas.org")
1371 (synopsis "Geographic pandas extensions")
1372 (description "The goal of GeoPandas is to make working with
1373geospatial data in Python easier. It combines the capabilities of
1374Pandas and Shapely, providing geospatial operations in Pandas and a
1375high-level interface to multiple geometries to Shapely. GeoPandas
1376enables you to easily do operations in Python that would otherwise
1377require a spatial database such as PostGIS.")
1378 (license license:bsd-3)))
1379
1380(define-public python-overpass
1381 (package
1382 (name "python-overpass")
1383 (version "0.8.2")
1384 (source
1385 (origin
1386 (method git-fetch)
1387 (uri (git-reference
1388 (url "https://codeberg.org/mvexel/overpass-api-python-wrapper")
1389 (commit (string-append "v" version))))
1390 (file-name (git-file-name name version))
1391 (sha256
1392 (base32 "03by3g4y3idsyky90cnm47a85n8ysjv1rd5y5p053iyfdir48xlg"))))
1393 (build-system pyproject-build-system)
1394 (propagated-inputs (list python-osm2geojson python-requests))
1395 (native-inputs
1396 (list python-deepdiff
1397 python-geojson
1398 python-pytest
1399 python-requests-mock
1400 python-setuptools))
1401 (home-page "https://codeberg.org/mvexel/overpass-api-python-wrapper")
1402 (synopsis "Python wrapper for the OpenStreetMap Overpass API")
1403 (description "This package provides python-overpass, a Python wrapper
1404for the @code{OpenStreetMap} Overpass API.")
1405 (license license:asl2.0)))
1406
1407(define-public python-ogr2osm
1408 (package
1409 (name "python-ogr2osm")
1410 (version "1.2.0")
1411 (source
1412 (origin
1413 (method git-fetch) ; no tests data in PyPi package
1414 (uri
1415 (git-reference
1416 (url "https://github.com/roelderickx/ogr2osm/")
1417 (commit (string-append "v" version))))
1418 (file-name (git-file-name name version))
1419 (sha256
1420 (base32 "0hwqnx3cdqxmniydpj1v31kglq1xjsx41d8p10c9j4hg8kb43j80"))))
1421 (build-system pyproject-build-system)
1422 (arguments
1423 (list
1424 ;; There are tests in git checkout but non of the examples taken from
1425 ;; GitHub Actions worked for me. Disabling them to be checked later
1426 ;; <https://github.com/roelderickx/ogr2osm/blob/main/.github/workflows/test.yml>.
1427 #:phases
1428 #~(modify-phases %standard-phases
1429 (replace 'check
1430 (lambda* (#:key tests? #:allow-other-keys)
1431 (when tests?
1432 ;; TODO: Fix provided tests.
1433 ;; (invoke "cram" "test/basic_usage.t")
1434 ;; (invoke "cram" "test/osm_output.t")
1435 ;; (invoke "cram" "test/pbf_output.t")
1436
1437 ;; Run simple tests to ensure that the command is working.
1438 (invoke "ogr2osm" "--help")
1439 (invoke
1440 "ogr2osm" "-f" "test/shapefiles/basic_geometries.kml")))))))
1441 (inputs
1442 (list gdal))
1443 (native-inputs
1444 (list coreutils
1445 diffutils
1446 libxml2
1447 python-cram
1448 python-setuptools
1449 python-wheel
1450 which))
1451 (propagated-inputs
1452 (list python-lxml
1453 python-protobuf))
1454 (home-page "https://github.com/roelderickx/ogr2osm")
1455 (synopsis "Convert ogr-readable files like shapefiles into OSM or PDF formats")
1456 (description
1457 "@code{ogr2osm} is a tool for converting ogr-readable files into
1458@acronym{OSM, OpenStreetMap} format. It supports reading from OGR files like
1459shapefiles or PostgreSQL database and converts data into @code{osm} or
1460@code{osm.pbf} formats. A translation file can be used to manipulate the data
1461during conversion.")
1462 (license license:expat)))
1463
1464(define-public python-osmnx
1465 (package
1466 (name "python-osmnx")
1467 (version "2.1.1")
1468 (source
1469 (origin
1470 (method git-fetch)
1471 (uri (git-reference
1472 (url "https://github.com/gboeing/osmnx")
1473 (commit (string-append "v" version))))
1474 (file-name (git-file-name name version))
1475 (sha256
1476 (base32 "1wv8qarfrqzvqmrpcxqihpz5b4r7mnpxyyla66543xfizn2iazix"))))
1477 (build-system pyproject-build-system)
1478 (arguments
1479 (list
1480 #:build-backend "hatchling.build"
1481 #:tests? #f)) ;nearly all tests need network access
1482 (native-inputs
1483 (list python-hatchling
1484 python-pytest
1485 python-setuptools))
1486 (propagated-inputs
1487 (list python-geopandas
1488 python-networkx
1489 python-numpy
1490 python-pandas
1491 python-requests
1492 python-shapely
1493 ;; [optional]
1494 python-matplotlib
1495 python-rasterio
1496 ;; python-rio-vrt ;not packaged yet in Guix
1497 python-scikit-learn
1498 python-scipy))
1499 (home-page "https://github.com/gboeing/osmnx")
1500 (synopsis
1501 "Retrieve, model, analyze, and visualize OpenStreetMap street networks")
1502 (description
1503 "OSMnx is a Python library that lets you download geospatial data from
1504OpenStreetMap and model, project, visualize, and analyze real-world street
1505networks and any other geospatial geometries. You can download and model
1506walkable, drivable, or bikeable urban networks with a single line of Python
1507code then easily analyze and visualize them. You can just as easily download
1508and work with other infrastructure types, amenities/points of interest,
1509building footprints, elevation data, street bearings/orientations, and
1510speed/travel time.")
1511 (license license:expat)))
1512
1513(define-public python-owslib
1514 (package
1515 (name "python-owslib")
1516 (version "0.34.1")
1517 (source
1518 (origin
1519 (method git-fetch)
1520 (uri (git-reference
1521 (url "https://github.com/geopython/OWSLib")
1522 (commit version)))
1523 (file-name (git-file-name name version))
1524 (sha256
1525 (base32 "14pb96h0nl4c6hs58i2z7mx0fpd4g886ajflbrs69hwiqj2x8a3f"))))
1526 (build-system pyproject-build-system)
1527 (arguments
1528 (list
1529 #:test-flags
1530 #~(list
1531 ;; XXX: Those tests require network access.
1532 "-k" (string-join
1533 (list "not test_ows_interfaces_wcs"
1534 "test_system_readonly"
1535 "test_sampling_features_readonly"
1536 "test_datastreams_readonly"
1537 "test_observations_readonly"
1538 "test_system_history")
1539 " and not ")
1540 ;; XXX: Not collected properly.
1541 "--ignore-glob=tests/doctests/*")
1542 #:phases
1543 #~(modify-phases %standard-phases
1544 (add-before 'check 'cleanup-build-directory
1545 (lambda _
1546 (delete-file-recursively "build"))))))
1547 (native-inputs
1548 (list python-dateutil
1549 python-pyproj
1550 python-pyyaml
1551 python-pytest
1552 python-pytest-httpserver
1553 python-pytz
1554 python-requests
1555 python-setuptools
1556 python-wheel))
1557 (propagated-inputs
1558 (list python-lxml))
1559 (synopsis "Interface for Open Geospatial Consortium web service")
1560 (description
1561 "OWSLib is a Python package for client programming with Open Geospatial
1562Consortium (OGC) web service (hence OWS) interface standards, and their related
1563content models.")
1564 (home-page "https://geopython.github.io/OWSLib/")
1565 (license license:bsd-3)))
1566
1567(define-public mapnik
1568 (let ((commit "cb1e226cc35eec86bb317816dc7942562f548aaa")
1569 (revision "0"))
1570 (package
1571 (name "mapnik")
1572 (version (git-version "4.2.1" revision commit))
1573 (source
1574 (origin
1575 (method git-fetch)
1576 (uri (git-reference
1577 (url "https://github.com/mapnik/mapnik")
1578 (commit commit)
1579 ;; TODO: Un-bundle mapbox dependencies (not yet packaged).
1580 (recursive? #t))) ;for mapbox dependencies and test data
1581 (file-name (git-file-name name version))
1582 (sha256
1583 (base32 "1zidqcv0qdphgxvvkyjl53wdrcj24gk963sc85nmhqhwv7ihql52"))))
1584 (build-system cmake-build-system)
1585 (arguments
1586 (list
1587 #:configure-flags
1588 #~(list "-DBUILD_DEMO_VIEWER=OFF"
1589 "-DBUILD_DEMO_CPP=OFF"
1590 (string-append "-DCMAKE_CXX_FLAGS=-I"
1591 #$(this-package-native-input "catch2")
1592 "/include/catch2"))
1593 ;; The 'ogr' test fails for unknown reasons. Mark it as expected to
1594 ;; fail (see: https://github.com/mapnik/mapnik/issues/4329).
1595 #:test-exclude "ogr"
1596 #:phases
1597 #~(modify-phases %standard-phases
1598 (add-after 'unpack 'use-system-catch2
1599 (lambda _
1600 (substitute* "test/CMakeLists.txt"
1601 (("GIT_TAG.*v2.13.7" all)
1602 (string-append all "\n"
1603 " FIND_PACKAGE_ARGS NAMES Catch2"))
1604 (("^include.*Catch2_SOURCE_DIR.*contrib/Catch.cmake.*")
1605 "include(Catch)\n")))))))
1606 (native-inputs
1607 (list catch2-2
1608 pkg-config
1609 postgresql))
1610 (inputs
1611 (list boost
1612 cairo
1613 freetype
1614 gdal
1615 harfbuzz
1616 icu4c
1617 libavif
1618 libjpeg-turbo
1619 libpng
1620 libtiff
1621 libwebp
1622 libxml2
1623 openssl
1624 proj
1625 sqlite
1626 zlib))
1627 (home-page "https://mapnik.org/")
1628 (synopsis "Toolkit for developing mapping applications")
1629 (description "Mapnik is a toolkit for developing mapping applications. It
1630is basically a collection of geographic objects like maps, layers,
1631datasources, features, and geometries. At its core is a C++ shared library
1632providing algorithms and patterns for spatial data access and visualization.
1633The library does not rely on any specific windowing system and can be deployed
1634to any server environment. It is intended to play fair in a multi-threaded
1635environment and is aimed primarily, but not exclusively, at web-based
1636development.")
1637 (license (list license:lgpl2.1+
1638 ;; demo/viewer, demo/python/rundemo.py
1639 license:gpl2+
1640 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
1641 license:boost1.0
1642 ;; deps/mapnik/sparsehash
1643 license:bsd-3
1644 ;; deps/agg
1645 (license:non-copyleft "file://deps/agg/copying"))))))
1646
1647(define-public spatialite-gui
1648 (package
1649 (name "spatialite-gui")
1650 (version "2.1.0-beta1")
1651 (source
1652 (origin
1653 (method url-fetch)
1654 (uri (string-append
1655 "https://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/"
1656 "spatialite_gui-" version ".tar.gz"))
1657 (sha256
1658 (base32 "0cyv4cycl073p9lnnnglcb72qn71g8h9g5zn4gzw7swcy5nxjj5s"))))
1659 (build-system gnu-build-system)
1660 (native-inputs
1661 (list pkg-config))
1662 (inputs
1663 (list curl
1664 freexl
1665 geos
1666 giflib
1667 libjpeg-turbo
1668 librasterlite2
1669 librttopo
1670 libspatialite
1671 libwebp
1672 libxlsxwriter
1673 libxml2
1674 lz4
1675 minizip
1676 openjpeg
1677 postgresql
1678 proj
1679 sqlite
1680 virtualpg
1681 wxwidgets
1682 `(,zstd "lib")))
1683 (arguments
1684 `(#:phases (modify-phases %standard-phases
1685 (add-after 'unpack 'fix-gui
1686 (lambda _
1687 ;; Fix for the GUI not showing up.
1688 (substitute* "Main.cpp"
1689 (("Hide\\(\\);") ""))
1690 #t)))))
1691 (synopsis "Graphical user interface for SpatiaLite")
1692 (description "Spatialite-gui provides a visual interface for viewing and
1693 maintaining a spatialite database. You can easily see the structure of the
1694 tables and data contents using point and click functions, many of which
1695 construct common SQL queries, or craft your own SQL queries.")
1696 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
1697 (license license:gpl3+)))
1698
1699(define-public pdal
1700 (package
1701 (name "pdal")
1702 (version "2.10.2")
1703 (source
1704 (origin
1705 (method git-fetch)
1706 (uri (git-reference
1707 (url "https://github.com/PDAL/PDAL")
1708 (commit version)))
1709 (file-name (git-file-name name version))
1710 (sha256
1711 (base32 "164mqn7vz68nsr2ihhpqryp550p9ls02n0gqnaiw455210f0n4ap"))))
1712 (build-system cmake-build-system)
1713 (arguments
1714 (list
1715 #:configure-flags #~(list "-DUSE_EXTERNAL_GTEST=ON")
1716 #:parallel-tests? #f
1717 ;; Skip the tests using network to get remote data :
1718 ;; - pdal_io_stac_reader_test
1719 ;; - pdal_io_stac_remote_reader_test
1720 ;; - pdal_io_copc_remote_reader_test
1721 #:test-exclude "pdal_io_(stac(_remote)?|copc_remote)_reader_test"))
1722 (native-inputs (list python googletest))
1723 (inputs (list gdal
1724 h3
1725 libgeotiff
1726 libunwind
1727 libxml2
1728 nlohmann-json
1729 openssl
1730 proj
1731 utfcpp
1732 xz
1733 `(,zstd "lib")))
1734 (home-page "https://pdal.io/")
1735 (synopsis "Point Data Abstraction Library")
1736 (description "PDAL is a C++ library for translating and manipulating point
1737cloud data. It is very much like the GDAL library which handles raster and
1738vector data.")
1739 (license license:bsd-3)))
1740
1741(define-public gdal
1742 (package
1743 (name "gdal")
1744 (version "3.8.2")
1745 (source (origin
1746 (method url-fetch)
1747 (uri (string-append
1748 "https://github.com/OSGeo/gdal/releases/download/v"
1749 version "/gdal-" version ".tar.gz"))
1750 (sha256
1751 (base32
1752 "1ml9l1c4psb1nc760nvs4vbibwf288d4anxip9sisrwl4q6nj579"))
1753 (modules '((guix build utils)))
1754 (snippet
1755 `(begin
1756 ;; TODO: frmts contains a lot more bundled code.
1757 (for-each delete-file-recursively
1758 ;; bundled code
1759 '("frmts/png/libpng"
1760 "frmts/gif/giflib"
1761 "frmts/jpeg/libjpeg"
1762 "frmts/jpeg/libjpeg12"
1763 "frmts/gtiff/libtiff"
1764 "frmts/gtiff/libgeotiff"
1765 ;; We need to keep frmts/zlib/contrib/infback9
1766 ;; because the cmake file unconditionally
1767 ;; depends on it for deflate64. The infback9.h
1768 ;; header file is also referenced in parts of
1769 ;; the code.
1770 ;;"frmts/zlib"
1771 "ogr/ogrsf_frmts/geojson/libjson"))))))
1772 (build-system cmake-build-system)
1773 (arguments
1774 (list
1775 #:tests? #f
1776 #:imported-modules (append %cmake-build-system-modules
1777 %pyproject-build-system-modules)
1778 #:modules '((guix build cmake-build-system)
1779 ((guix build pyproject-build-system) #:prefix py:)
1780 (guix build utils))
1781 #:configure-flags
1782 #~(list "-DGDAL_USE_INTERNAL_LIBS=WHEN_NO_EXTERNAL"
1783 "-DGDAL_USE_JPEG12_INTERNAL=OFF"
1784 "-DGDAL_USE_LERC_INTERNAL=ON"
1785 (string-append "-DCMAKE_INSTALL_RPATH=" #$output "/lib"))
1786 #:phases
1787 #~(modify-phases %standard-phases
1788 (add-after 'install 'swap-files
1789 (lambda* (#:key inputs outputs #:allow-other-keys)
1790 ;; The RPATH of the binaries in build/swig/python/build/ is
1791 ;; rewritten in build/swig/python/for_install/build/. For
1792 ;; unknown reasons the files in the former directory are
1793 ;; installed when it should be those in the latter directory.
1794 ;; So we copy them ourselves.
1795 (with-directory-excursion
1796 "../build/swig/python/for_install/build"
1797 (for-each (lambda (file)
1798 (install-file file
1799 (string-append
1800 (py:site-packages inputs outputs)
1801 "/osgeo")))
1802 (find-files "." "\\.so"))))))))
1803 (inputs
1804 (list curl
1805 expat
1806 freexl
1807 geos
1808 giflib
1809 json-c
1810 libgeotiff
1811 libjpeg-turbo
1812 libjxl
1813 libpng
1814 libtiff
1815 libwebp
1816 lz4
1817 netcdf
1818 openssl
1819 openjpeg
1820 pcre2
1821 postgresql ; libpq
1822 proj
1823 qhull
1824 shapelib
1825 sqlite
1826 swig-4.0
1827 zlib
1828 zstd))
1829 (native-inputs
1830 (list pkg-config
1831 python
1832 python-setuptools))
1833 (propagated-inputs
1834 (list python-numpy))
1835 (home-page "https://gdal.org/")
1836 (synopsis "Raster and vector geospatial data format library")
1837 (description "GDAL is a translator library for raster and vector geospatial
1838data formats. As a library, it presents a single raster abstract data model
1839and single vector abstract data model to the calling application for all
1840supported formats. It also comes with a variety of useful command line
1841utilities for data translation and processing.")
1842 (license (list
1843 ;; general license
1844 license:expat
1845 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
1846 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
1847 ;; frmts/mrf/
1848 license:bsd-3
1849 ;; frmts/hdf4/hdf-eos/*
1850 ;; similar to the expat license, but without guarantee exclusion
1851 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
1852 ;; frmts/grib/degrib/
1853 license:public-domain ; with guarantee exclusion
1854 ;; port/cpl_minizip*
1855 ;; Some bsd-inspired license
1856 (license:non-copyleft "file://port/LICENCE_minizip")
1857 ;; alg/internal_libqhull
1858 ;; Some 5-clause license
1859 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
1860 ;; frmts/mrf/libLERC
1861 license:asl2.0))))
1862
1863(define-public python-pyshp
1864 (package
1865 (name "python-pyshp")
1866 (version "2.3.1")
1867 (source
1868 (origin
1869 (method git-fetch)
1870 (uri (git-reference
1871 (url "https://github.com/GeospatialPython/pyshp")
1872 (commit version)))
1873 (file-name (git-file-name name version))
1874 (sha256
1875 (base32 "02pbr091p8v4kfv1p6p2aa4asgm9r74dc12r35lvgmhs9y163z69"))))
1876 (build-system pyproject-build-system)
1877 (arguments
1878 (list
1879 #:test-flags
1880 ;; This test requires internet access.
1881 '(list "--deselect" "test_shapefile.py::test_reader_url")))
1882 (native-inputs
1883 (list python-pytest python-setuptools python-wheel))
1884 (home-page "https://github.com/GeospatialPython/pyshp")
1885 (synopsis "Read/write support for ESRI Shapefile format")
1886 (description
1887 "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
1888 (license license:expat)))
1889
1890(define-public python-verde
1891 (package
1892 (name "python-verde")
1893 (version "1.9.0")
1894 (source
1895 (origin
1896 (method git-fetch)
1897 (uri (git-reference
1898 (url "https://github.com/fatiando/verde")
1899 (commit (string-append "v" version))))
1900 (file-name (git-file-name name version))
1901 (sha256
1902 (base32 "1pxlhajhq29qybx8l1jv9dab7164y0k0grz95k6s8pcd3aii7sa6"))))
1903 (build-system pyproject-build-system)
1904 (arguments
1905 ;; tests: 164 passed, 10 deselected, 48 warnings
1906 (list
1907 #:test-flags
1908 ;; AssertionError: Regex pattern did not match. Input: "Window size '5'
1909 ;; is larger than dimensions of the region '(np.float64(-5.0),
1910 ;; np.float64(-1.0), np.float64(6.0), np.float64(20.0))'."
1911 #~(list (string-append "--deselect=verde/tests/test_coordinates.py"
1912 "::test_rolling_window_oversized_window")
1913 ;; Undamped Spline/SplineCV fits return wrong predictions
1914 ;; with scikit-learn >= 1.9. Regression reported upstream:
1915 ;; https://github.com/fatiando/verde/issues/558
1916 "--deselect=verde/tests/test_chain.py::test_chain_double"
1917 "--ignore=verde/tests/test_spline.py"
1918 ;; Tests below fetch data remotely.
1919 "-k" (string-append "not test_minimal_integration_2d_gps"
1920 " and not test_datasets_locate"
1921 " and not test_fetch_texas_wind"
1922 " and not test_fetch_baja_bathymetry"
1923 " and not test_fetch_rio_magnetic"
1924 " and not test_fetch_california_gps"))))
1925 (native-inputs
1926 (list python-cartopy
1927 python-distributed ;for Dask
1928 python-matplotlib
1929 python-pytest
1930 python-pytest-mpl
1931 python-setuptools
1932 python-setuptools-scm))
1933 (propagated-inputs
1934 (list python-dask
1935 python-numpy
1936 python-pandas
1937 python-pooch
1938 python-scikit-learn
1939 python-scipy
1940 python-xarray
1941 ;; [optional]
1942 python-pykdtree
1943 python-numba))
1944 (home-page "https://github.com/fatiando/verde")
1945 (synopsis "Processing and gridding spatial data, machine-learning style")
1946 (description
1947 "Verde is a Python library for processing spatial data (topography, point
1948clouds, bathymetry, geophysics surveys, etc) and interpolating them on a 2D
1949surface (i.e., gridding) with a hint of machine learning.")
1950 (license license:bsd-3)))
1951
1952(define-public python-cartopy
1953 (package
1954 (name "python-cartopy")
1955 (version "0.24.1")
1956 (source
1957 (origin
1958 (method url-fetch)
1959 (uri (pypi-uri "cartopy" version))
1960 (sha256
1961 (base32 "1gf8hpjlhjsw1gfd80ghcy3k5lkkshbhlvn4vvpsfsaccgai1j81"))))
1962 (build-system pyproject-build-system)
1963 (arguments
1964 (list
1965 #:test-flags
1966 #~(list
1967 "--pyargs" "cartopy"
1968 "--numprocesses" (number->string (parallel-job-count))
1969 ;; These tests require online data.
1970 "-m" "not natural_earth and not network"
1971 ;; Failed: Error: Image files did not match.
1972 "-k" "not test_gridliner_constrained_adjust_datalim")
1973 #:phases
1974 #~(modify-phases %standard-phases
1975 ;; We don't want to create an entrypoint for
1976 ;; tools/cartopy_feature_download.py, because that file is not
1977 ;; installed.
1978 (add-after 'unpack 'remove-endpoint
1979 (lambda _
1980 (substitute* "pyproject.toml"
1981 (("^feature_download = .*") "")))))))
1982 (propagated-inputs
1983 (list python-matplotlib
1984 python-fiona ; optional [speedups]
1985 python-numpy
1986 python-owslib ; optional [ows]
1987 python-packaging
1988 python-pillow ; optional [ows, plotting]
1989 python-pykdtree ; optional [speedups]
1990 python-pyproj
1991 python-pyshp
1992 python-scipy ; optional [plotting]
1993 python-shapely))
1994 (inputs
1995 (list geos))
1996 (native-inputs
1997 (list python-cython
1998 python-pytest
1999 python-pytest-mpl
2000 python-pytest-xdist
2001 python-setuptools
2002 python-setuptools-scm
2003 python-wheel))
2004 (home-page "https://scitools.org.uk/cartopy/docs/latest/")
2005 (synopsis "Cartographic library for visualisation")
2006 (description
2007 "Cartopy is a Python package designed to make drawing maps for data
2008analysis and visualisation easy.
2009
2010It features:
2011
2012@itemize
2013@item object oriented projection definitions
2014@item point, line, polygon and image transformations between projections
2015@item integration to expose advanced mapping in Matplotlib with a simple and
2016intuitive interface
2017@item powerful vector data handling by integrating shapefile reading with
2018Shapely capabilities
2019@end itemize")
2020 (license license:lgpl3+)))
2021
2022(define-public postgis
2023 (package
2024 (name "postgis")
2025 (version "3.3.8")
2026 (source (origin
2027 (method url-fetch)
2028 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
2029 version ".tar.gz"))
2030 (sha256
2031 (base32
2032 "1w1jkb98rf22qz0x4wajp0cjwzcb928247169xk84az3adb0y9vf"))))
2033 (build-system gnu-build-system)
2034 (arguments
2035 `(#:tests? #f
2036 #:make-flags
2037 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
2038 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
2039 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
2040 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
2041 #:phases
2042 (modify-phases %standard-phases
2043 (add-before 'build 'fix-install-path
2044 (lambda* (#:key outputs #:allow-other-keys)
2045 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
2046 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
2047 (string-append (assoc-ref outputs "out") "/bin"))))))))
2048 (inputs
2049 (list gdal
2050 geos
2051 giflib
2052 json-c
2053 libjpeg-turbo
2054 libxml2
2055 openssl
2056 pcre
2057 postgresql
2058 protobuf-c
2059 proj))
2060 (native-inputs
2061 (list perl pkg-config))
2062 (home-page "https://postgis.net")
2063 (synopsis "Spatial database extender for PostgreSQL")
2064 (description "PostGIS is a spatial database extender for PostgreSQL
2065object-relational database. It adds support for geographic objects allowing
2066location queries to be run in SQL. This package provides a PostgreSQL
2067extension.")
2068 (license (list
2069 ;; General license
2070 license:gpl2+
2071 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
2072 license:expat
2073 ;; loader/getopt.*
2074 license:public-domain
2075 ;; doc/xsl
2076 license:bsd-3 ; files only say "BSD"
2077 ;; doc
2078 license:cc-by-sa3.0))))
2079
2080(define-public python-cf-units
2081 (package
2082 (name "python-cf-units")
2083 (version "3.3.0")
2084 (source
2085 (origin
2086 (method url-fetch)
2087 (uri (pypi-uri "cf_units" version))
2088 (sha256
2089 (base32 "1nqzlrzxwhvm7z2pl70bwlr37fz95hcm0n8v7y503krh5x4xl9r3"))))
2090 (build-system pyproject-build-system)
2091 (arguments
2092 (list
2093 #:phases
2094 #~(modify-phases %standard-phases
2095 (add-after 'unpack 'set-configure-flags
2096 (lambda _
2097 (setenv "UDUNITS2_XML_PATH"
2098 (format #f "~a/share/udunits/udunits2.xml"
2099 #$(this-package-input "udunits")))
2100 (setenv "CFLAGS"
2101 (string-join
2102 (list "-Wno-error=implicit-function-declaration"
2103 "-Wno-error=int-conversion")
2104 " "))))
2105 (replace 'check
2106 ;; To load built module and bypath error: ImportError: cannot
2107 ;; import name '_udunits2' from partially initialized module
2108 ;; 'cf_units'.
2109 (lambda* (#:key tests? test-flags #:allow-other-keys)
2110 (with-directory-excursion #$output
2111 (apply invoke "pytest" "-vv" test-flags)))))))
2112 (native-inputs
2113 (list python-cython
2114 python-pytest
2115 python-setuptools
2116 python-setuptools-scm
2117 python-wheel))
2118 (inputs
2119 (list udunits))
2120 (propagated-inputs
2121 (list python-antlr4-runtime
2122 python-cftime
2123 python-jinja2
2124 python-numpy))
2125 (home-page "https://github.com/SciTools/cf-units")
2126 (synopsis "Units of measure as required by the CF metadata conventions")
2127 (description
2128 "This package provides units of measure as required by the Climate and
2129Forecast (CF) metadata conventions. Provision of a wrapper class to support
2130Unidata/UCAR UDUNITS-2 library, and the cftime calendar functionality.")
2131 (license license:lgpl3+)))
2132
2133(define-public tegola
2134 (package
2135 (name "tegola")
2136 (version "0.21.2")
2137 (source (origin
2138 (method git-fetch)
2139 (uri (git-reference
2140 (url "https://github.com/go-spatial/tegola")
2141 (commit (string-append "v" version))))
2142 (file-name (git-file-name name version))
2143 (sha256
2144 (base32
2145 "1f5l7b372dfyibawhcnlz700z11a0dxqd7kr731nwfmhwz2v3438"))
2146 (snippet
2147 #~(begin (use-modules (guix build utils))
2148 (delete-file-recursively "vendor")))))
2149 (build-system go-build-system)
2150 (arguments
2151 (list
2152 #:install-source? #f
2153 #:import-path "github.com/go-spatial/tegola/cmd/tegola"
2154 #:unpack-path "github.com/go-spatial/tegola"
2155 #:embed-files
2156 #~(list "statscfg.json")
2157 #:build-flags
2158 #~(list (string-append "-ldflags="
2159 "-X github.com/go-spatial/tegola/internal/"
2160 "build.Version=" #$version))))
2161 (inputs
2162 (list go-cloud-google-com-go-storage
2163 go-github-com-ajstarks-svgo
2164 go-github-com-akrylysov-algnhsa
2165 go-github-com-aws-aws-sdk-go
2166 go-github-com-azure-azure-storage-blob-go
2167 go-github-com-burntsushi-toml
2168 go-github-com-dimfeld-httptreemux
2169 go-github-com-gdey-tbltest
2170 go-github-com-go-spatial-cobra
2171 go-github-com-go-spatial-geom
2172 go-github-com-go-spatial-proj
2173 go-github-com-go-test-deep
2174 go-github-com-golang-protobuf
2175 go-github-com-jackc-pgproto3-v2
2176 go-github-com-jackc-pgtype
2177 go-github-com-jackc-pgx-v4
2178 go-github-com-mattn-go-sqlite3
2179 go-github-com-mattn-goveralls
2180 go-github-com-pborman-uuid
2181 go-github-com-prometheus-client-golang
2182 go-github-com-redis-go-redis-v9
2183 go-github-com-sap-go-hdb
2184 go-github-com-theckman-goconstraint
2185 go-go-uber-org-zap
2186 go-gopkg-in-go-playground-colors-v1
2187
2188 ;; XXX: These packages have to be bootstrapped to break cycle with
2189 ;; go-google-golang-org-grpc.
2190 go-github-com-envoyproxy-go-control-plane
2191 go-github-com-envoyproxy-go-control-plane-envoy))
2192 (home-page "https://tegola.io")
2193 (synopsis "Vector tile server for maps")
2194 (description "Tegola is a free vector tile server written in Go. Tegola
2195takes geospatial data and slices it into vector tiles that can be efficiently
2196delivered to any client.")
2197 (license (list
2198 license:expat
2199 ;; Some packages in vendor have other licenses
2200 license:asl2.0
2201 license:bsd-2
2202 license:bsd-3
2203 license:wtfpl2))))
2204
2205(define-public imposm3
2206 (package
2207 (name "imposm3")
2208 (version "0.14.2")
2209 (source
2210 (origin
2211 (method git-fetch)
2212 (uri (git-reference
2213 (url "https://github.com/omniscale/imposm3")
2214 (commit (string-append "v" version))))
2215 (file-name (git-file-name name version))
2216 (sha256
2217 (base32 "1za04n0d73gqff4qmgxbn6rz2sqwnqcpyxvzjhsgfdysbx48nph6"))
2218 (snippet
2219 #~(begin (use-modules (guix build utils))
2220 (delete-file-recursively "vendor")))))
2221 (build-system go-build-system)
2222 (arguments
2223 (list
2224 #:install-source? #f
2225 #:import-path "github.com/omniscale/imposm3/cmd/imposm"
2226 #:unpack-path "github.com/omniscale/imposm3"
2227 #:build-flags
2228 #~(list (string-append "-ldflags="
2229 " -X github.com/omniscale/imposm3.Version="
2230 #$version))
2231 #:test-flags
2232 #~(list "-vet=off" ;[email protected] forces vet, but tests are not ready yet.
2233 ;; XXX: Network access or additional test data are required.
2234 ;;
2235 ;; 1. expected error with "no such host|No address associated
2236 ;; with hostname", got fetching current sequence for estimated
2237 ;; import sequence: fetching current state: Get
2238 ;; "https://unknownurl_planet.openstreetmap.org/replication/\
2239 ;; day/state.txt":
2240 ;; dial tcp: lookup unknownurl_planet.openstreetmap.org on
2241 ;; [::1]:53: read udp [::1]:60519->[::1]:53: read: connection
2242 ;; refused
2243 ;;
2244 ;; 2. opening PBF file: open
2245 ;; ../vendor/github.com/omniscale/go-osm/parser/pbf/\
2246 ;; monaco-20150428.osm.pbf:
2247 ;; no such file or directory
2248 "-skip" "TestStateFromTimestamp|TestFromPBF")
2249 #:test-subdirs
2250 #~(list "../../...") ;test the whole library
2251 #:phases
2252 #~(modify-phases %standard-phases
2253 (add-after 'unpack 'remove-integration-tests
2254 ;; XXX: Some tests require network access and the whole suite
2255 ;; fails simultaneously, check if some tests may be enabled.
2256 ;;
2257 ;; [2025-11-25T09:56:15Z] 0:00:00 dial tcp [::1]:5432: connect:
2258 ;; connection refused
2259 (lambda* (#:key unpack-path #:allow-other-keys)
2260 (delete-file-recursively
2261 (string-append "src/" unpack-path "/test")))))))
2262 (native-inputs
2263 (list go-github-com-gogo-protobuf
2264 go-github-com-jmhodges-levigo
2265 go-github-com-lib-pq
2266 go-github-com-omniscale-go-osm
2267 go-github-com-pkg-errors
2268 go-gopkg-in-yaml-v2))
2269 (inputs
2270 (list geos
2271 leveldb))
2272 (home-page "https://imposm.org/")
2273 (synopsis "OpenStreetMap importer for PostGIS")
2274 (description
2275 "Imposm is an importer for OpenStreetMap data. It reads PBF files and
2276imports the data into PostgreSQL/PostGIS databases. It is designed to create
2277databases that are optimized for rendering/tile/map-services.")
2278 (license (list license:asl2.0))))
2279
2280(define-public python-metpy
2281 (package
2282 (name "python-metpy")
2283 (version "1.7.1")
2284 (source (origin
2285 (method url-fetch)
2286 (uri (pypi-uri "metpy" version))
2287 (sha256
2288 (base32
2289 "0xfficr4jw6yn0l0nrm4yvymywd7lcp6y0acjyhr5h4bnpd8zzfd"))))
2290 (build-system pyproject-build-system)
2291 (arguments
2292 ;; Too many of the tests in the files below require online data.
2293 (list
2294 ;; tests: 752 passed, 55 skipped, 17 deselected, 1 xfailed
2295 #:test-flags
2296 #~(list "--ignore" "tests/io/test_nexrad.py"
2297 "--ignore" "tests/plots/test_declarative.py"
2298 "--ignore" "tests/io/test_gempak.py"
2299 "--ignore" "tests/io/test_gini.py"
2300 "--ignore" "tests/io/test_metar.py"
2301 "--ignore" "tests/io/test_station_data.py"
2302 "--ignore" "tests/interpolate/test_grid.py"
2303 "--ignore" "tests/interpolate/test_points.py"
2304 "--ignore" "tests/test_xarray.py"
2305 "--ignore" "tests/calc/test_indices.py"
2306 "--ignore" "tests/calc/test_kinematics.py"
2307 "-k" (string-append ; more tests that require online data
2308 "not test_parse_grid_arguments_xarray"
2309 " and not test_absolute_momentum_xarray_units_attr"
2310 " and not test_zoom_xarray"
2311 " and not test_parse_wpc_surface_bulletin"
2312 " and not test_add_timestamp_xarray"
2313 " and not test_parse_wpc_surface_bulletin_highres"
2314 " and not test_find_peaks"
2315 " and not test_find_peaks_minima"))
2316 #:phases
2317 '(modify-phases %standard-phases
2318 (add-after 'unpack 'fix-version-check
2319 (lambda _
2320 (substitute* "src/metpy/testing.py"
2321 (("^( +)match = pattern.*" m indent)
2322 (string-append indent "\
2323version_spec = re.sub('[()]', '', version_spec)\n" m)))))
2324 ;; The deprecation warning from python-future's use of imp breaks the
2325 ;; tests.
2326 (add-after 'unpack 'hide-imp-deprecation-warnings
2327 (lambda _
2328 (substitute* "pyproject.toml"
2329 (("\"ignore:numpy.ndarray size changed:RuntimeWarning\"," m)
2330 (string-append m "
2331\"ignore:the imp module is deprecated\","))))))))
2332 (propagated-inputs (list python-importlib-resources
2333 python-matplotlib
2334 python-numpy
2335 python-pandas
2336 python-pint
2337 python-pooch
2338 python-pyproj
2339 python-scipy
2340 python-traitlets
2341 python-xarray))
2342 (native-inputs
2343 (list python-netcdf4
2344 python-packaging
2345 python-pytest
2346 python-pytest-mpl
2347 python-setuptools
2348 python-wheel))
2349 (home-page "https://github.com/Unidata/MetPy")
2350 (synopsis "Collection of tools to deal with weather data")
2351 (description "MetPy is a collection of tools in Python for reading,
2352visualizing and performing calculations with weather data.")
2353 (license license:bsd-3)))
2354
2355(define-public libosmium
2356 (package
2357 (name "libosmium")
2358 (version "2.22.0")
2359 (source (origin
2360 (method git-fetch)
2361 (uri (git-reference
2362 (url "https://github.com/osmcode/libosmium")
2363 (commit (string-append "v" version))))
2364 (file-name (git-file-name name version))
2365 (sha256
2366 (base32
2367 "05djv6j3cgl2mqznycgwjbsz39imgbfhxran7l5z09x53qzdv23g"))))
2368 (build-system cmake-build-system)
2369 (propagated-inputs (list boost
2370 bzip2
2371 expat
2372 gdal
2373 geos
2374 lz4
2375 proj
2376 protozero
2377 zlib))
2378 (native-inputs (list doxygen graphviz-minimal))
2379 (home-page "https://osmcode.org/libosmium/")
2380 (synopsis "C++ library for working with OpenStreetMap data")
2381 (description
2382 "Libosmium is a fast and flexible C++ library for working with
2383OpenStreetMap data.")
2384 (license license:boost1.0)))
2385
2386(define-public osmium-tool
2387 (package
2388 (name "osmium-tool")
2389 (version "1.18.0")
2390 (source (origin
2391 (method git-fetch)
2392 (uri (git-reference
2393 (url "https://github.com/osmcode/osmium-tool")
2394 (commit (string-append "v" version))))
2395 (file-name (git-file-name name version))
2396 (sha256
2397 (base32
2398 "13zqgniyl58m9gywfsi2wagrf0gh93d850krmx1ndd6r3jzgj978"))))
2399 (build-system cmake-build-system)
2400 (inputs (list libosmium nlohmann-json))
2401 (native-inputs (list pandoc))
2402 (home-page "https://osmcode.org/osmium-tool/")
2403 (synopsis "Osmium command-line tool")
2404 (description "Command line tool for working with OpenStreetMap data
2405based on the Osmium library.")
2406 (license license:gpl3+)))
2407
2408(define-public osm2pgsql
2409 (package
2410 (name "osm2pgsql")
2411 (version "2.1.1")
2412 (source (origin
2413 (method git-fetch)
2414 (uri (git-reference
2415 (url "https://github.com/openstreetmap/osm2pgsql")
2416 (commit version)))
2417 (file-name (git-file-name name version))
2418 (sha256
2419 (base32
2420 "1plaayi3mfwpsz48abjqnw4ymvqrwzlwhb44dwfpaz02qqqhvcg6"))
2421 (modules '((guix build utils)))
2422 (snippet
2423 ;; Remove bundled libraries.
2424 '(delete-file-recursively "contrib"))))
2425 (build-system cmake-build-system)
2426 (arguments
2427 (list #:tests? #f ;tests fail because we need to setup a database
2428 #:configure-flags #~(list "-DUSE_PROJ_LIB=6" ;use API version 6
2429 "-DWITH_LUAJIT=ON"
2430 "-DEXTERNAL_LIBOSMIUM=ON"
2431 "-DEXTERNAL_PROTOZERO=ON"
2432 "-DEXTERNAL_FMT=ON")))
2433 (inputs (list boost
2434 bzip2
2435 cli11
2436 expat
2437 fmt-11
2438 libosmium
2439 luajit
2440 nlohmann-json
2441 postgresql
2442 proj
2443 protozero
2444 zlib))
2445 (native-inputs (list pandoc python python-argparse-manpage))
2446 (home-page "https://osm2pgsql.org/")
2447 (synopsis "OSM data importer to PostgreSQL")
2448 (description
2449 "Osm2pgsql is a tool for loading OpenStreetMap data into a
2450PostgreSQL / PostGIS database suitable for applications like rendering into a
2451map, geocoding with Nominatim, or general analysis.")
2452 (license license:gpl2+)))
2453
2454(define-public tippecanoe
2455 (package
2456 (name "tippecanoe")
2457 (version "2.79.0")
2458 (source
2459 (origin
2460 (method git-fetch)
2461 (uri (git-reference
2462 (url "https://github.com/felt/tippecanoe")
2463 (commit version)))
2464 (file-name (git-file-name name version))
2465 (sha256
2466 (base32 "0jfzk9sy79hf6nw0xvz6l34g3fxdpqqag8x17gcmwfanw9wa6hd0"))))
2467 (build-system gnu-build-system)
2468 (arguments
2469 (list
2470 ;; XXX: Tests are not stable, see:
2471 ;; <https://github.com/felt/tippecanoe/issues/148>.
2472 #:tests? #f
2473 #:make-flags
2474 #~(list (string-append "CC=" #$(cc-for-target))
2475 (string-append "PREFIX=" #$output))
2476 #:phases
2477 #~(modify-phases %standard-phases
2478 (delete 'configure) ;no configure script
2479 (add-after 'unpack 'patch-bash
2480 (lambda* (#:key native-inputs #:allow-other-keys)
2481 (substitute* "Makefile"
2482 (("/bin/bash")
2483 (search-input-file %build-inputs "/bin/bash"))))))))
2484 (inputs
2485 (list perl sqlite zlib))
2486 (home-page "https://github.com/mapbox/tippecanoe")
2487 (synopsis "Vector tile server for maps")
2488 (description "Tippecanoe creates scale-independent view of data, so that
2489the texture and density of features is visible at every zoom level, instead of
2490dropping features at lower levels.")
2491 (license license:bsd-2)))
2492
2493(define-public osmctools
2494 (package
2495 (name "osmctools")
2496 (version "0.9")
2497 (source
2498 (origin
2499 (method git-fetch)
2500 (uri (git-reference
2501 (url "https://gitlab.com/osm-c-tools/osmctools")
2502 (commit version)))
2503 (file-name (git-file-name name version))
2504 (sha256
2505 (base32
2506 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
2507 (build-system gnu-build-system)
2508 (arguments
2509 (list #:phases
2510 #~(modify-phases %standard-phases
2511 (add-after 'install 'wrap
2512 (lambda _
2513 (wrap-program (string-append #$output "/bin/osmupdate")
2514 `("PATH" prefix
2515 (,(string-append #$(this-package-input "wget")
2516 "/bin")))))))))
2517 (native-inputs
2518 (list autoconf automake))
2519 (inputs
2520 (list wget ;required by osmupdate
2521 zlib))
2522 (home-page "https://gitlab.com/osm-c-tools/osmctools")
2523 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
2524 (description "This project contains a few tools which are used in the
2525OpenStreetMap project. They can be used to convert, filter and update
2526OpenStreetMap data files.")
2527 (license license:agpl3)))
2528
2529(define-public osm-gps-map
2530 (package
2531 (name "osm-gps-map")
2532 (version "1.1.0")
2533 (source
2534 (origin
2535 (method url-fetch)
2536 (uri (string-append
2537 "https://github.com/nzjrs/osm-gps-map/releases/download/"
2538 version "/osm-gps-map-" version ".tar.gz"))
2539 (sha256
2540 (base32
2541 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
2542 (build-system gnu-build-system)
2543 (native-inputs
2544 (list gnome-common gtk-doc/stable pkg-config))
2545 (inputs
2546 (list cairo glib gobject-introspection gtk+ libsoup-minimal-2))
2547 (home-page "https://nzjrs.github.io/osm-gps-map/")
2548 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
2549 (description
2550 "This package provides a GTK+ widget (and Python bindings) that when
2551given GPS coordinates,draws a GPS track, and points of interest on a moving
2552map display. Downloads map data from a number of websites, including
2553@url{https://www.openstreetmap.org}.")
2554 (license license:gpl2+)))
2555
2556(define-public xygrib
2557 (package
2558 (name "xygrib")
2559 (version "1.2.6.1")
2560 (source (origin
2561 (method git-fetch)
2562 (uri (git-reference
2563 (url "https://github.com/opengribs/XyGrib")
2564 (commit (string-append "v" version))))
2565 (file-name (git-file-name name version))
2566 (sha256
2567 (base32
2568 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
2569 (patches (search-patches "xygrib-fix-finding-data.patch"
2570 "xygrib-newer-proj.patch"))
2571 (modules '((guix build utils)))
2572 (snippet
2573 '(begin
2574 (delete-file-recursively "data/fonts")
2575 ;; Fixes compilation, can be removed with the next release.
2576 ;; Upstream link: https://github.com/opengribs/XyGrib/pull/255
2577 (substitute* "src/SkewT.h"
2578 (("QMessageBox>") "QMessageBox>\n#include <QPainterPath>"))
2579 ;; Accept newer versions of openjpeg
2580 ;; https://github.com/opengribs/XyGrib/pull/298
2581 (substitute* "CMakeLists.txt"
2582 (("openjpeg-2.4") "openjpeg-2.5 openjpeg-2.4"))))))
2583 (build-system cmake-build-system)
2584 (arguments
2585 `(#:configure-flags (list "-DGNU_PACKAGE=ON")
2586 #:phases
2587 (modify-phases %standard-phases
2588 (add-after 'unpack 'patch-directories
2589 (lambda* (#:key inputs #:allow-other-keys)
2590 (let ((jpeg (assoc-ref inputs "openjpeg"))
2591 (font (assoc-ref inputs "font-liberation")))
2592 (substitute* "CMakeLists.txt"
2593 ;; Skip looking for the static library.
2594 (("\"libnova.a\"") ""))
2595 ;; Don't use the bundled font-liberation.
2596 (substitute* "src/util/Font.cpp"
2597 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
2598 (string-append "\"" font "/share/fonts/truetype/\"")))
2599 (substitute* "src/util/Util.h"
2600 (("pathData\\(\\)\\+\"data/fonts/\"")
2601 (string-append "\"" font "/share/fonts/\"")))))))
2602 #:tests? #f)) ; no tests
2603 (native-inputs
2604 (list qttools-5))
2605 (inputs
2606 (list bzip2
2607 font-liberation
2608 libnova
2609 libpng
2610 openjpeg
2611 proj
2612 qtbase-5
2613 zlib))
2614 (native-search-paths
2615 (list (search-path-specification
2616 (variable "XDG_DATA_DIRS")
2617 (files '("share")))))
2618 (synopsis "Weather Forecast Visualization")
2619 (description
2620 "XyGrib is a Grib file reader and visualizes meteorological data providing
2621an off-line capability to analyse weather forecasts or hindcasts. It is
2622intended to be used as a capable weather work station for anyone with a serious
2623interest in examining weather. This would include members of the sailing
2624community, private and sport aviators, farmers, weather buffs and many more.
2625XyGrib is the continuation of the zyGrib software package with a new team of
2626volunteers.")
2627 (home-page "https://opengribs.org")
2628 (license license:gpl3+)))
2629
2630(define-public libspatialindex
2631 (package
2632 (name "libspatialindex")
2633 (version "2.0.0")
2634 (source
2635 (origin
2636 (method url-fetch)
2637 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
2638 "releases/download/" version "/spatialindex-src-"
2639 version ".tar.bz2"))
2640 (sha256
2641 (base32
2642 "19g9h9dnb2zwmjinkg2z0gfgsjncmw8ipaqib03n6sj0mpf3z7ll"))))
2643 (build-system cmake-build-system)
2644 (home-page "https://libspatialindex.org")
2645 (synopsis "Spatial indexing library")
2646 (description "The purpose of this library is to provide:
2647
2648@itemize
2649 @item An extensible framework that will support robust spatial indexing
2650methods.
2651 @item Support for sophisticated spatial queries. Range, point location,
2652 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
2653by spatial constraints) should be easy to deploy and run.
2654 @item Easy to use interfaces for inserting, deleting and updating information.
2655 @item Wide variety of customization capabilities. Basic index and storage
2656characteristics like the page size, node capacity, minimum fan-out, splitting
2657algorithm, etc. should be easy to customize.
2658 @item Index persistence. Internal memory and external memory structures
2659should be supported. Clustered and non-clustered indices should be easy to be
2660persisted.
2661@end itemize
2662")
2663 (license license:expat)))
2664
2665(define-public libmo-unpack
2666 (package
2667 (name "libmo-unpack")
2668 (version "3.1.2")
2669 (source
2670 (origin
2671 (method git-fetch)
2672 (uri (git-reference
2673 (url "https://github.com/SciTools/libmo_unpack")
2674 (commit (string-append "v" version))))
2675 (file-name (git-file-name name version))
2676 (sha256
2677 (base32 "14das3rrha3mlw1p57nn67sg22yig0jnmf86w8jqvj98v06f5xl3"))))
2678 (build-system cmake-build-system)
2679 (arguments (list #:out-of-source? #t))
2680 (native-inputs (list cmake-minimal check))
2681 (home-page "https://github.com/SciTools/libmo_unpack")
2682 (synopsis "Handle WGDOS and RLE compression schemes")
2683 (description
2684 "This package provides a library for handling the WGDOS and RLE
2685compression schemes used in UM files.")
2686 (license license:bsd-3)))
2687
2688(define-public libmseed
2689 (package
2690 (name "libmseed")
2691 (version "3.5.4")
2692 (source (origin
2693 (method git-fetch)
2694 (uri (git-reference
2695 (url "https://github.com/EarthScope/libmseed")
2696 (commit (string-append "v" version))))
2697 (file-name (git-file-name name version))
2698 (sha256
2699 (base32
2700 "1ysxh2vgpwwr0phd6qfdyhd1hf43sic1maf37f8y6h04p28xa08q"))))
2701 (build-system gnu-build-system)
2702 (arguments
2703 (list #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
2704 (string-append "PREFIX=" #$output))
2705 #:phases #~(modify-phases %standard-phases
2706 (delete 'configure))))
2707 (home-page "https://earthscope.github.io/libmseed/")
2708 (synopsis "Library for the miniSEED data format")
2709 (description "The miniSEED library provides a framework for manipulation
2710of SEED data records, a format for commonly used for seismological time
2711series and related data. The library includes the functionality to read
2712and write data records, in addition to reconstructing time series
2713from multiple records.")
2714 (license license:asl2.0)))
2715
2716(define-public python-rtree
2717 (package
2718 (name "python-rtree")
2719 (version "1.4.1")
2720 (source
2721 (origin
2722 (method url-fetch)
2723 (uri (pypi-uri "rtree" version))
2724 (sha256
2725 (base32 "0ijyhw8giab5824ppcrhkks9pkc7zkzczihcafz7xrc111av7cf6"))))
2726 (build-system pyproject-build-system)
2727 (arguments
2728 `(#:phases
2729 (modify-phases %standard-phases
2730 (add-after 'unpack 'find-libspatialindex
2731 (lambda* (#:key inputs #:allow-other-keys)
2732 (let ((libspatialindex (assoc-ref inputs "libspatialindex")))
2733 (substitute* "rtree/finder.py"
2734 (("find_library\\(\"spatialindex_c\"\\)")
2735 (string-append "\"" libspatialindex
2736 "/lib/libspatialindex_c.so\"")))))))))
2737 (native-inputs
2738 (list python-numpy python-pytest python-setuptools python-wheel))
2739 (inputs
2740 (list libspatialindex))
2741 (home-page "https://github.com/Toblerity/rtree")
2742 (synopsis "R-Tree spatial index for Python GIS")
2743 (description
2744 "RTree is a Python package with bindings for @code{libspatialindex}.")
2745 (license license:expat)))
2746
2747(define-public python-scitools-iris
2748 (package
2749 (name "python-scitools-iris")
2750 (version "3.15.0")
2751 (source
2752 (origin
2753 (method git-fetch)
2754 (uri (git-reference
2755 (url "https://github.com/SciTools/iris")
2756 (commit (string-append "v" version))))
2757 (file-name (git-file-name name version))
2758 (sha256
2759 (base32 "13kgs0ahjr3swl352nss62qbpjb1xpmlwl9w6w1qfn291i3yh0dx"))))
2760 (build-system pyproject-build-system)
2761 (arguments
2762 (list
2763 ;; tests: 10420 passed, 81 skipped, 2712 warnings
2764 #:test-flags
2765 #~(list "--numprocesses" (number->string (parallel-job-count))
2766 "--pyargs" "iris"
2767 "-k" (string-join
2768 ;; Tests requiring network access.
2769 (list "not test_2d_coord_bounds_northpolarstereo"
2770 "test_2d_coord_bounds_platecarree"
2771 "test_2d_coords_contour"
2772 "test_2d_plain_latlon"
2773 "test_2d_plain_latlon_on_polar_map"
2774 "test_2d_rotated_latlon"
2775 "test_4d_global_proj_brazil"
2776 "test_circular_changes"
2777 "test_coord_coord_map"
2778 "test_coord_names"
2779 "test_coords"
2780 "test_default"
2781 "test_global_proj_china"
2782 "test_global_proj_russia"
2783 "test_mask_cube_from_shapefile_depreciation"
2784 "test_missing_cs"
2785 "test_plot_tmerc"
2786 "test_python_versions"
2787 "test_rotated_pole_proj_germany_weighted_area"
2788 "test_rotated_pole_proj_uk"
2789 "test_scatter"
2790 "test_simple"
2791 "test_transverse_mercator_proj_uk")
2792 " and not "))
2793 #:phases
2794 #~(modify-phases %standard-phases
2795 (add-after 'unpack 'fix-paths
2796 (lambda* (#:key inputs #:allow-other-keys)
2797 (let ((netcdf-bin (dirname
2798 (search-input-file inputs "bin/ncgen"))))
2799 (substitute* (list "lib/iris/tests/__init__.py"
2800 "lib/iris/tests/_shared_utils.py"
2801 "lib/iris/tests/stock/netcdf.py")
2802 (("env_bin_path\\(\"ncgen\"\\)")
2803 (format #f "'~a/ncgen'" netcdf-bin))
2804 (("env_bin_path\\(\"ncdump\"\\)")
2805 (format #f "'~a/ncdump'" netcdf-bin))))))
2806 (add-before 'check 'pre-check
2807 (lambda* (#:key inputs tests? #:allow-other-keys)
2808 (when tests?
2809 (setenv "HOME" "/tmp")
2810 (setenv "TMP_DIR" "/tmp")
2811 (setenv "OVERRIDE_TEST_DATA_REPOSITORY"
2812 (search-input-directory inputs "share/iris/test_data"))
2813 (delete-file-recursively "lib")))))))
2814 (native-inputs
2815 (list netcdf ; for ncdump and ncgen
2816 nss-certs-for-test
2817 python-distributed
2818 python-filelock
2819 python-imagehash
2820 python-pytest
2821 python-pytest-mock
2822 python-pytest-xdist
2823 python-setuptools
2824 python-setuptools-scm
2825 specification-iris-test-data))
2826 (propagated-inputs
2827 (list python-cartopy
2828 python-cf-units
2829 python-cftime
2830 python-dask
2831 python-matplotlib
2832 python-netcdf4
2833 python-numpy
2834 python-pyproj
2835 python-scipy
2836 python-shapely
2837 python-xxhash
2838 ;; [optional]
2839 python-affine
2840 ;; python-esmpy ;not packaged yet in Guix
2841 ;; python-geovista ;not packaged yet in Guix
2842 python-graphviz
2843 python-iris-sample-data
2844 ;; python-nc-time-axis ;not packaged yet in Guix
2845 python-pandas
2846 ;; python-stratify ;not packaged yet in Guix
2847 python-rasterio
2848 python-scitools-mo-pack))
2849 (home-page "https://github.com/SciTools/iris")
2850 (synopsis "Earth science data analysing and visualising library")
2851 (description
2852 "Iris is a Python library for analysing and visualising Earth science
2853data. It excels when working with multi-dimensional Earth Science data, where
2854tabular representations become unwieldy and inefficient. Iris implements a
2855data model based on the CF conventions.")
2856 (license license:lgpl3+)))
2857
2858(define-public python-iris-sample-data
2859 (package
2860 (name "python-iris-sample-data")
2861 (version "2.5.2")
2862 (source
2863 (origin
2864 (method git-fetch)
2865 (uri (git-reference
2866 (url "https://github.com/SciTools/iris-sample-data")
2867 (commit (string-append "v" version))))
2868 (file-name (git-file-name name version))
2869 (sha256
2870 (base32 "0fc1d851rh9rrfi7sjcwpw7nh894caw3ra6nsfl8qk501scl74a6"))))
2871 (build-system pyproject-build-system)
2872 (arguments
2873 (list
2874 #:tests? #f ;no tests
2875 #:phases
2876 #~(modify-phases %standard-phases
2877 (add-after 'unpack 'patch-manifest.in
2878 ;; See: <https://codeberg.org/guix/guix/issues/4393>.
2879 (lambda* (#:key name source inputs #:allow-other-keys)
2880 (let ((port (open-file "MANIFEST.in" "w")))
2881 (for-each
2882 (lambda (file)
2883 (display "include " port)
2884 (display file port)
2885 (display "\n" port))
2886 (find-files "iris_sample_data"))
2887 (close port)))))) )
2888 (native-inputs
2889 (list python-setuptools
2890 python-setuptools-scm))
2891 (home-page "https://github.com/SciTools/iris-sample-data")
2892 (synopsis "Iris sample data")
2893 (description
2894 "This ppackage provides a store for the data used in the Iris examples.")
2895 (license license:ogl-psi1.0)))
2896
2897(define-public python-scitools-mo-pack
2898 (package
2899 (name "python-scitools-mo-pack")
2900 (version "0.3.1")
2901 (source
2902 (origin
2903 (method git-fetch)
2904 (uri (git-reference
2905 (url "https://github.com/SciTools/mo_pack")
2906 (commit (string-append "v" version))))
2907 (file-name (git-file-name name version))
2908 (sha256
2909 (base32 "0zg6vsicvx1yxw0vky71dax3nnfk8yl6li4vnwvd50smxm3lv6hj"))))
2910 (build-system pyproject-build-system)
2911 (arguments
2912 (list
2913 #:test-flags #~(list "src/mo_pack/tests")
2914 #:phases
2915 #~(modify-phases %standard-phases
2916 (add-before 'compile-bytecode 'cleanup-installed-tests
2917 (lambda* (#:key inputs outputs #:allow-other-keys)
2918 (let ((site (site-packages inputs outputs)))
2919 (delete-file-recursively
2920 (string-append site "/mo_pack/tests")))
2921 (for-each delete-file
2922 (list "src/mo_pack/__init__.py"
2923 "src/mo_pack/_version.py")))))))
2924 (native-inputs
2925 (list python-cython
2926 python-pytest
2927 python-setuptools
2928 python-setuptools-scm))
2929 (inputs (list libmo-unpack))
2930 (propagated-inputs (list python-numpy))
2931 (home-page "https://github.com/SciTools/mo_pack")
2932 (synopsis "Python wrapper for @code{libmo_unpack}")
2933 (description
2934 "This package provide Python bindings to the C library
2935@code{libmo_unpack} which contains packing methods used to encode and decode
2936the data payloads of Met Office UM Post-Processing and Fields files.")
2937 (license license:bsd-3)))
2938
2939(define-public java-jmapviewer
2940 (package
2941 (name "java-jmapviewer")
2942 (version "2.22")
2943 (source (origin
2944 (method url-fetch)
2945 (uri (string-append "https://josm.openstreetmap.de/osmsvn/"
2946 "/applications/viewer/jmapviewer/releases/"
2947 version "/JMapViewer-" version "-Source.zip"))
2948 (sha256
2949 (base32
2950 "0lq82yyancaswjb9fammjl1jicvdbijjz86bz94dy2v9zm62zq5b"))))
2951 (build-system ant-build-system)
2952 (native-inputs
2953 (list unzip))
2954 (arguments
2955 `(#:build-target "pack"
2956 #:tests? #f; No tests
2957 #:phases
2958 (modify-phases %standard-phases
2959 (add-before 'build 'clean
2960 (lambda* _
2961 (invoke "ant" "clean")))
2962 (replace 'install
2963 (lambda* (#:key outputs #:allow-other-keys)
2964 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
2965 (mkdir-p dir)
2966 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
2967 #t))))))
2968 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
2969 (synopsis "OSM map integration in Java")
2970 (description "JMapViewer is a Java component which easily
2971integrates an OSM map view into your Java application. It is maintained as
2972an independent project by the JOSM team.")
2973 (license license:gpl2)))
2974
2975(define-public java-opening-hours-parser
2976 (package
2977 (name "java-opening-hours-parser")
2978 (version "0.27.0")
2979 (source (origin
2980 (method git-fetch)
2981 (uri (git-reference
2982 (url "https://github.com/simonpoole/OpeningHoursParser")
2983 (commit version)))
2984 (file-name (git-file-name name version))
2985 (sha256
2986 (base32
2987 "1sw5ccxqw4ly5hzxnnljjqx4876gyvagi10sg8r9w25n211lq0x4"))))
2988 (build-system ant-build-system)
2989 (arguments
2990 `(#:jar-name "java-opening-hours-parser.jar"
2991 #:source-dir "src/main/java"
2992 #:test-exclude (list "**/IndividualTest.java")
2993 #:phases
2994 (modify-phases %standard-phases
2995 (add-before 'build 'copy-resources
2996 (lambda _
2997 (copy-recursively "src/main/resources" "build/classes")
2998 #t))
2999 (add-before 'build 'generate-parser
3000 (lambda* _
3001 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
3002 (file (string-append dir "/OpeningHoursParser.jj")))
3003 (invoke "javacc" "-DEBUG_PARSER=false"
3004 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
3005 "-GRAMMAR_ENCODING=UTF-8"
3006 (string-append "-OUTPUT_DIRECTORY=" dir)
3007 file)))))))
3008 (inputs
3009 (list java-jetbrains-annotations))
3010 (native-inputs
3011 (list javacc java-junit java-hamcrest-core))
3012 (home-page "https://github.com/simonpoole/OpeningHoursParser")
3013 (synopsis "Java parser for the OpenStreetMap opening hour format")
3014 (description "This is a very simplistic parser for string values according
3015to the OSM opening hours specification.")
3016 (license license:expat)))
3017
3018(define-public josm
3019 (package
3020 (name "josm")
3021 (version "19555")
3022 (source (origin
3023 (method svn-fetch)
3024 (uri (svn-reference
3025 (url "https://josm.openstreetmap.de/svn/trunk")
3026 (revision (string->number version))
3027 (recursive? #f)))
3028 (sha256
3029 (base32
3030 "0kpshdj8kf9ag7h1qqrh9jqc6c9iv8v369mk60a8g7cbzf0xpblw"))
3031 (file-name (string-append name "-" version "-checkout"))
3032 (modules '((guix build utils)))
3033 (snippet
3034 '(begin
3035 (for-each delete-file (find-files "." ".*.jar$"))
3036 #t))))
3037 (build-system ant-build-system)
3038 (native-inputs
3039 (list javacc))
3040 (inputs
3041 (list java-commons-jcs
3042 java-commons-compress
3043 java-jmapviewer
3044 java-jakarta-annotations-api
3045 java-jakarta-json
3046 java-jsr305
3047 java-metadata-extractor
3048 java-opening-hours-parser
3049 java-parsson ; runtime dependency
3050 java-signpost-core
3051 java-svg-salamander
3052 openjdk17))
3053 (arguments
3054 `(#:tests? #f
3055 #:jar-name "josm.jar"
3056 #:jdk ,openjdk17
3057 #:phases
3058 (modify-phases %standard-phases
3059 (add-after 'unpack 'rm-build.xml
3060 (lambda* _
3061 (delete-file "build.xml")
3062 #t))
3063 (add-before 'build 'fix-revision
3064 (lambda* _
3065 (with-output-to-file "REVISION.XML"
3066 (lambda _
3067 (display
3068 (string-append "<info><entry><commit revision=\"" ,version "\">"
3069 "<date>1970-01-01 00:00:00 +0000</date>"
3070 "</commit></entry></info>"))))
3071 #t))
3072 (add-before 'build 'fix-classpath
3073 (lambda* (#:key inputs #:allow-other-keys)
3074 (setenv "CLASSPATH"
3075 (string-join
3076 (filter
3077 (lambda (s)
3078 (let ((source (assoc-ref inputs "source")))
3079 (not (equal? (substring s 0 (string-length source))
3080 source))))
3081 (string-split (getenv "CLASSPATH") #\:))
3082 ":"))
3083 #t))
3084 (add-before 'build 'generate-parser
3085 (lambda* _
3086 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
3087 (out (string-append dir "/parsergen"))
3088 (file (string-append dir "/MapCSSParser.jj")))
3089 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
3090 (invoke "javacc" "-DEBUG_PARSER=false"
3091 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
3092 "-GRAMMAR_ENCODING=UTF-8"
3093 (string-append "-OUTPUT_DIRECTORY=" out)
3094 file))
3095 #t))
3096 (add-after 'build 'generate-epsg
3097 (lambda _
3098 (system* "javac" "scripts/BuildProjectionDefinitions.java"
3099 "-cp" "build/classes")
3100 (mkdir-p "resources/data/projection")
3101 (with-output-to-file "resources/data/projection/custom-epsg"
3102 (lambda _ (display "")))
3103 (mkdir-p "data/projection")
3104 (with-output-to-file "data/projection/custom-epsg"
3105 (lambda _ (display "")))
3106 (invoke "java" "-cp" "build/classes:scripts:."
3107 "BuildProjectionDefinitions" ".")
3108 #t))
3109 (add-after 'generate-epsg 'copy-resources
3110 (lambda _
3111 (copy-recursively "resources" "build/classes")
3112 #t))
3113 (add-before 'install 'regenerate-jar
3114 (lambda _
3115 ;; We need to regenerate the jar file to add data.
3116 (delete-file "build/jar/josm.jar")
3117 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
3118 "build/classes" ".")
3119 #t))
3120 (add-before 'build 'copy-revision
3121 (lambda _
3122 (mkdir-p "build/classes")
3123 (with-output-to-file "build/classes/REVISION"
3124 (lambda _
3125 (display
3126 (string-append "Revision: " ,version "\n"
3127 "Is-Local-Build: true\n"
3128 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
3129 #t))
3130 (add-after 'install 'install-share-directories
3131 (lambda* (#:key outputs #:allow-other-keys)
3132 (let ((out (assoc-ref outputs "out"))
3133 (share-directories '("applications" "icons" "man" "menu"
3134 "metainfo" "mime" "pixmaps"))
3135 (desktop "org.openstreetmap.josm.desktop"))
3136 (for-each (lambda (directory)
3137 (copy-recursively (string-append
3138 "native/linux/tested/usr/share/"
3139 directory)
3140 (string-append
3141 out "/share/" directory)))
3142 share-directories)
3143 (substitute* (string-append out "/share/applications/" desktop)
3144 (("josm-MainApplication") "josm-gui-MainApplication")))
3145 #t))
3146 (add-after 'install 'install-bin
3147 (lambda* (#:key outputs inputs #:allow-other-keys)
3148 (let* ((out (assoc-ref outputs "out"))
3149 (bin (string-append out "/bin")))
3150 (mkdir-p bin)
3151 (with-output-to-file (string-append bin "/josm")
3152 (lambda _
3153 (display
3154 (string-append "#!/bin/sh\n"
3155 "_JAVA_AWT_WM_NONREPARENTING=1 "
3156 (assoc-ref inputs "openjdk") "/bin/java"
3157 " -cp " out "/share/java/josm.jar:"
3158 ;; CLASSPATH, but remove native inputs
3159 (string-join
3160 (filter
3161 (lambda (jar)
3162 (and (not (string-contains jar "-jdk/"))
3163 (not (string-contains jar "-javacc-"))))
3164 (string-split (getenv "CLASSPATH") #\:))
3165 ":")
3166 " --add-exports=java.base/sun.security.action=ALL-UNNAMED"
3167 " --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED"
3168 " --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED"
3169 " org.openstreetmap.josm.gui.MainApplication"))))
3170 (chmod (string-append bin "/josm") #o755))
3171 #t)))))
3172 (home-page "https://josm.openstreetmap.de")
3173 (synopsis "OSM editor")
3174 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
3175supports loading GPX tracks, background imagery and OSM data from local
3176sources as well as from online sources and allows editing the OSM data (nodes,
3177ways, and relations) and their metadata tags.")
3178 (license license:gpl2+)))
3179
3180(define-public libmaxminddb
3181 (package
3182 (name "libmaxminddb")
3183 (version "1.6.0")
3184 (source
3185 (origin
3186 (method url-fetch)
3187 (uri (string-append "https://github.com/maxmind/libmaxminddb"
3188 "/releases/download/" version "/"
3189 "/libmaxminddb-" version ".tar.gz"))
3190 (sha256
3191 (base32 "0rw2z7rx8jzgdcgqlmc4wqrsjmiwd8vm5wvvrldy472rghcaq83n"))))
3192 (build-system gnu-build-system)
3193 (arguments
3194 `(#:make-flags
3195 (list ,(string-append "CC=" (cc-for-target)))))
3196 (native-inputs
3197 (list perl))
3198 (home-page "https://maxmind.github.io/libmaxminddb/")
3199 (synopsis "C library for the MaxMind DB file format")
3200 (description "The libmaxminddb library provides a C library for reading
3201MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
3202format is a custom, but open, binary format designed to facilitate fast
3203lookups of IP addresses while allowing flexibility in the type of data
3204associated with an address.")
3205 (license license:asl2.0)))
3206
3207(define-public python-maxminddb
3208 (package
3209 (name "python-maxminddb")
3210 (version "2.6.3")
3211 (source
3212 (origin
3213 (method url-fetch)
3214 (uri (pypi-uri "maxminddb" version))
3215 (sha256
3216 (base32 "0m6j8pvarnw4d88537ghi1gl7nskwgkijx5c3fm4g83sm9mq1hyj"))))
3217 (build-system pyproject-build-system)
3218 (native-inputs
3219 (list python-pytest
3220 python-setuptools
3221 python-wheel))
3222 (inputs
3223 (list libmaxminddb))
3224 (home-page "https://www.maxmind.com/")
3225 (synopsis "Reader for the MaxMind DB format")
3226 (description "MaxMind DB is a binary file format that stores data indexed
3227by IP address subnets (IPv4 or IPv6). This is a Python module for reading
3228MaxMind DB files.")
3229 (license license:asl2.0)))
3230
3231(define-public python-geoip2
3232 (package
3233 (name "python-geoip2")
3234 (version "4.8.0")
3235 (source
3236 (origin
3237 (method url-fetch)
3238 (uri (pypi-uri "geoip2" version))
3239 (sha256
3240 (base32
3241 "0ddcm6a0f5xr66r84hpn6jr6b7hl77axb0d41qj285ylny0c376x"))))
3242 (build-system pyproject-build-system)
3243 (arguments
3244 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
3245 (inputs
3246 (list python-maxminddb
3247 python-requests
3248 python-aiohttp))
3249 (native-inputs
3250 (list python-setuptools python-wheel))
3251 (home-page "https://www.maxmind.com/")
3252 (synopsis "MaxMind GeoIP2 API")
3253 (description "Provides an API for the GeoIP2 web services and databases.
3254The API also works with MaxMind’s free GeoLite2 databases.")
3255 (license license:asl2.0)))
3256
3257(define-public routino
3258 (package
3259 (name "routino")
3260 (version "3.4.3")
3261 (source (origin
3262 (method url-fetch)
3263 (uri (string-append "https://www.routino.org/download/routino-"
3264 version ".tgz"))
3265 (sha256
3266 (base32
3267 "0m0yq665sdsiikbl0win564d841wb87prsfni8wajz6969yhdfjf"))))
3268 (build-system gnu-build-system)
3269 (native-inputs (list perl))
3270 (inputs (list bzip2 xz zlib))
3271 (arguments
3272 (list #:test-target "test"
3273 #:phases #~(modify-phases %standard-phases
3274 (replace 'configure
3275 (lambda* (#:key outputs #:allow-other-keys)
3276 (substitute* "Makefile.conf"
3277 (("prefix=/usr/local")
3278 (string-append "prefix="
3279 (assoc-ref outputs "out")))
3280 (("LDFLAGS_LDSO=-Wl,-R\\.")
3281 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
3282 (("#CFLAGS\\+=-DUSE_XZ")
3283 "CFLAGS+=-DUSE_XZ")
3284 (("#LDFLAGS\\+=-llzma")
3285 "LDFLAGS+=-llzma")))))))
3286 (synopsis "Routing application for OpenStreetMap data")
3287 (description
3288 "Routino is an application for finding a route between two points
3289using the dataset of topographical information collected by
3290@url{https://www.OpenStreetMap.org}.")
3291 (home-page "https://www.routino.org/")
3292 (license license:agpl3+)))
3293
3294(define-public r-rnaturalearthhires
3295 (let ((commit "c3785a8c44738de6ae8f797080c0a337ebed929d")
3296 (revision "1"))
3297 (package
3298 (name "r-rnaturalearthhires")
3299 (version (git-version "0.2.1" revision commit))
3300 (source (origin
3301 (method git-fetch)
3302 (uri (git-reference
3303 (url "https://github.com/ropensci/rnaturalearthhires")
3304 (commit commit)))
3305 (file-name (git-file-name name version))
3306 (sha256
3307 (base32
3308 "1fr0yb2fbr9zbk7gqr3rnzz2w4ijjpl6hlzdrh4n27lf0ip3h0cx"))))
3309 (properties `((upstream-name . "rnaturalearthhires")))
3310 (build-system r-build-system)
3311 (propagated-inputs (list r-sp))
3312 (native-inputs (list r-knitr))
3313 (home-page "https://github.com/ropensci/rnaturalearthhires")
3314 (synopsis
3315 "High Resolution World Vector Map Data from Natural Earth used in rnaturalearth")
3316 (description
3317 "Facilitates mapping by making natural earth map data from http://
3318www.naturalearthdata.com/ more easily available to R users. Focuses on vector
3319data.")
3320 (license license:cc0))))
3321
3322(define-public qmapshack
3323 (package
3324 (name "qmapshack")
3325 (version "1.18.0")
3326 (source
3327 (origin
3328 (method git-fetch)
3329 (uri (git-reference
3330 (url "https://github.com/Maproom/qmapshack")
3331 (commit (string-append "V_" version))))
3332 (file-name (git-file-name name version))
3333 (sha256
3334 (base32 "04r2m7qwzqwgnwhi15999n0w7fmddjcmdv8mxm8c0flrjw8zmkpq"))))
3335 (build-system qt-build-system)
3336 (native-inputs
3337 (list pkg-config))
3338 (inputs
3339 (list gdal
3340 libjpeg-turbo
3341 proj
3342 qt5compat
3343 qtpositioning
3344 qttools
3345 qtwebengine
3346 quazip
3347 routino))
3348 (arguments
3349 (list
3350 #:qtbase qtbase
3351 #:tests? #f ;no tests
3352 #:phases
3353 #~(modify-phases %standard-phases
3354 (add-after 'unpack 'fix-cmake-modules
3355 (lambda _
3356 (substitute* "CMakeLists.txt"
3357 (("find_package\\(Qt6PrintSupport REQUIRED\\)" all)
3358 (string-append all "\nfind_package(Qt6Positioning REQUIRED)")))
3359 (substitute* "cmake/Modules/FindROUTINO.cmake"
3360 (("/usr/local")
3361 #$(this-package-input "routino"))))))))
3362 (synopsis "GPS mapping application")
3363 (description
3364 "QMapShack can be used to plan your next outdoor trip or to visualize and
3365archive all the GPS recordings of your past trips. It is the successor of the
3366QLandkarte GT application.")
3367 (home-page "https://github.com/Maproom/qmapshack/wiki")
3368 (license license:gpl3+)))
3369
3370(define-public readosm
3371 (package
3372 (name "readosm")
3373 (version "1.1.0a")
3374 (source
3375 (origin
3376 (method url-fetch)
3377 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
3378 "readosm-" version ".tar.gz"))
3379 (sha256
3380 (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
3381 (build-system gnu-build-system)
3382 (inputs
3383 (list expat zlib))
3384 (synopsis "Data extractor for OpenStreetMap files")
3385 (description
3386 "ReadOSM is a library to extract valid data from within an OpenStreetMap
3387input file (in @code{.osm} or @code{.osm.pbf} format).")
3388 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
3389 (license (list license:gpl2+
3390 license:lgpl2.1+
3391 license:mpl1.1))))
3392
3393(define-public shapelib
3394 (package
3395 (name "shapelib")
3396 (version "1.6.1")
3397 (source
3398 (origin
3399 (method git-fetch)
3400 (uri (git-reference
3401 (url "https://github.com/OSGeo/shapelib")
3402 (commit (string-append "v" version))))
3403 (file-name (git-file-name name version))
3404 (sha256
3405 (base32 "0l67gp1618lcw7fg2iclbh016cqyw85s3cmd3qzx6aw0jq19hj8n"))))
3406 (build-system gnu-build-system)
3407 (native-inputs
3408 (list autoconf automake libtool))
3409 (home-page "http://shapelib.maptools.org/")
3410 (synopsis "Provides C library to write and update ESRI Shapefiles")
3411 (description
3412 "The Shapefile C Library provides the ability to write simple C programs
3413for reading, writing and updating (to a limited extent) ESRI Shapefiles, and
3414the associated attribute file (@file{.dbf}).")
3415 (license license:gpl2+)))
3416
3417(define-public spatialite-tools
3418 (package
3419 (name "spatialite-tools")
3420 (version "5.1.0a")
3421 (source
3422 (origin
3423 (method url-fetch)
3424 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
3425 "spatialite-tools-sources/"
3426 "spatialite-tools-" version ".tar.gz"))
3427 (sha256
3428 (base32 "1kh1amab452m3801knmpn1jcg27axakb90gd8fxwv240irsk97hi"))))
3429 (build-system gnu-build-system)
3430 (native-inputs
3431 (list pkg-config))
3432 (inputs
3433 (list expat
3434 freexl
3435 geos
3436 librttopo
3437 libspatialite
3438 libxml2
3439 minizip
3440 proj
3441 readosm
3442 sqlite))
3443 (synopsis "Collection of command line tools for SpatiaLite")
3444 (description
3445 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
3446tools supporting SpatiaLite.")
3447 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
3448 (license license:gpl3+)))
3449
3450(define-public virtualpg
3451 (package
3452 (name "virtualpg")
3453 (version "2.0.1")
3454 (source
3455 (origin
3456 (method url-fetch)
3457 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
3458 "virtualpg-" version ".tar.gz"))
3459 (sha256
3460 (base32 "12z0l7368r4116ljzg7nljy5hf425r11vxc540w79wlzikmynamy"))))
3461 (build-system gnu-build-system)
3462 (inputs
3463 (list postgresql sqlite))
3464 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
3465 (description
3466 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
3467the VirtualPostgres driver, allowing to directly exchange data between SQLite
3468and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
3469exchanged form one Spatial DBMS and the other.")
3470 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
3471 (license (list license:gpl2+
3472 license:lgpl2.1+
3473 license:mpl1.1))))
3474
3475(define-public opencpn
3476 (package
3477 (name "opencpn")
3478 (version "5.12.2")
3479 (source
3480 (origin
3481 (method git-fetch)
3482 (uri (git-reference
3483 (url "https://github.com/OpenCPN/OpenCPN")
3484 (commit (string-append "Release_" version))))
3485 (file-name (git-file-name name version))
3486 (sha256
3487 (base32 "0w57zcq1rpx3cfhcqjqw25wiz1pi6lx7xnif511vr4plvzqdx8yd"))))
3488 (build-system cmake-build-system)
3489 (native-inputs
3490 (list gettext-minimal git-minimal/pinned googletest pkg-config))
3491 (inputs
3492 (list alsa-utils
3493 bzip2
3494 cairo
3495 curl
3496 eudev
3497 glew
3498 glu
3499 gtk+
3500 jasper
3501 libarchive
3502 libelf
3503 libexif
3504 libjpeg-turbo
3505 libsndfile
3506 libusb
3507 lz4
3508 mesa
3509 openssl
3510 pango
3511 portaudio
3512 rapidjson
3513 shapelib
3514 sqlite
3515 tinyxml
3516 wxsvg
3517 wxwidgets
3518 xz
3519 zlib))
3520 (arguments
3521 `(#:configure-flags '("-DOCPN_USE_BUNDLED_LIBS=OFF"
3522 "-DOCPN_ENABLE_PORTAUDIO=ON"
3523 "-DOCPN_ENABLE_SNDFILE=ON"
3524 "-DOCPN_BUNDLE_TCDATA=ON"
3525 "-DOCPN_BUNDLE_GSHHS=ON")
3526 #:tests? #f ; No tests defined
3527 #:phases
3528 (modify-phases %standard-phases
3529 (add-after 'unpack 'fix-build
3530 (lambda* (#:key inputs #:allow-other-keys)
3531 (substitute* "CMakeLists.txt"
3532 (("wx-32.c; cc")
3533 "wx-32.c; gcc")
3534 (("\"/bin/sh\" \"-c\"")
3535 (string-append "\"" (which "bash") "\" \"-c\""))
3536 (("include\\(TargetSetup\\)")
3537 "set(PKG_TARGET \"guix\")\nset(PKG_TARGET_VERSION 1)")))))))
3538 (synopsis "Chart plotter and marine GPS navigation software")
3539 (description
3540 "OpenCPN is a chart plotter and marine navigation software designed to be
3541used at the helm station of your boat while underway. Chart a course and
3542track your position right from your laptop.")
3543 (home-page "https://opencpn.org/")
3544 (license (list license:asl2.0
3545 license:cc0
3546 license:bsd-2
3547 license:bsd-3
3548 license:expat
3549 license:gpl3+
3550 license:lgpl2.1+
3551 license:lgpl3+
3552 license:sgifreeb2.0
3553 license:zlib))))
3554
3555(define-public openorienteering-mapper
3556 (package
3557 (name "openorienteering-mapper")
3558 (version "0.9.5")
3559 (source (origin
3560 (method git-fetch)
3561 (uri (git-reference
3562 (url "https://github.com/OpenOrienteering/mapper")
3563 (commit (string-append "v" version))))
3564 (file-name (git-file-name name version))
3565 (sha256
3566 (base32
3567 "11b578h8f3q9yvphbjhqmy2w1cfc9skslzawypqmc3k44v24aj0s"))))
3568 (build-system cmake-build-system)
3569 (arguments
3570 `(#:tests? #f
3571 #:configure-flags
3572 (list
3573 "-DLICENSING_PROVIDER:BOOL=OFF"
3574 "-DMapper_MANUAL_QTHELP:BOOL=OFF")))
3575 (inputs
3576 (list clipper
3577 cups
3578 curl
3579 gdal
3580 proj
3581 qtbase-5
3582 qtimageformats-5
3583 qtlocation-5
3584 qtsensors-5
3585 zlib))
3586 (native-inputs
3587 (list doxygen
3588 qttools-5))
3589 (home-page "https://www.openorienteering.org/apps/mapper/")
3590 (synopsis "OpenOrienteering Mapper (OOM)")
3591 (description
3592 "OpenOrienteering Mapper is a software for creating maps for the
3593orienteering sport.")
3594 (license license:gpl3+)))
3595
3596(define-public grass
3597 (let* ((version "8.4.1")
3598 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
3599 (grassxx (string-append "grass" majorminor)))
3600 (package
3601 (name "grass")
3602 (version version)
3603 (source
3604 (origin
3605 (method url-fetch)
3606 (uri (string-append "https://grass.osgeo.org/" grassxx
3607 "/source/grass-" version ".tar.gz"))
3608 (sha256
3609 (base32 "0r08vdi1s0mpa033bqbc9kc3116qm53bmx2k7l8dgg69wxkwyzfi"))))
3610 (build-system gnu-build-system)
3611 (arguments
3612 (list
3613 #:tests? #f ; No tests
3614 #:modules `((guix build gnu-build-system)
3615 ((guix build pyproject-build-system) #:prefix python:)
3616 (guix build utils))
3617 #:imported-modules %pyproject-build-system-modules
3618 #:configure-flags
3619 #~(list "--with-blas"
3620 "--with-bzlib"
3621 (string-append
3622 "--with-freetype-includes="
3623 (search-input-directory %build-inputs "/include/freetype2"))
3624 (string-append
3625 "--with-freetype-libs="
3626 (dirname
3627 (search-input-file %build-inputs "/lib/libfreetype.so")))
3628 "--with-geos"
3629 "--with-lapack"
3630 "--with-mysql"
3631 (string-append
3632 "--with-mysql-includes="
3633 (search-input-directory %build-inputs "/include/mysql"))
3634 (string-append
3635 "--with-mysql-libs="
3636 (dirname
3637 (search-input-file %build-inputs "/lib/libmariadb.so")))
3638 "--with-netcdf"
3639 "--with-postgres"
3640 (string-append
3641 "--with-proj-share="
3642 (search-input-directory %build-inputs "/share/proj"))
3643 "--with-pthread"
3644 "--with-readline"
3645 "--with-sqlite"
3646 "--with-wxwidgets"
3647 (string-append
3648 "SHELL="
3649 (search-input-file %build-inputs "/bin/bash"))
3650 (string-append
3651 "CONFIG_SHELL="
3652 (search-input-file %build-inputs "/bin/bash"))
3653 (string-append "LDFLAGS=-Wl,-rpath -Wl,"
3654 #$output "/" #$grassxx "/lib"))
3655 #:phases
3656 #~(modify-phases %standard-phases
3657 (add-after 'unpack 'fix-lapack
3658 (lambda _
3659 (substitute* "./configure"
3660 (("-lblas") "-lopenblas")
3661 (("-llapack") "-lopenblas"))))
3662 (add-after 'install 'install-links
3663 (lambda _
3664 ;; Put links for includes and libraries in the standard places.
3665 (let ((dir (string-append #$output "/" #$grassxx)))
3666 (symlink (string-append dir "/include")
3667 (string-append #$output "/include"))
3668 (symlink (string-append dir "/lib")
3669 (string-append #$output "/lib")))))
3670 (add-after 'install-links 'python:wrap
3671 (assoc-ref python:%standard-phases 'wrap))
3672 (add-after 'python:wrap 'wrap-with-python-interpreter
3673 (lambda _
3674 (wrap-program (string-append #$output "/bin/grass")
3675 `("GRASS_PYTHON" = (,(which "python3")))))))))
3676 (native-inputs
3677 (list bash-minimal
3678 bison
3679 flex
3680 pkg-config))
3681 (inputs
3682 (list bash-minimal
3683 bzip2
3684 cairo
3685 fftw
3686 freetype
3687 gdal
3688 geos
3689 glu
3690 libpng
3691 libtiff
3692 libxml2 ;marked as required by pdal
3693 mesa
3694 `(,mariadb "dev")
3695 `(,mariadb "lib")
3696 netcdf
3697 openblas
3698 pdal
3699 perl
3700 postgresql
3701 proj
3702 python
3703 python-dateutil
3704 python-matplotlib
3705 python-numpy
3706 python-wxpython
3707 readline
3708 sqlite
3709 wxwidgets
3710 zlib
3711 `(,zstd "lib")))
3712 (synopsis "GRASS Geographic Information System")
3713 (description
3714 "GRASS (Geographic Resources Analysis Support System), is a Geographic
3715Information System (GIS) software suite used for geospatial data management and
3716analysis, image processing, graphics and maps production, spatial modeling, and
3717visualization.")
3718 (home-page "https://grass.osgeo.org/")
3719 (license license:gpl2+))))
3720
3721(define-public saga
3722 (package
3723 (name "saga")
3724 (version "8.2.1")
3725 (source
3726 (origin
3727 (method url-fetch)
3728 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
3729 (version-major version) "/SAGA%20-%20" version
3730 "/saga-" version ".tar.gz"))
3731 (sha256
3732 (base32 "008izjs6gvj09abxf16ssl1xy0ay3ljq4jswbggp6wiiq459minv"))
3733 (modules '((guix build utils)))
3734 (snippet
3735 '(substitute* "saga-gis/src/tools/docs/docs_pdf/doc_pdf.cpp"
3736 (("^#include <hpdf\\.h>\n" all)
3737 (string-append all "#include <hpdf_version.h>\n"))
3738 (("\\bHPDF_PROJECTING_SCUARE_END\\b")
3739 "HPDF_PROJECTING_SQUARE_END")))))
3740 (build-system cmake-build-system)
3741 (native-inputs
3742 (list pkg-config swig-4.0))
3743 (inputs
3744 (list curl
3745 fftw
3746 gdal
3747 hdf5
3748 jasper
3749 libharu
3750 libtiff
3751 opencv
3752 postgresql
3753 proj
3754 python
3755 qhull
3756 unixodbc
3757 vigra
3758 wxwidgets))
3759 (arguments
3760 '(#:tests? #f
3761 #:phases
3762 (modify-phases %standard-phases
3763 (add-before 'configure 'cd-to-source-dir
3764 (lambda _
3765 (chdir "saga-gis"))))))
3766 (synopsis "System for Automated Geoscientific Analyses")
3767 (description
3768 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
3769Information System (GIS) software. It has been designed for an easy and
3770effective implementation of spatial algorithms and it offers a comprehensive,
3771growing set of geoscientific methods.")
3772 (home-page "https://www.saga-gis.org")
3773 (license (list license:gpl2+ license:lgpl2.1+))))
3774
3775(define-public qgis
3776 (package
3777 (name "qgis")
3778 ;; 3.44 is the LTR series,
3779 ;; see https://www.qgis.org/resources/roadmap/
3780 (version "3.44.13")
3781 (source
3782 (origin
3783 (method git-fetch)
3784 (uri
3785 (git-reference
3786 (url "https://github.com/qgis/QGIS")
3787 (commit (string-append
3788 "final-"
3789 (string-replace-substring version "." "_")))))
3790 (file-name (git-file-name name version))
3791 (sha256
3792 (base32 "1biqs2cn0gdhnb7d7iz0jz9gw7zgy4i2gf663h6gn6rz2d2j8b3m"))))
3793 (build-system cmake-build-system)
3794 (arguments
3795 (list
3796 #:imported-modules (append %cmake-build-system-modules
3797 %pyproject-build-system-modules
3798 '((guix build qt-utils)))
3799 #:modules '((guix build cmake-build-system)
3800 ((guix build pyproject-build-system) #:prefix py:)
3801 (guix build qt-utils)
3802 (guix build utils))
3803 #:configure-flags
3804 #~(list "-DWITH_QTWEBKIT=NO")
3805 #:phases
3806 #~(let* ((ignored-tests (list
3807 ;; Disable tests that require network access
3808 "PyQgsExternalStorageAwsS3"
3809 "PyQgsExternalStorageWebDav"
3810 "test_core_networkaccessmanager"
3811 "test_core_tiledownloadmanager"
3812 "test_gui_filedownloader"
3813 "test_provider_wcsprovider"
3814 ;; Disable tests that need OGR built with
3815 ;; libspatialite support
3816 "PyQgsAttributeTableModel"
3817 "PyQgsOGRProviderSqlite"
3818 "PyQgsWFSProvider"
3819 "PyQgsOapifProvider"
3820 ;; Disable tests that need Python compiled
3821 ;; with loadable SQLite extensions.
3822 "PyQgsFieldFormattersTest"
3823 "PyQgsSpatialiteProvider"
3824 "PyQgsLayerDependencies"
3825 "PyQgsDBManagerGpkg"
3826 "PyQgsDBManagerSpatialite"
3827 ;; Disable tests that need poppler (with Cairo)
3828 "PyQgsLayoutExporter"
3829 "PyQgsPalLabelingLayout"
3830 ;; Disable tests that need Orfeo ToolBox
3831 "ProcessingOtbAlgorithmsTest"
3832 ;; TODO: Find why the following tests fail
3833 "ProcessingQgisAlgorithmsTestPt1"
3834 "ProcessingQgisAlgorithmsTestPt2"
3835 "ProcessingQgisAlgorithmsTestPt3"
3836 "ProcessingQgisAlgorithmsTestPt4"
3837 "ProcessingGdalAlgorithmsVectorTest"
3838 "ProcessingGrassAlgorithmsImageryTest"
3839 "ProcessingGrassAlgorithmsRasterTestPt1"
3840 "ProcessingGrassAlgorithmsRasterTestPt2"
3841 "ProcessingGrassAlgorithmsVectorTest"
3842 "ProcessingGrassAlgsPostgreRasterProvider"
3843 "test_core_authcertutils"
3844 "test_core_authconfig"
3845 "test_core_authmanager"
3846 "test_core_compositionconverter"
3847 "test_core_elevationmap"
3848 "test_core_expression"
3849 "test_core_gdalprovider"
3850 "test_core_gdalutils"
3851 "test_core_labelingengine"
3852 "test_core_layoutpicture"
3853 "test_core_ogrprovider"
3854 "test_core_project"
3855 "test_core_coordinatereferencesystem"
3856 "test_core_overlayexpression"
3857 "test_gui_queryresultwidget"
3858 "test_provider_eptprovider"
3859 "test_analysis_processingalgspt2"
3860 "test_analysis_processingpdalalgs"
3861 "test_analysis_processing"
3862 "test_app_gpsintegration"
3863 "test_app_qgisappclipboard"
3864 "test_3d_mesh3drendering"
3865 "PyQgsAnnotation"
3866 "PyQgsAnnotationLayer"
3867 "PyQgsAnnotationLineItem"
3868 "PyQgsAnnotationLineTextItem"
3869 "PyQgsAnnotationPolygonItem"
3870 "PyQgsAuthenticationSystem"
3871 "PyQgsDatumTransform"
3872 "PyQgsFileUtils"
3873 "PyQgsGeometryTest"
3874 "PyQgsGoogleMapsGeocoder"
3875 "PyQgsHashLineSymbolLayer"
3876 "PyQgsLayoutHtml"
3877 "PyQgsLineSymbolLayers"
3878 "PyQgsMapLayer"
3879 "PyQgsOGRProviderGpkg"
3880 "PyQgsProcessExecutablePt1"
3881 "PyQgsProcessExecutablePt2"
3882 "PyQgsProcessingGdalAlgsVirtualLayers"
3883 "PyQgsProjectionSelectionWidgets"
3884 "PyQgsProviderConnectionGpkg"
3885 "PyQgsProviderConnectionSpatialite"
3886 "PyQgsOGRProvider"
3887 "PyQgsTextRenderer"
3888 "PyQgsVectorFileWriter"
3889 "PyQgsVirtualLayerProvider"
3890 "PyQgsAuxiliaryStorage"
3891 "PyQgsSelectiveMasking"
3892 "PyPythonRepr"
3893 "PyQgsAnimatedMarkerSymbolLayer"
3894 "PyQgsPythonProvider"
3895 "PyQgsCategorizedSymbolRenderer"
3896 "PyQgsColorRampLegendNode"
3897 "PyQgsEmbeddedSymbolRenderer"
3898 "PyQgsFillSymbolLayers"
3899 "PyQgsGeometryGeneratorSymbolLayer"
3900 "PyQgsGpsLogger"
3901 "PyQgsGraduatedSymbolRenderer"
3902 "PyQgsHighlight"
3903 "PyQgsInterpolatedLineSymbolLayer"
3904 "PyQgsJsonUtils"
3905 "PyQgsLayerTreeView"
3906 "PyQgsLayoutAtlas"
3907 "PyQgsLayoutElevationProfile"
3908 "PyQgsLayoutPageCollection"
3909 "PyQgsLayoutItem"
3910 "PyQgsLayoutLegend"
3911 "PyQgsLayoutMap"
3912 "PyQgsLayoutPage"
3913 "PyQgsLineburstSymbolLayer"
3914 "PyQgsMapBoxGlStyleConverter"
3915 "PyQgsMapCanvas"
3916 "PyQgsMapCanvasAnnotationItem"
3917 "PyQgsMapHitTest"
3918 "PyQgsMarkerLineSymbolLayer"
3919 "PyQgsMergedFeatureRenderer"
3920 "PyQgsMeshLayerProfileGenerator"
3921 "PyQgsPalLabelingPlacement"
3922 "PyQgsPointCloudAttributeByRampRenderer"
3923 "PyQgsPointCloudExtentRenderer"
3924 "PyQgsPointCloudLayerProfileGenerator"
3925 "PyQgsPointClusterRenderer"
3926 "PyQgsPointDisplacementRenderer"
3927 "PyQgsProfileExporter"
3928 "PyQgsProfileRequest"
3929 "TestQgsRandomMarkerSymbolLayer"
3930 "PyQgsRasterAttributeTable"
3931 "PyQgsRasterFileWriterTask"
3932 "PyQgsRasterLayer"
3933 "PyQgsRasterLayerProfileGenerator"
3934 "PyQgsRasterColorRampShader"
3935 "PyQgsRasterLineSymbolLayer"
3936 "PyQgsRasterPipe"
3937 "PyQgsSingleSymbolRenderer"
3938 "PyQgsSimpleFillSymbolLayer"
3939 "PyQgsSimpleLineSymbolLayer"
3940 "PyQgsSymbolLayer"
3941 "PyQgsRasterRendererCreateSld"
3942 "PyQgsSymbolLayerCreateSld"
3943 "PyQgsArrowSymbolLayer"
3944 "PyQgsSymbolExpressionVariables"
3945 "PyQgsStyleModel"
3946 "PyQgsSymbol"
3947 "PyQgsSymbolLayerUtils"
3948 "PyQgsTextFormatWidget"
3949 "PyQgsVectorFieldMarkerSymbolLayer"
3950 "PyQgsVectorLayer"
3951 "PyQgsVectorLayerProfileGenerator"
3952 "PyQgsVectorLayerRenderer"
3953 "qgis_sipify"
3954 "qgis_sip_include"
3955 "qgis_sip_uptodate"))
3956 (grass-version #$(package-version (this-package-input "grass")))
3957 (grass-majorminor (string-join
3958 (list-head
3959 (string-split grass-version #\.) 2)
3960 ""))
3961 (grass-dir (string-append #$(this-package-input "grass")
3962 "/grass" grass-majorminor)))
3963 (modify-phases %standard-phases
3964 ;; Configure correct path to PyQt5 SIP directory
3965 (add-after 'unpack 'configure-pyqt5-sip-path
3966 (lambda* (#:key inputs #:allow-other-keys)
3967 (let* ((pyqt (assoc-ref inputs "python-pyqt+qscintilla"))
3968 (sip-dir (string-append
3969 (py:site-packages inputs `(("out" . ,pyqt)))
3970 "/PyQt5/bindings")))
3971 (substitute* "cmake/FindPyQt5.py"
3972 (("sip_dir = cfg.default_sip_dir")
3973 (string-append "sip_dir = \"" sip-dir "\"")))
3974 (substitute* "cmake/FindPyQt5.cmake"
3975 (("\
3976SET\\(PYQT5_SIP_DIR \"\\$\\{Python_SITEARCH\\}/PyQt5/bindings\"\\)")
3977 (string-append "SET(PYQT5_SIP_DIR \"" sip-dir "\")"))))
3978 (substitute* (list "tests/code_layout/test_qt_imports.sh"
3979 "tests/code_layout/test_qgsscrollarea.sh")
3980 (("\\$\\(git rev-parse --show-toplevel\\)")
3981 (getcwd)))))
3982 (replace 'check
3983 (lambda* (#:key inputs outputs tests? parallel-tests?
3984 #:allow-other-keys)
3985 (if tests?
3986 (begin
3987 (setenv "HOME" "/tmp")
3988 (system "Xvfb :1 &")
3989 (setenv "DISPLAY" ":1")
3990 (setenv "TRAVIS" "true")
3991 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
3992 (setenv "GISBASE" grass-dir)
3993 (invoke "ctest"
3994 "-j" (if parallel-tests?
3995 (number->string (parallel-job-count))
3996 "1")
3997 "-E" (string-join ignored-tests "|")))
3998 (format #t "test suite not run~%"))))
3999 (add-after 'install 'wrap-python
4000 (assoc-ref py:%standard-phases 'wrap))
4001 (add-after 'wrap-python 'wrap-qt
4002 (lambda* (#:key inputs #:allow-other-keys)
4003 (wrap-qt-program "qgis" #:output #$output #:inputs inputs)))
4004 (add-after 'wrap-qt 'wrap-gis
4005 (lambda* (#:key inputs #:allow-other-keys)
4006 ;; TODO: Find if there is a way to get SAGA to work.
4007 ;; Currently QGIS says "version of SAGA not supported".
4008 ;; Disable it for now.
4009 (wrap-program (string-append #$output "/bin/qgis")
4010 ;; `("PATH" ":" prefix
4011 ;; (,(dirname (search-input-file inputs "/bin/saga_cmd"))))
4012 `("QGIS_PREFIX_PATH" = (,#$output))
4013 `("GISBASE" = (,grass-dir)))))))))
4014 (inputs
4015 (list bash-minimal
4016 draco
4017 exiv2
4018 expat
4019 freexl
4020 gdal
4021 geos
4022 gpsbabel
4023 grass
4024 gsl
4025 hdf5
4026 librttopo
4027 libspatialindex
4028 libspatialite
4029 libxml2
4030 libzip
4031 minizip
4032 netcdf
4033 pdal
4034 postgresql
4035 proj
4036 protobuf
4037 python
4038 python-chardet
4039 python-dateutil
4040 python-future
4041 python-jinja2
4042 python-lxml
4043 python-numpy
4044 python-owslib
4045 python-psycopg2
4046 python-pygments
4047 python-pyqt+qscintilla
4048 python-pytz
4049 python-pyyaml
4050 python-requests
4051 python-sip
4052 python-urllib3
4053 qca
4054 qscintilla-qt5
4055 qt3d-5
4056 qtbase-5
4057 qtdeclarative-5
4058 qtkeychain
4059 qtlocation-5
4060 qtmultimedia-5
4061 qtserialport-5
4062 qtsvg-5
4063 qwt
4064 ;; saga
4065 sqlite
4066 (list zstd "lib")))
4067 (native-inputs
4068 (append
4069 (list bison
4070 flex
4071 perl
4072 perl-yaml-tiny
4073 pkg-config
4074 python-mock
4075 python-nose2
4076 python-pyqt-builder
4077 qttools-5)
4078 (if (supported-package? shellcheck)
4079 (list shellcheck)
4080 '())
4081 (list xorg-server-for-tests)))
4082 (home-page "https://qgis.org")
4083 (synopsis "Geographical information system")
4084 (description "QGIS is an easy to use Geographical Information
4085System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
4086raster and vector data formats, with new support easily added using the plugin
4087architecture.")
4088 (license
4089 (list
4090 license:asl1.1
4091 license:asl2.0
4092 license:bsd-2
4093 license:bsd-3
4094 license:boost1.0
4095 license:cc-by3.0
4096 license:cc-by4.0
4097 license:cc-by-sa3.0
4098 license:cc-by-sa4.0
4099 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
4100 (license:fsf-free "file://debian/copyright" "Go Squared")
4101 license:expat
4102 license:fdl1.2+
4103 (license:fsf-free
4104 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
4105 (license:fsf-free
4106 "file://debian/copyright"
4107 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
4108 license:gpl2
4109 license:gpl2+
4110 license:gpl3
4111 license:gpl3+
4112 license:isc
4113 license:lgpl2.0+
4114 license:lgpl2.1
4115 license:lgpl2.1+
4116 license:lgpl3
4117 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
4118 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
4119 (license:non-copyleft
4120 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
4121 "NCL Source Code License")
4122 license:ogl-psi1.0
4123 license:opl1.0+
4124 license:public-domain
4125 license:qwt1.0))))
4126
4127(define-public splat
4128 (package
4129 (name "splat")
4130 (version "1.5.0b3")
4131 (source
4132 (origin
4133 (method git-fetch)
4134 (uri (git-reference
4135 (url "https://github.com/hoche/splat")
4136 (commit (string-append "v" version))))
4137 (file-name (git-file-name name version))
4138 (sha256
4139 (base32 "10djwjwb1pvznr0fjwnxdm5d961f3yngispb4zj9hyzdgq1xh217"))
4140 (modules '((guix build utils)))
4141 (snippet
4142 '(begin
4143 ;; Delete pre-compiled libraries.
4144 (delete-file-recursively "vstudio")))))
4145 (build-system gnu-build-system)
4146 (inputs
4147 (list bzip2 libjpeg-turbo libpng zlib))
4148 (arguments
4149 (list #:tests? #f ; No test suite.
4150 #:phases
4151 #~(modify-phases %standard-phases
4152 (add-after 'unpack 'fix-installation-scripts
4153 (lambda _
4154 (substitute* (list "install" "utils/install")
4155 (("/usr/local")
4156 #$output)
4157 (("whoami=`whoami`")
4158 "whoami=root"))))
4159 (delete 'configure)
4160 (add-before 'install 'create-bin-directory
4161 (lambda _
4162 (mkdir-p (string-append #$output "/bin")))))))
4163 (synopsis "Signal propagation and coverage analysis tool")
4164 (description
4165 "The SPLAT (Signal Propagation, Loss, And Terrain) program can use the
4166Longley-Rice path loss and coverage prediction using the Irregular Terrain
4167Model to predict the behaviour and reliability of radio links, and to predict
4168path loss.")
4169 (home-page "https://www.qsl.net/kd2bd/splat.html")
4170 (license license:gpl2+)))
4171
4172(define-public python-geographiclib
4173 (package
4174 (name "python-geographiclib")
4175 (version "2.0")
4176 (source
4177 (origin
4178 (method url-fetch)
4179 (uri (pypi-uri "geographiclib" version))
4180 (sha256
4181 (base32
4182 "0naql53537dsa6g9lzz1hf688b1vvih6dj2yjcyjs71yvj2irx7p"))))
4183 (build-system pyproject-build-system)
4184 (native-inputs
4185 (list python-pytest
4186 python-setuptools
4187 python-wheel))
4188 (home-page "https://geographiclib.sourceforge.io/2.0/python/")
4189 (synopsis "Python geodesic routines from GeographicLib")
4190 (description
4191 "This is a python implementation of the geodesic routines in GeographicLib.")
4192 (license license:expat)))
4193
4194(define-public python-geoip2fast
4195 (package
4196 (name "python-geoip2fast")
4197 (version "1.2.1")
4198 (source
4199 (origin
4200 (method url-fetch)
4201 (uri (pypi-uri "geoip2fast" version))
4202 (sha256
4203 (base32 "1cmdjlwjd4pg3qvsb8d4vghqj1im58npxb6dmrd5q90wjga4rfvm"))))
4204 (build-system pyproject-build-system)
4205 ;; The tests are speed tests or development tests to compare results with
4206 ;; a different library.
4207 (arguments (list #:tests? #false))
4208 (native-inputs (list python-setuptools python-wheel))
4209 (home-page "https://github.com/rabuchaim/geoip2fast")
4210 (synopsis
4211 "Fast GeoIP2 country/city/asn lookup library")
4212 (description
4213 "@code{GeoIP2Fast} is a fast @code{GeoIP2} country/city/asn lookup
4214library that supports IPv4 and IPv6. A search takes less than 0.00003
4215seconds. It has its own data file updated twice a week with
4216Maxmind-Geolite2-CSV, supports IPv4/IPv6 and is pure Python.")
4217 (license license:expat)))
4218
4219(define-public python-geopy
4220 (package
4221 (name "python-geopy")
4222 (version "2.4.1")
4223 (source
4224 (origin
4225 (method url-fetch)
4226 (uri (pypi-uri "geopy" version))
4227 (sha256
4228 (base32
4229 "1lfhnd04hbzmsdm5bqisvx2218v5cf6369xhbjz8jzfhga73sa2h"))))
4230 (build-system pyproject-build-system)
4231 (arguments
4232 (list
4233 #:test-flags #~(list "--skip-tests-requiring-internet")))
4234 (propagated-inputs
4235 (list python-geographiclib))
4236 (native-inputs
4237 (list python-docutils
4238 python-pytest
4239 python-pytest-asyncio
4240 python-pytz
4241 python-setuptools
4242 python-wheel))
4243 (home-page "https://github.com/geopy/geopy")
4244 (synopsis "Geocoding library for Python")
4245 (description "@code{geopy} is a Python client for several popular geocoding
4246web services. @code{geopy} makes it easy for Python developers to locate the
4247coordinates of addresses, cities, countries, and landmarks across the globe
4248using third-party geocoders and other data sources.")
4249 (license license:expat)))
4250
4251(define-public python-haversine
4252 (package
4253 (name "python-haversine")
4254 (version "2.7.0")
4255 (source (origin
4256 (method git-fetch)
4257 (uri (git-reference
4258 ;; There are no tests in the PyPi archive.
4259 (url "https://github.com/mapado/haversine")
4260 (commit (string-append "v" version))))
4261 (file-name (git-file-name name version))
4262 (sha256
4263 (base32
4264 "0inxyj5n4jzgg5xiadqx9sk83gdx5ff989l9s04smdzbd3b8c0c8"))))
4265 (build-system pyproject-build-system)
4266 (native-inputs
4267 (list python-pytest
4268 python-numpy
4269 python-setuptools
4270 python-wheel))
4271 (home-page "https://github.com/mapado/haversine")
4272 (synopsis "Calculate the distance between 2 points on Earth")
4273 (description "This package provides functions to calculate the
4274distance in various units between two points on Earth using their
4275latitude and longitude.")
4276 (license license:expat)))
4277
4278(define-public gplates
4279 (package
4280 (name "gplates")
4281 (version "2.5")
4282 (source (origin
4283 (method git-fetch)
4284 (uri (git-reference
4285 (url "https://github.com/GPlates/GPlates")
4286 (commit (string-append "GPlates-" version))))
4287 (sha256
4288 (base32
4289 "1qrislbgrsn6l1ikd3mffsqxvy61w3l53wmr8mfd8aqaj6dk1wfx"))
4290 (file-name (git-file-name name version))))
4291 (build-system cmake-build-system)
4292 (arguments
4293 (list #:tests? #f)) ;no test target
4294 (inputs
4295 (list boost-1.83
4296 cgal
4297 curl
4298 gdal
4299 glew
4300 glu
4301 gmp
4302 mesa
4303 mpfr
4304 proj
4305 python-3
4306 python-numpy
4307 qtbase-5
4308 qtsvg-5
4309 qtxmlpatterns-5
4310 qwt
4311 zlib))
4312 (home-page "https://www.gplates.org")
4313 (synopsis "Plate tectonics simulation program")
4314 (description "GPlates is a plate tectonics program. Manipulate
4315reconstructions of geological and paleogeographic features through geological
4316time. Interactively visualize vector, raster and volume data.")
4317 (license license:gpl2+)))
4318
4319(define-public navit
4320 ;; XXX: The latest commit provides compatibility with GCC 14, switch to tag
4321 ;; when a fresh release is available.
4322 (let ((commit "2418e3f42af0641c734f93f3d6d20d3025ad2182")
4323 (revision "0"))
4324 (package
4325 (name "navit")
4326 (version (git-version "0.5.6" revision commit))
4327 (source (origin
4328 (method git-fetch)
4329 (uri (git-reference
4330 (url "https://github.com/navit-gps/navit")
4331 (commit commit)))
4332 (sha256
4333 (base32
4334 "0s7rhg1xyj56g19fh84znj6fzdiglgf010appjydivn5gkyzb9kq"))
4335 (file-name (git-file-name name version))))
4336 (build-system cmake-build-system)
4337 (arguments
4338 (list
4339 ;; There are no tests
4340 #:tests? #f
4341 ;; With -DSAMPLE_MAP=TRUE (the default), it tries to download a
4342 ;; map during the build process.
4343 #:configure-flags #~(list "-DSAMPLE_MAP=FALSE")
4344 #:phases
4345 #~(modify-phases %standard-phases
4346 ;; Workaround for the following issue:
4347 ;; https://github.com/navit-gps/navit/issues/1294 which results in
4348 ;; 'error:navit:navit_init:FATAL: No GUI available.' For now there
4349 ;; is only a workaround and no real fix yet.
4350 (add-after
4351 'unpack 'patch-cmake_minimum_required
4352 (lambda _
4353 (substitute*
4354 "CMakeLists.txt"
4355 (("cmake_minimum_required\\(VERSION 3\\.10\\)")
4356 "cmake_minimum_required(VERSION 3.2)"))))
4357 (add-after
4358 'patch-cmake_minimum_required 'patch-navit-config
4359 (lambda _
4360 ;; For now this package only supports SDL, so if we keep
4361 ;; the configuration as-is, Navit doesn't start.
4362 (substitute*
4363 "navit/navit_shipped.xml"
4364 (("<graphics type=\"gtk_drawing_area\"/>")
4365 "<graphics type=\"sdl\"/>"))
4366 ;; Users are expected to be able to add XML files inside
4367 ;; $NAVIT_SHAREDIR, however that directory is in the store.
4368 (substitute*
4369 "navit/navit_shipped.xml"
4370 (("<xi:include href=\"\\$NAVIT_SHAREDIR/maps/\\*\\.xml\"/>")
4371 "<xi:include href=\"$NAVIT_USER_DATADIR/maps/*.xml\"/>"))
4372 ;; Navit also works without GPS but in that case there is
4373 ;; no automatic zooming, so we need zoom buttons to be able
4374 ;; to manually zoom in or out.
4375 (substitute*
4376 "navit/navit_shipped.xml"
4377 (((string-append
4378 "<osd enabled=\"no\" type=\"button\" x=\"-96\" y=\"-96\" "
4379 "command=\"zoom_in()"))
4380 (string-append
4381 "<osd enabled=\"yes\" type=\"button\" x=\"-96\" y=\"-96\" "
4382 "command=\"zoom_in()"))
4383 (((string-append
4384 "<osd enabled=\"no\" type=\"button\" x=\"0\" y=\"-96\" "
4385 "command=\"zoom_out()"))
4386 (string-append
4387 "<osd enabled=\"yes\" type=\"button\" x=\"0\" y=\"-96\" "
4388 "command=\"zoom_out()\" src=\"zoom_out.png\"/>")))))
4389 (add-before
4390 'build 'set-cache
4391 ;; During the build, svg icons are converted in different
4392 ;; formats, and this needs XDG_CACHE_HOME to work.
4393 (lambda _
4394 (setenv "XDG_CACHE_HOME" "/tmp/xdg-cache"))))))
4395 (inputs (list dbus-glib
4396 espeak
4397 freeglut
4398 freeimage
4399 freetype
4400 fribidi
4401 glib
4402 gettext-minimal
4403 gpsd
4404 gdk-pixbuf
4405 imlib2
4406 python
4407 sdl
4408 sdl-image))
4409 (native-inputs (list fontconfig
4410 (librsvg-for-system)
4411 libxslt
4412 pkg-config
4413 protobuf-c))
4414 (home-page "https://www.navit-project.org")
4415 (synopsis "Car navigation system with routing engine that uses vector maps data")
4416 (description
4417 "Navit is a car navigation system with a routing engine.
4418
4419It is meant to work with touchscreen devices, but it also works without a
4420touchscreen. It also supports text to speech.
4421
4422It can be configured extensively through its own configuration file format.
4423For instance we can configure the graphical interface, and which map data is
4424to be displayed at which zoom level.
4425
4426It supports different routing profiles: bike, car, car_avoid_toll,
4427car_pedantic, car_shortest, horse, pedestrian, truck.
4428
4429It can use gpsd or NMEA GPS directly to get position data. It also works
4430without GPS: in this case users can also enter position data directly.
4431
4432It can also be used to log GPS data to files using the GPX or NMEA formats, or
4433to replay NMEA data.
4434
4435For maps, it can uses its own \"binfile\" map format, or Garmin map file
4436format, and data from OpenStreetMap, Garmin maps, Marco Polo Grosser
4437Reiseplaner, Routeplaner Europa 2007, Map + Route.")
4438 (license license:gpl2))))
4439
4440(define-public laszip
4441 (package
4442 (name "laszip")
4443 (version "3.4.4")
4444 (source
4445 (origin
4446 (method git-fetch)
4447 (uri (git-reference
4448 (url "https://github.com/LASzip/LASzip")
4449 (commit version)))
4450 (file-name (git-file-name name version))
4451 (sha256
4452 (base32 "1a0ass8wz1cd42mvdmmgp4lpaf0qpfn9blsilfskba3kmx9hpymz"))))
4453 (build-system cmake-build-system)
4454 (arguments
4455 (list
4456 #:configure-flags #~(list "-DLASZIP_BUILD_STATIC=NO")
4457 #:build-type "Release"
4458 ;; No tests.
4459 #:tests? #f))
4460 (home-page "https://laszip.org/")
4461 (synopsis "Compression library for LAS files")
4462 (description
4463 "LASzip is a library for compressing @code{LAS} files and uncompressing
4464@code{LAZ} files. The @code{LAS} format is a file format designed for the
4465interchange and archiving of lidar point cloud data.")
4466 (license license:asl2.0)))
4467
4468(define-public tetgen
4469 (package
4470 (name "tetgen")
4471 (version "1.6.0")
4472 (source
4473 (origin
4474 (method url-fetch)
4475 (uri
4476 "https://wias-berlin.de/software/tetgen/1.5/src/tetgen1.6.0.tar.gz")
4477 (sha256
4478 (base32 "0fff0l6i3xfjlm0zkcgyyhwndp8i5d615mydyb21yirsplgfddc7"))))
4479 (build-system cmake-build-system)
4480 (arguments
4481 (list
4482 #:tests? #f ;; no test suite
4483 #:configure-flags #~(list "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
4484 #:phases
4485 #~(modify-phases %standard-phases
4486 (replace 'install ;; no install target
4487 (lambda _
4488 (install-file "tetgen"
4489 (string-append #$output "/bin"))))
4490 ;; Do not create etc/ld.so.cache. It is a bit mysterious why
4491 ;; we have this phase in the first place.
4492 (delete 'make-dynamic-linker-cache))))
4493 (home-page "https://wias-berlin.de/software/tetgen/")
4494 (synopsis
4495 "Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator")
4496 (description
4497 "TetGen is a program to generate tetrahedral meshes of any 3D
4498polyhedral domains. TetGen generates exact constrained Delaunay
4499tetrahedralizations, boundary conforming Delaunay meshes, and Voronoi
4500partitions.")
4501 (license license:agpl3+)))
4502
4503(define-public libe57format
4504 (package
4505 (name "libe57format")
4506 (version "3.2.0")
4507 (source
4508 (origin
4509 (method git-fetch)
4510 (uri (git-reference
4511 (url "https://github.com/asmaloney/libE57Format")
4512 (commit "v3.2.0")))
4513 (file-name (git-file-name name version))
4514 (sha256
4515 (base32 "00sj0splv4apv3kfjfwgsrizhimav3hxw51q1qz4g2fgncn092a9"))))
4516 (inputs (list xerces-c))
4517 (build-system cmake-build-system)
4518 (arguments
4519 (list
4520 ;; Tests use external data from
4521 ;; https://github.com/asmaloney/libE57Format-test-data
4522 ;; Even after downloading it and copying it to the
4523 ;; test/libE57Format-test-data subdirectory, the configure phase
4524 ;; fails with the following message:
4525 ;; [E57 Test] The GoogleTest submodule was not downloaded.
4526 ;; E57_GIT_SUBMODULE_UPDATE was turned off or failed. Please update
4527 ;; submodules and try again.
4528 ;; Adding googletest as a native-input does not solve the problem.
4529 #:configure-flags #~(list "-DE57_BUILD_TEST=NO")
4530 #:tests? #f
4531 #:build-type "Release"))
4532 (home-page "https://github.com/asmaloney/libE57Format")
4533 (synopsis "Library for reading and writing E57 files")
4534 (description
4535 "The libE57Format package provides a C++ library for reading and
4536writing files in the ASTM-standard E57 format. E57 files store 3D point
4537cloud data (produced by 3D imaging systems such as laser scanners),
4538attributes associated with 3D point data (color and intensity),
4539and 2D images (photos taken using a 3D imaging system).")
4540 (license license:boost1.0)))
4541
4542(define-public cloudcompare
4543 (package
4544 (name "cloudcompare")
4545 (version "2.13.2")
4546 (source
4547 (origin
4548 (method git-fetch)
4549 (uri (git-reference
4550 (url "https://github.com/CloudCompare/CloudCompare")
4551 (commit (string-append "v" version))
4552 ;; TODO: External source code could be unbundled.
4553 (recursive? #t)))
4554 (file-name (git-file-name name version))
4555 (sha256
4556 (base32 "0wck05zbfkw7cg8h6fjiinjzrsk55858qg0k2m5rmr9dfdzjbzbb"))))
4557 (inputs (list qtbase-5
4558 qtsvg-5
4559 qtlocation-5
4560 qttools-5
4561 gdal
4562 laszip
4563 xerces-c
4564 libe57format
4565 zlib))
4566 (native-inputs (list xvfb-run))
4567 (build-system cmake-build-system)
4568 (arguments
4569 (list
4570 #:configure-flags #~(list
4571 ;; Options
4572 "-DOPTION_BUILD_CCVIEWER=NO"
4573 "-DOPTION_USE_SHAPE_LIB=YES"
4574 "-DOPTION_USE_DXF_LIB=YES"
4575 "-DOPTION_USE_GDAL=YES"
4576 ;; Shaders
4577 ;; At least one shader is needed
4578 "-DPLUGIN_GL_QEDL=YES"
4579 "-DPLUGIN_GL_QSSAO=YES"
4580 ;; IO
4581 "-DPLUGIN_IO_QCORE=YES"
4582 "-DPLUGIN_IO_QADDITIONAL=NO"
4583 "-DPLUGIN_IO_QCSV_MATRIX=NO"
4584 ;; No guix package for DRACO
4585 "-DPLUGIN_IO_QDRACO=NO"
4586 "-DPLUGIN_IO_QE57=YES"
4587 ;; No guix package for FBX
4588 "-DPLUGIN_IO_QFBX=NO"
4589 ;; laszip replaces PDAL in CloudCompare 2.13
4590 "-DPLUGIN_IO_QLAS=YES"
4591 "-DPLUGIN_IO_QPDAL=NO"
4592 "-DPLUGIN_IO_QPHOTOSCAN=YES"
4593 ;; No guix package for Riegl RDBlib
4594 "-DPLUGIN_IO_QRDB=NO"
4595 "-DPLUGIN_IO_QSTEP=NO"
4596 ;; Plugins
4597 "-DPLUGIN_STANDARD_QANIMATION=YES"
4598 "-DQANIMATION_WITH_FFMPEG_SUPPORT=NO"
4599 "-DPLUGIN_STANDARD_QBROOM=YES"
4600 ;; Compilation error
4601 "-DPLUGIN_STANDARD_QCANUPO=YES"
4602 "-DPLUGIN_STANDARD_QCLOUDLAYERS=YES"
4603 "-DPLUGIN_STANDARD_QCOLORIMETRIC_SEGMENTER=YES"
4604 "-DPLUGIN_STANDARD_QCOMPASS=YES"
4605 ;; Only for Windows at the moment
4606 "-DPLUGIN_STANDARD_QCORK=NO"
4607 "-DPLUGIN_STANDARD_QCSF=YES"
4608 "-DPLUGIN_STANDARD_QFACETS=YES"
4609 ;; Error with eigen
4610 "-DPLUGIN_STANDARD_QHOUGH_NORMALS=NO"
4611 "-DPLUGIN_STANDARD_QHPR=YES"
4612 ;; Need qtWebSocket engine
4613 "-DPLUGIN_STANDARD_QJSONRPC=NO"
4614 "-DPLUGIN_STANDARD_QM3C2=YES"
4615 ;; Need PCL lib
4616 "-DPLUGIN_STANDARD_MASONRY_QAUTO_SEG=NO"
4617 "-DPLUGIN_STANDARD_MASONRY_QMANUAL_SEG=NO"
4618 "-DPLUGIN_STANDARD_QPCL=NO"
4619 ;; Need CGAL
4620 "-DPLUGIN_STANDARD_QMESH_BOOLEAN=NO"
4621 "-DPLUGIN_STANDARD_QMPLANE=YES"
4622 "-DPLUGIN_STANDARD_QPCV=NO"
4623 "-DPLUGIN_STANDARD_QPOISSON_RECON=YES"
4624 "-DPLUGIN_STANDARD_QRANSAC_SD=YES"
4625 "-DPLUGIN_STANDARD_QSRA=YES")
4626 #:build-type "Release"
4627 #:phases
4628 #~(modify-phases %standard-phases
4629 (replace 'check
4630 (lambda _
4631 (invoke "xvfb-run" "make" "test"))))))
4632 (home-page "https://cloudcompare.org/")
4633 (synopsis "Point cloud processing software")
4634 (description
4635 "CloudCompare is a 3D point cloud (and triangular mesh) processing
4636software. It was originally designed to perform comparison between two
46373D point clouds (such as the ones obtained with a laser scanner) or between
4638a point cloud and a triangular mesh. It relies on an octree structure that
4639is highly optimized for this particular use-case. It is also meant to deal
4640with huge point clouds.")
4641 (license license:gpl2+)))