gnu: Remove python2-pyaudio.
[jackhill/guix/guix.git] / gnu / packages / geo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
3 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018, 2019, 2020, 2021 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020, 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
12 ;;; Copyright © 2019, 2021 Wiktor Żelazny <wzelazny@vurv.cz>
13 ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
14 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
15 ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
16 ;;; Copyright © 2020, 2021, 2022 Felix Gruber <felgru@posteo.net>
17 ;;; Copyright © 2021 Sharlatan Hellseher <sharlatanus@gmail.com>
18 ;;; Copyright © 2021 Vinicius Monego <monego@posteo.net>
19 ;;; Copyright © 2021 Clément Lassieur <clement@lassieur.org>
20 ;;; Copyright © 2021 Nikolay Korotkiy <sikmir@disroot.org>
21 ;;;
22 ;;; This file is part of GNU Guix.
23 ;;;
24 ;;; GNU Guix is free software; you can redistribute it and/or modify it
25 ;;; under the terms of the GNU General Public License as published by
26 ;;; the Free Software Foundation; either version 3 of the License, or (at
27 ;;; your option) any later version.
28 ;;;
29 ;;; GNU Guix is distributed in the hope that it will be useful, but
30 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32 ;;; GNU General Public License for more details.
33 ;;;
34 ;;; You should have received a copy of the GNU General Public License
35 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37 (define-module (gnu packages geo)
38 #:use-module (guix build-system ant)
39 #:use-module (guix build-system cmake)
40 #:use-module (guix build-system glib-or-gtk)
41 #:use-module (guix build-system gnu)
42 #:use-module (guix build-system go)
43 #:use-module (guix build-system meson)
44 #:use-module (guix build-system python)
45 #:use-module (guix build-system qt)
46 #:use-module (guix build-system scons)
47 #:use-module (guix build-system r)
48 #:use-module (guix download)
49 #:use-module (guix git-download)
50 #:use-module (guix svn-download)
51 #:use-module ((guix licenses) #:prefix license:)
52 #:use-module (guix packages)
53 #:use-module (guix utils)
54 #:use-module (gnu packages)
55 #:use-module (gnu packages algebra)
56 #:use-module (gnu packages astronomy)
57 #:use-module (gnu packages audio)
58 #:use-module (gnu packages autotools)
59 #:use-module (gnu packages backup)
60 #:use-module (gnu packages bash)
61 #:use-module (gnu packages bison)
62 #:use-module (gnu packages boost)
63 #:use-module (gnu packages build-tools)
64 #:use-module (gnu packages check)
65 #:use-module (gnu packages compression)
66 #:use-module (gnu packages cpp)
67 #:use-module (gnu packages cups)
68 #:use-module (gnu packages curl)
69 #:use-module (gnu packages databases)
70 #:use-module (gnu packages datastructures)
71 #:use-module (gnu packages docbook)
72 #:use-module (gnu packages documentation)
73 #:use-module (gnu packages elf)
74 #:use-module (gnu packages flex)
75 #:use-module (gnu packages fonts)
76 #:use-module (gnu packages fontutils)
77 #:use-module (gnu packages gettext)
78 #:use-module (gnu packages gl)
79 #:use-module (gnu packages glib)
80 #:use-module (gnu packages gnome)
81 #:use-module (gnu packages gps)
82 #:use-module (gnu packages graphics)
83 #:use-module (gnu packages gtk)
84 #:use-module (gnu packages haskell-apps)
85 #:use-module (gnu packages haskell-xyz)
86 #:use-module (gnu packages image)
87 #:use-module (gnu packages image-processing)
88 #:use-module (gnu packages icu4c)
89 #:use-module (gnu packages java)
90 #:use-module (gnu packages kde)
91 #:use-module (gnu packages libusb)
92 #:use-module (gnu packages linux)
93 #:use-module (gnu packages lua)
94 #:use-module (gnu packages maths)
95 #:use-module (gnu packages multiprecision)
96 #:use-module (gnu packages pcre)
97 #:use-module (gnu packages pdf)
98 #:use-module (gnu packages perl)
99 #:use-module (gnu packages photo)
100 #:use-module (gnu packages pkg-config)
101 #:use-module (gnu packages protobuf)
102 #:use-module (gnu packages pulseaudio)
103 #:use-module (gnu packages python)
104 #:use-module (gnu packages python-build)
105 #:use-module (gnu packages python-check)
106 #:use-module (gnu packages python-crypto)
107 #:use-module (gnu packages python-science)
108 #:use-module (gnu packages python-web)
109 #:use-module (gnu packages python-xyz)
110 #:use-module (gnu packages qt)
111 #:use-module (gnu packages readline)
112 #:use-module (gnu packages swig)
113 #:use-module (gnu packages sqlite)
114 #:use-module (gnu packages textutils)
115 #:use-module (gnu packages time)
116 #:use-module (gnu packages web)
117 #:use-module (gnu packages webkit)
118 #:use-module (gnu packages wxwidgets)
119 #:use-module (gnu packages xml)
120 #:use-module (gnu packages xorg))
121
122 (define-public memphis
123 (package
124 (name "memphis")
125 (version "0.2.3")
126 (source
127 (origin
128 (method git-fetch)
129 (uri
130 (git-reference
131 (url "https://github.com/jiuka/memphis")
132 (commit version)))
133 (file-name (git-file-name name version))
134 (sha256
135 (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
136 (build-system glib-or-gtk-build-system)
137 (outputs '("out" "doc"))
138 (arguments
139 `(#:configure-flags
140 (list
141 "--disable-static"
142 "--enable-gtk-doc"
143 "--enable-vala"
144 (string-append "--with-html-dir="
145 (assoc-ref %outputs "doc")
146 "/share/gtk-doc/html"))
147 #:phases
148 (modify-phases %standard-phases
149 (add-after 'unpack 'patch-autogen
150 (lambda _
151 (substitute* "autogen.sh"
152 (("\\./configure \"\\$@\"")
153 ""))
154 #t))
155 (add-after 'patch-autogen 'patch-docbook-xml
156 (lambda* (#:key inputs #:allow-other-keys)
157 (with-directory-excursion "docs/reference"
158 (substitute* "libmemphis-docs.sgml"
159 (("http://www.oasis-open.org/docbook/xml/4.3/")
160 (string-append (assoc-ref inputs "docbook-xml")
161 "/xml/dtd/docbook/"))))
162 #t)))))
163 (native-inputs
164 `(("autoconf" ,autoconf)
165 ("automake" ,automake)
166 ("docbook-xml" ,docbook-xml-4.3)
167 ("gobject-introspection" ,gobject-introspection)
168 ("gtk-doc" ,gtk-doc/stable)
169 ("libtool" ,libtool)
170 ("pkg-config" ,pkg-config)
171 ("python" ,python-wrapper)
172 ("seed" ,seed)
173 ("vala" ,vala)))
174 (inputs
175 (list expat glib))
176 (propagated-inputs
177 (list cairo))
178 (synopsis "Map-rendering for OpenSteetMap")
179 (description "Memphis is a map-rendering application and a library for
180 OpenStreetMap written in C using eXpat, Cairo and GLib.")
181 (home-page "http://trac.openstreetmap.ch/trac/memphis/")
182 (license license:lgpl2.1+)))
183
184 (define-public geos
185 (package
186 (name "geos")
187 (version "3.8.1")
188 (source (origin
189 (method url-fetch)
190 (uri (string-append "http://download.osgeo.org/geos/geos-"
191 version
192 ".tar.bz2"))
193 (sha256
194 (base32
195 "1xqpmr10xi0n9sj47fbwc89qb0yr9imh4ybk0jsxpffy111syn22"))))
196 (build-system gnu-build-system)
197 (arguments `(#:phases
198 (modify-phases %standard-phases
199 (add-after
200 'unpack 'patch-test-shebangs
201 (lambda _
202 (substitute* '("tests/xmltester/testrunner.sh"
203 "tests/geostest/testrunner.sh")
204 (("/bin/sh") (which "sh")))
205 #t)))))
206 (inputs
207 (list glib))
208 (home-page "https://geos.osgeo.org/")
209 (synopsis "Geometry Engine for Geographic Information Systems")
210 (description
211 "GEOS provides a spatial object model and fundamental geometric
212 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
213 it aims to contain the complete functionality of JTS in C++. This
214 includes all the OpenGIS Simple Features for SQL spatial predicate
215 functions and spatial operators, as well as specific JTS enhanced
216 topology functions.")
217 (license (list license:lgpl2.1+ ; Main distribution.
218 license:zlib ; tests/xmltester/tinyxml/*
219 license:public-domain)))) ; include/geos/timeval.h
220
221 (define-public gnome-maps
222 (package
223 (name "gnome-maps")
224 (version "41.2")
225 (source (origin
226 (method url-fetch)
227 (uri (string-append "mirror://gnome/sources/" name "/"
228 (version-major version) "/"
229 name "-" version ".tar.xz"))
230 (sha256
231 (base32
232 "037xmkmcmcw87vb1c1s3y225m8757k331cvk1m8cshf6mx61p0l1"))))
233 (build-system meson-build-system)
234 (arguments
235 `(#:glib-or-gtk? #t
236 #:phases
237 (modify-phases %standard-phases
238 (add-after 'unpack 'skip-gtk-update-icon-cache
239 ;; Don't create 'icon-theme.cache'.
240 (lambda _
241 (substitute* "meson_post_install.py"
242 (("gtk-update-icon-cache") "true"))))
243 (add-after 'unpack 'patch-dbus-service
244 (lambda* (#:key outputs #:allow-other-keys)
245 (substitute* "data/org.gnome.Maps.service.in"
246 (("@pkgdatadir@/org.gnome.Maps")
247 (string-append (assoc-ref outputs "out")
248 "/bin/gnome-maps")))))
249 (add-after 'install 'wrap
250 (lambda* (#:key inputs outputs #:allow-other-keys)
251 (let ((out (assoc-ref outputs "out"))
252 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
253 (geocode-glib-path (string-append
254 (assoc-ref inputs "geocode-glib")
255 "/lib"))
256 (goa-path (string-append
257 (assoc-ref inputs "gnome-online-accounts:lib")
258 "/lib"))
259 (gdk-pixbuf-path (string-append
260 (assoc-ref inputs "gdk-pixbuf")
261 "/lib"))
262 (webkitgtk-path (string-append
263 (assoc-ref inputs "webkitgtk")
264 "/lib")))
265 (wrap-program (string-append out "/bin/gnome-maps")
266 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
267
268 ;; There seems to be no way to embed the path of
269 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
270 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
271 ;; libgeocode-glib.so.0
272 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
273 ,webkitgtk-path
274 ,gdk-pixbuf-path
275 ,geocode-glib-path)))
276 #t))))))
277 (native-inputs
278 `(("gettext" ,gettext-minimal)
279 ("gobject-introspection" ,gobject-introspection)
280 ("pkg-config" ,pkg-config)))
281 (inputs
282 `(("evolution-data-server" ,evolution-data-server)
283 ("folks" ,folks)
284 ("libchamplain" ,libchamplain)
285 ("libgee" ,libgee)
286 ("libhandy" ,libhandy)
287 ("libsecret" ,libsecret)
288 ("libsoup" ,libsoup-minimal-2)
289 ("libgweather" ,libgweather)
290 ("libxml2" ,libxml2)
291 ("librsvg" ,librsvg)
292 ("glib-networking" ,glib-networking)
293 ("geoclue" ,geoclue)
294 ("geocode-glib" ,geocode-glib)
295 ("gfbgraph" ,gfbgraph)
296 ("gjs" ,gjs)
297 ("glib" ,glib)
298 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
299 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
300 ("gtk+" ,gtk+)
301 ("rest" ,rest)
302 ("webkitgtk" ,webkitgtk-with-libsoup2)))
303 (synopsis "Graphical map viewer and wayfinding program")
304 (description "GNOME Maps is a graphical map viewer. It uses map data from
305 the OpenStreetMap project. It can provide directions for walking, bicycling,
306 and driving.")
307 (home-page "https://wiki.gnome.org/Apps/Maps")
308 (license license:gpl2+)))
309
310 (define-public libgeotiff
311 (package
312 (name "libgeotiff")
313 (version "1.5.1")
314 (source
315 (origin
316 (method url-fetch)
317 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
318 version ".tar.gz"))
319 (patches (search-patches
320 ;; See libgeotiff 1.5.1 issue
321 ;; https://github.com/OSGeo/libgeotiff/issues/22
322 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
323 (sha256
324 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
325 (modules '((guix build utils)))
326 (snippet
327 '(begin
328 ;; Remove .csv files, distributed from EPSG under a restricted
329 ;; license. See LICENSE for full license text.
330 (for-each delete-file (find-files "." "\\.csv$"))
331 #t))))
332 (build-system gnu-build-system)
333 (inputs
334 (list libjpeg-turbo libtiff zlib))
335 (propagated-inputs
336 (list ;; libgeotiff headers include proj headers, so ensure those are available.
337 proj))
338 (arguments
339 `(#:configure-flags
340 (list "--disable-static"
341 "--with-zlib" "--with-jpeg"
342 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
343 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
344 (description "libgeotiff is a library on top of libtiff for reading and
345 writing GeoTIFF information tags.")
346 (home-page "https://trac.osgeo.org/geotiff/")
347 ;; This is a mixture of various contributions under different licenses.
348 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
349 ;; states, as its commercial redistribution is restricted. Hence, we have
350 ;; removed it from the package.
351 (license (list license:public-domain
352 license:x11
353 license:bsd-3
354 (license:non-copyleft "file://LICENSE"
355 "See LICENSE in the distribution.")))))
356
357 (define-public librasterlite2
358 (package
359 (name "librasterlite2")
360 (version "1.1.0-beta1")
361 (source
362 (origin
363 (method url-fetch)
364 (uri (string-append
365 "https://www.gaia-gis.it/gaia-sins/librasterlite2-sources/"
366 "librasterlite2-" version ".tar.gz"))
367 (sha256
368 (base32
369 "1x24gqp4hsq97c31ncwxblab0x0863q8v1z42jil7lvsq3glqa7p"))))
370 (build-system gnu-build-system)
371 (native-inputs
372 (list pkg-config))
373 (inputs
374 (list cairo
375 curl
376 freetype
377 freexl
378 giflib
379 libgeotiff
380 libjpeg-turbo
381 libpng
382 librttopo
383 libspatialite
384 libtiff
385 libwebp
386 libxml2
387 lz4
388 minizip
389 openjpeg
390 proj
391 sqlite
392 `(,zstd "lib")))
393 (synopsis "Library to work with huge raster coverages using a SpatiaLite")
394 (description
395 "librasterlite2 is a library that stores and retrieves huge raster
396 coverages using a SpatiaLite DBMS.")
397 (home-page "https://www.gaia-gis.it/fossil/librasterlite2/index")
398 ;; For the genuine librasterlite-sources holds:
399 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
400 ;; Files under src/control_points are from GRASS
401 ;; and are licensed under GPL2+ only.
402 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
403 ;; The tools supporting the library (both rl2tool and wmslite) are
404 ;; licensed under the GPL v3 (or any subsequent version) terms.
405 ;; The test/*.svg files are placed in the public domain, except for
406 ;; test/Car_Yellow.svg which is licensed under the Free Art License 1.3.
407 (license (list license:gpl2+
408 license:gpl3+
409 license:lal1.3
410 license:lgpl2.1+
411 license:mpl1.1
412 license:public-domain))))
413
414 (define-public librttopo
415 (package
416 (name "librttopo")
417 (version "1.1.0")
418 (source
419 (origin
420 (method git-fetch)
421 (uri (git-reference
422 (url "https://git.osgeo.org/gitea/rttopo/librttopo")
423 (commit (string-append "librttopo-" version))))
424 (file-name (git-file-name name version))
425 (sha256
426 (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
427 (build-system gnu-build-system)
428 (arguments
429 `(#:phases
430 (modify-phases %standard-phases
431 (add-after 'unpack 'patch-autogen
432 (lambda _
433 (let ((autoconf (which "autoconf"))
434 (autoheader (which "autoheader"))
435 (aclocal (which "aclocal"))
436 (automake (which "automake"))
437 (libtoolize (which "libtoolize")))
438 (substitute* "autogen.sh"
439 (("`which autoconf 2>/dev/null`") autoconf)
440 (("`which autoheader 2>/dev/null`") autoheader)
441 (("ACLOCAL=.*$")
442 (string-append "ACLOCAL=" aclocal "\n"))
443 (("AUTOMAKE=.*$")
444 (string-append "AUTOMAKE=" automake "\n"))
445 (("LIBTOOLIZE=.*$")
446 (string-append "LIBTOOLIZE=" libtoolize "\n"))))
447 #t)))))
448 (native-inputs
449 (list autoconf automake libtool pkg-config))
450 (inputs
451 (list geos))
452 (synopsis "Library to handle SQL/MM topologies")
453 (description
454 "The RT Topology Library exposes an API to create and manage standard
455 (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
456 (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
457 (license license:gpl2+)))
458
459 (define-public libspatialite
460 (package
461 (name "libspatialite")
462 (version "5.0.1")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
467 version ".tar.gz"))
468 (sha256
469 (base32
470 "164y82rw2lrp5glfc0rkn7n6xvx5dvlgmh7bb7815067251wkjzf"))))
471 (build-system gnu-build-system)
472 (native-inputs
473 (list pkg-config))
474 (inputs
475 (list freexl
476 geos
477 librttopo
478 libxml2
479 minizip
480 proj
481 sqlite))
482 (arguments
483 `(#:configure-flags
484 '("--enable-rttopo=yes")
485 #:phases
486 (modify-phases %standard-phases
487 ;; 1 test is failing, ignore it:
488 (add-after 'unpack 'ignore-broken-tests
489 (lambda _
490 (substitute* '("test/Makefile.in")
491 (("check_wms\\$\\(EXEEXT\\) check_drop_rename\\$\\(EXEEXT\\) ")
492 "check_wms$(EXEEXT) ")))))))
493 (synopsis "Extend SQLite to support Spatial SQL capabilities")
494 (description
495 "SpatiaLite is a library intended to extend the SQLite core to support
496 fully fledged Spatial SQL capabilities.")
497 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
498 ;; For the genuine libspatialite-sources holds:
499 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
500 ;; Files under src/control_points are from GRASS
501 ;; and are licensed under GPL2+ only.
502 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
503 (license (list license:gpl2+
504 license:lgpl2.1+
505 license:mpl1.1
506 license:public-domain))))
507
508 (define-public proj
509 (package
510 (name "proj")
511 (version "7.2.1")
512 (source
513 (origin
514 (method url-fetch)
515 (uri (string-append "http://download.osgeo.org/proj/proj-"
516 version ".tar.gz"))
517 (sha256
518 (base32
519 "050apzdn0isxpsblys1shrl9ccli5vd32kgswlgx1imrbwpg915k"))))
520 (build-system cmake-build-system)
521 (arguments
522 `(#:configure-flags '("-DUSE_EXTERNAL_GTEST=ON")
523 #:phases
524 (modify-phases %standard-phases
525 (add-after 'unpack 'fix-version
526 (lambda _
527 (substitute* "CMakeLists.txt"
528 (("MAJOR 7 MINOR 2 PATCH 0") "MAJOR 7 MINOR 2 PATCH 1")))))))
529 (inputs
530 (list curl libjpeg-turbo libtiff sqlite))
531 (native-inputs
532 (list googletest pkg-config))
533 (home-page "https://proj.org/")
534 (synopsis "Coordinate transformation software")
535 (description
536 "Proj is a generic coordinate transformation software that transforms
537 geospatial coordinates from one @acronym{CRS, coordinate reference system}
538 to another. This includes cartographic projections as well as geodetic
539 transformations. Proj includes command line applications for easy
540 conversion of coordinates from text files or directly from user input.
541 In addition, Proj also exposes an application programming interface that
542 lets developers use the functionality of Proj in their own software.")
543 (license (list license:expat
544 ;; src/projections/patterson.cpp
545 license:asl2.0
546 ;; src/geodesic.*, src/tests/geodtest.cpp
547 license:x11))))
548
549 (define-public proj.4
550 (package
551 (name "proj.4")
552 (version "4.9.3")
553 (source (origin
554 (method url-fetch)
555 (uri (string-append "http://download.osgeo.org/proj/proj-"
556 version ".tar.gz"))
557 (sha256
558 (base32
559 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
560 (build-system gnu-build-system)
561 (arguments
562 `(#:phases
563 (modify-phases %standard-phases
564 (add-after 'unpack 'patch-test-paths
565 (lambda _
566 (substitute* '("nad/test27"
567 "nad/test83"
568 "nad/testvarious"
569 "nad/testdatumfile"
570 "nad/testflaky"
571 "nad/testIGNF")
572 (("/bin/rm") (which "rm")))
573 #t))
574 ;; Precision problems on i686 and other platforms. See:
575 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
576 ;; Disable failing test.
577 (add-after 'patch-test-paths 'ignore-failing-tests
578 (lambda _
579 (substitute* '("nad/Makefile.in")
580 (("\tPROJ_LIB.*" all) (string-append "#" all)))
581 #t)))))
582 (inputs
583 (list glib))
584 (home-page "https://proj.org/")
585 (synopsis "Cartographic Projections Library")
586 (description
587 "Proj.4 is a library for converting coordinates between cartographic
588 projections.")
589 (license (list license:expat
590 ;; src/PJ_patterson.c
591 license:asl2.0
592 ;; src/geodesic.c/h
593 license:x11
594 ;; Embedded EPSG database.
595 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
596 ;; cmake/*
597 license:boost1.0))))
598
599 (define-public python-pyproj
600 (package
601 (name "python-pyproj")
602 (version "3.2.1")
603 (source
604 (origin
605 (method url-fetch)
606 (uri (pypi-uri "pyproj" version))
607 (sha256
608 (base32
609 "0xrqpy708qlyd7nqjra0dl7nvkqzaj9w0v7wq4j5pxazha9n14sa"))))
610 (build-system python-build-system)
611 (arguments
612 `(#:phases
613 (modify-phases %standard-phases
614 (add-after 'unpack 'set-proj-path
615 (lambda* (#:key inputs #:allow-other-keys)
616 (let ((proj (assoc-ref inputs "proj")))
617 (setenv "PROJ_DIR" proj)
618 (substitute* "pyproj/datadir.py"
619 (("(internal_datadir = ).*$" all var)
620 (string-append var "Path(\"" proj "/share/proj\")\n")))))))))
621 (inputs
622 (list proj))
623 (propagated-inputs
624 (list python-certifi))
625 (native-inputs
626 (list python-cython python-numpy python-pandas python-pytest
627 python-xarray))
628 (home-page "https://github.com/pyproj4/pyproj")
629 (synopsis
630 "Python interface to PROJ")
631 (description
632 "This package provides a Python interface to PROJ, a cartographic
633 projections and coordinate transformations library.")
634 (license license:expat)))
635
636 (define-public python-fiona
637 (package
638 (name "python-fiona")
639 (version "1.8.20")
640 (source
641 (origin
642 (method url-fetch)
643 (uri (pypi-uri "Fiona" version))
644 (sha256
645 (base32
646 "0fql7i7dg1xpbadmk8d26dwp91v7faixxc4wq14zg0kvhp9041d7"))))
647 (build-system python-build-system)
648 (arguments
649 `(#:phases
650 (modify-phases %standard-phases
651 (add-before 'check 'remove-local-fiona
652 (lambda _
653 ; This would otherwise interfere with finding the installed
654 ; fiona when running tests.
655 (delete-file-recursively "fiona")))
656 (replace 'check
657 (lambda* (#:key tests? inputs outputs #:allow-other-keys)
658 (add-installed-pythonpath inputs outputs)
659 (setenv "GDAL_ENABLE_DEPRECATED_DRIVER_GTM" "YES")
660 (when tests?
661 (invoke "pytest"
662 "-m" "not network and not wheel"
663 ;; FIXME: Find why the
664 ;; test_no_append_driver_cannot_append[PCIDSK]
665 ;; test is failing.
666 "-k" "not test_no_append_driver_cannot_append")))))))
667 (inputs
668 (list gdal))
669 (propagated-inputs
670 (list python-attrs
671 python-certifi
672 python-click
673 python-click-plugins
674 python-cligj
675 python-munch
676 python-setuptools
677 python-six
678 python-pytz))
679 (native-inputs
680 (list gdal ; for gdal-config
681 python-boto3
682 python-cython
683 python-pytest
684 python-pytest-cov))
685 (home-page "https://github.com/Toblerity/Fiona")
686 (synopsis
687 "Fiona reads and writes spatial data files")
688 (description
689 "Fiona is GDAL’s neat and nimble vector API for Python programmers.
690 Fiona is designed to be simple and dependable. It focuses on reading
691 and writing data in standard Python IO style and relies upon familiar
692 Python types and protocols such as files, dictionaries, mappings, and
693 iterators instead of classes specific to OGR. Fiona can read and write
694 real-world data using multi-layered GIS formats and zipped virtual file
695 systems and integrates readily with other Python GIS packages such as
696 pyproj, Rtree, and Shapely.")
697 (license license:bsd-3)))
698
699 (define-public python-geopandas
700 (package
701 (name "python-geopandas")
702 (version "0.10.2")
703 (source
704 (origin
705 (method url-fetch)
706 (uri (pypi-uri "geopandas" version))
707 (sha256
708 (base32
709 "1nvim2i47ap1zdwy6kxydskf1cir5g4ij8124wvmrqij0zklggzg"))))
710 (build-system python-build-system)
711 (arguments
712 '(#:phases
713 (modify-phases %standard-phases
714 (replace 'check
715 (lambda* (#:key tests? #:allow-other-keys)
716 (when tests?
717 (invoke "pytest"
718 ; Disable tests that fail due to incompatibilities
719 ; with our pandas version.
720 "-k"
721 (string-append
722 "not test_getitem_invalid"
723 " and not test_value_counts"
724 " and not test_setitem_invalid"
725 " and not test_insert_invalid")
726 ; Disable tests that require internet access.
727 "-m" "not web")))))))
728 (propagated-inputs
729 (list python-fiona python-pandas python-pyproj python-shapely))
730 (native-inputs
731 (list python-pytest))
732 (home-page "http://geopandas.org")
733 (synopsis "Geographic pandas extensions")
734 (description "The goal of GeoPandas is to make working with
735 geospatial data in Python easier. It combines the capabilities of
736 Pandas and Shapely, providing geospatial operations in Pandas and a
737 high-level interface to multiple geometries to Shapely. GeoPandas
738 enables you to easily do operations in Python that would otherwise
739 require a spatial database such as PostGIS.")
740 (license license:bsd-3)))
741
742 (define-public mapnik
743 (package
744 (name "mapnik")
745 (version "3.0.18")
746 (source
747 (origin
748 (method url-fetch)
749 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
750 version "/mapnik-v" version ".tar.bz2"))
751 (sha256
752 (base32
753 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
754 (build-system scons-build-system)
755 (inputs
756 (list boost
757 cairo
758 freetype
759 harfbuzz
760 icu4c
761 libjpeg-turbo
762 libpng
763 libtiff
764 libwebp
765 libxml2
766 proj.4
767 sqlite
768 zlib))
769 (native-inputs
770 (list pkg-config))
771 (arguments
772 `(#:scons ,scons-python2
773 #:scons-flags
774 (list "CC=gcc"
775 (string-append "PREFIX=" %output)
776 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
777 (home-page "https://mapnik.org/")
778 (synopsis "Toolkit for developing mapping applications")
779 (description "Mapnik is a toolkit for developing mapping applications. It
780 is basically a collection of geographic objects like maps, layers,
781 datasources, features, and geometries. At its core is a C++ shared library
782 providing algorithms and patterns for spatial data access and visualization.
783 The library does not rely on any specific windowing system and can be deployed
784 to any server environment. It is intended to play fair in a multi-threaded
785 environment and is aimed primarily, but not exclusively, at web-based
786 development.")
787 (license (list license:lgpl2.1+
788 ;; demo/viewer, demo/python/rundemo.py
789 license:gpl2+
790 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
791 license:boost1.0
792 ;; deps/mapnik/sparsehash
793 license:bsd-3
794 ;; deps/agg
795 (license:non-copyleft "file://deps/agg/copying")))))
796
797 (define-public spatialite-gui
798 (package
799 (name "spatialite-gui")
800 (version "2.1.0-beta1")
801 (source
802 (origin
803 (method url-fetch)
804 (uri (string-append
805 "https://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/"
806 "spatialite_gui-" version ".tar.gz"))
807 (sha256
808 (base32 "0cyv4cycl073p9lnnnglcb72qn71g8h9g5zn4gzw7swcy5nxjj5s"))))
809 (build-system gnu-build-system)
810 (native-inputs
811 (list pkg-config))
812 (inputs
813 (list curl
814 freexl
815 geos
816 giflib
817 libjpeg-turbo
818 librasterlite2
819 librttopo
820 libspatialite
821 libwebp
822 libxlsxwriter
823 libxml2
824 lz4
825 minizip
826 openjpeg
827 postgresql
828 proj
829 sqlite
830 virtualpg
831 wxwidgets
832 `(,zstd "lib")))
833 (arguments
834 `(#:phases (modify-phases %standard-phases
835 (add-after 'unpack 'fix-gui
836 (lambda _
837 ;; Fix for the GUI not showing up.
838 (substitute* "Main.cpp"
839 (("Hide\\(\\);") ""))
840 #t)))))
841 (synopsis "Graphical user interface for SpatiaLite")
842 (description "Spatialite-gui provides a visual interface for viewing and
843 maintaining a spatialite database. You can easily see the structure of the
844 tables and data contents using point and click functions, many of which
845 construct common SQL queries, or craft your own SQL queries.")
846 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
847 (license license:gpl3+)))
848
849 (define-public gdal
850 (package
851 (name "gdal")
852 (version "3.3.3")
853 (source (origin
854 (method url-fetch)
855 (uri (string-append
856 "http://download.osgeo.org/gdal/" version "/gdal-"
857 version ".tar.gz"))
858 (sha256
859 (base32
860 "0nk09lws1hk873yn5f4wzqfvr82gm4hw3gq8w9g1h0kvf6j5x4i8"))
861 (modules '((guix build utils)))
862 (snippet
863 `(begin
864 ;; TODO: frmts contains a lot more bundled code.
865 (for-each delete-file-recursively
866 ;; bundled code
867 '("frmts/png/libpng"
868 "frmts/gif/giflib"
869 "frmts/jpeg/libjpeg"
870 "frmts/jpeg/libjpeg12"
871 "frmts/gtiff/libtiff"
872 "frmts/gtiff/libgeotiff"
873 "frmts/zlib"
874 "ogr/ogrsf_frmts/geojson/libjson"))))))
875 (build-system gnu-build-system)
876 (arguments
877 `(#:tests? #f
878 #:configure-flags
879 (let-syntax ((with (syntax-rules ()
880 ((_ option input)
881 (string-append option "="
882 (assoc-ref %build-inputs input))))))
883 (list
884 ;; TODO: --with-pcidsk, --with-pcraster
885 (with "--with-freexl" "freexl")
886 (with "--with-libjson-c" "json-c")
887 (with "--with-png" "libpng")
888 (with "--with-webp" "libwebp")
889 (with "--with-gif" "giflib")
890 (with "--with-jpeg" "libjpeg-turbo")
891 (with "--with-libtiff" "libtiff")
892 (with "--with-geotiff" "libgeotiff")
893 (with "--with-libz" "zlib")
894 (with "--with-expat" "expat")
895 (with "--with-sqlite3" "sqlite")
896 "--with-pcre"))
897 #:phases
898 (modify-phases %standard-phases
899 (add-before 'build 'fix-path
900 (lambda _
901 (substitute* "frmts/mrf/mrf_band.cpp"
902 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
903 (inputs
904 (list expat
905 freexl
906 geos
907 giflib
908 json-c
909 libgeotiff
910 libjpeg-turbo
911 libpng
912 libtiff
913 libwebp
914 netcdf
915 pcre
916 postgresql ; libpq
917 proj
918 sqlite
919 zlib))
920 (native-inputs
921 (list pkg-config))
922 (home-page "https://gdal.org/")
923 (synopsis "Raster and vector geospatial data format library")
924 (description "GDAL is a translator library for raster and vector geospatial
925 data formats. As a library, it presents a single raster abstract data model
926 and single vector abstract data model to the calling application for all
927 supported formats. It also comes with a variety of useful command line
928 utilities for data translation and processing.")
929 (license (list
930 ;; general license
931 license:expat
932 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
933 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
934 ;; frmts/mrf/
935 license:bsd-3
936 ;; frmts/hdf4/hdf-eos/*
937 ;; similar to the expat license, but without guarantee exclusion
938 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
939 ;; frmts/grib/degrib/
940 license:public-domain ; with guarantee exclusion
941 ;; port/cpl_minizip*
942 ;; Some bsd-inspired license
943 (license:non-copyleft "file://port/LICENCE_minizip")
944 ;; alg/internal_libqhull
945 ;; Some 5-clause license
946 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
947 ;; frmts/mrf/libLERC
948 license:asl2.0))))
949
950 (define-public python-gdal
951 (package (inherit gdal)
952 (name "python-gdal")
953 (build-system python-build-system)
954 (arguments
955 '(#:tests? #f ; no tests
956 #:phases
957 (modify-phases %standard-phases
958 (add-before 'build 'chdir
959 (lambda _
960 (chdir "swig/python")
961 #t)))))
962 (native-inputs '())
963 (propagated-inputs
964 (list python-numpy))
965 (inputs
966 (list gdal))
967 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
968
969 (define-public python-pyshp
970 (package
971 (name "python-pyshp")
972 (version "2.1.3")
973 (source
974 (origin
975 (method git-fetch)
976 (uri (git-reference
977 (url "https://github.com/GeospatialPython/pyshp")
978 (commit version)))
979 (file-name (git-file-name name version))
980 (sha256
981 (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
982 (build-system python-build-system)
983 (arguments
984 `(#:phases
985 (modify-phases %standard-phases
986 (replace 'check
987 (lambda* (#:key tests? #:allow-other-keys)
988 (when tests?
989 ;; This is the only test file.
990 (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
991 (native-inputs
992 (list python-pytest python-pytest-runner))
993 (home-page "https://github.com/GeospatialPython/pyshp")
994 (synopsis "Read/write support for ESRI Shapefile format")
995 (description
996 "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
997 (license license:expat)))
998
999 (define-public python-cartopy
1000 (package
1001 (name "python-cartopy")
1002 ;; This is a post-release fix that adds build_ext to setup.py.
1003 (version "0.19.0.post1")
1004 (source
1005 (origin
1006 (method url-fetch)
1007 (uri (pypi-uri "Cartopy" version))
1008 (sha256
1009 (base32 "0xnm8z3as3hriivdfd26s6vn5b63gb46x6vxw6gh1mwfm5rlg2sb"))))
1010 (build-system python-build-system)
1011 (arguments
1012 `(#:phases
1013 (modify-phases %standard-phases
1014 (replace 'check
1015 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1016 (when tests?
1017 (add-installed-pythonpath inputs outputs)
1018 (invoke "python" "-m" "pytest" "--pyargs" "cartopy"
1019 ;; These tests require online data.
1020 "-m" "not natural_earth and not network"
1021 ;; This one too but it's not marked as such.
1022 "-k" "not test_gridliner_labels_bbox_style")))))))
1023 (propagated-inputs
1024 (list python-matplotlib
1025 python-numpy
1026 python-pykdtree
1027 python-pyshp
1028 python-scipy
1029 python-shapely))
1030 (inputs
1031 (list geos proj))
1032 (native-inputs
1033 (list python-cython python-flufl-lock python-pytest))
1034 (home-page "https://scitools.org.uk/cartopy/docs/latest/")
1035 (synopsis "Cartographic library for visualisation")
1036 (description
1037 "Cartopy is a Python package designed to make drawing maps for data
1038 analysis and visualisation easy.
1039
1040 It features:
1041
1042 @itemize
1043 @item object oriented projection definitions
1044 @item point, line, polygon and image transformations between projections
1045 @item integration to expose advanced mapping in Matplotlib with a simple and
1046 intuitive interface
1047 @item powerful vector data handling by integrating shapefile reading with
1048 Shapely capabilities
1049 @end itemize")
1050 (license license:lgpl3+)))
1051
1052 (define-public postgis
1053 (package
1054 (name "postgis")
1055 (version "3.2.1")
1056 (source (origin
1057 (method url-fetch)
1058 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
1059 version ".tar.gz"))
1060 (sha256
1061 (base32
1062 "0gl9d6xy2an82ldb9sixz5blyngjryq8m3509fr38ffawvfniazv"))))
1063 (build-system gnu-build-system)
1064 (arguments
1065 `(#:tests? #f
1066 #:make-flags
1067 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
1068 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
1069 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
1070 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
1071 #:phases
1072 (modify-phases %standard-phases
1073 (add-before 'build 'fix-install-path
1074 (lambda* (#:key outputs #:allow-other-keys)
1075 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
1076 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
1077 (string-append (assoc-ref outputs "out") "/bin"))))))))
1078 (inputs
1079 (list gdal
1080 geos
1081 giflib
1082 json-c
1083 libjpeg-turbo
1084 libxml2
1085 pcre
1086 postgresql
1087 protobuf-c
1088 proj))
1089 (native-inputs
1090 (list perl pkg-config))
1091 (home-page "https://postgis.net")
1092 (synopsis "Spatial database extender for PostgreSQL")
1093 (description "PostGIS is a spatial database extender for PostgreSQL
1094 object-relational database. It adds support for geographic objects allowing
1095 location queries to be run in SQL. This package provides a PostgreSQL
1096 extension.")
1097 (license (list
1098 ;; General license
1099 license:gpl2+
1100 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
1101 license:expat
1102 ;; loader/getopt.*
1103 license:public-domain
1104 ;; doc/xsl
1105 license:bsd-3 ; files only say "BSD"
1106 ;; doc
1107 license:cc-by-sa3.0))))
1108
1109 (define-public tegola
1110 (package
1111 (name "tegola")
1112 (version "0.7.0")
1113 (source (origin
1114 (method url-fetch)
1115 (uri (string-append
1116 "https://github.com/go-spatial/tegola/archive/v"
1117 version ".tar.gz"))
1118 (file-name (string-append name "-" version ".tar.gz"))
1119 (sha256
1120 (base32
1121 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
1122 (build-system go-build-system)
1123 (arguments
1124 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
1125 #:unpack-path "github.com/go-spatial/tegola"
1126 #:phases
1127 (modify-phases %standard-phases
1128 (add-before 'build 'set-version
1129 (lambda _
1130 (with-directory-excursion "src/github.com/go-spatial/tegola"
1131 (substitute* '("cmd/tegola/cmd/root.go"
1132 "cmd/tegola_lambda/main.go")
1133 (("version not set") ,version)))
1134 #t)))))
1135 (home-page "https://tegola.io")
1136 (synopsis "Vector tile server for maps")
1137 (description "Tegola is a free vector tile server written in Go. Tegola
1138 takes geospatial data and slices it into vector tiles that can be efficiently
1139 delivered to any client.")
1140 (license (list
1141 license:expat
1142 ;; Some packages in vendor have other licenses
1143 license:asl2.0
1144 license:bsd-2
1145 license:bsd-3
1146 license:wtfpl2))))
1147
1148 (define-public imposm3
1149 (package
1150 (name "imposm3")
1151 (version "0.11.1")
1152 (source
1153 (origin
1154 (method url-fetch)
1155 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
1156 version ".tar.gz"))
1157 (file-name (string-append name "-" version ".tar.gz"))
1158 (sha256
1159 (base32
1160 "1w7b221z5k9254zn01imycxkyw62xigqizhwvrgxqmq1m9r5410l"))))
1161 (build-system go-build-system)
1162 (arguments
1163 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
1164 #:unpack-path "github.com/omniscale/imposm3"
1165 #:phases
1166 (modify-phases %standard-phases
1167 (add-before 'build 'set-version
1168 (lambda _
1169 (substitute* "src/github.com/omniscale/imposm3/version.go"
1170 (("0.0.0-dev") ,version))
1171 #t)))))
1172 (inputs
1173 (list geos leveldb))
1174 (home-page "https://imposm.org/")
1175 (synopsis "OpenStreetMap importer for PostGIS")
1176 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
1177 files and imports the data into PostgreSQL/PostGIS databases. It is designed
1178 to create databases that are optimized for rendering/tile/map-services.")
1179 (license (list
1180 license:asl2.0
1181 ;; Some dependencies in vendor have different licenses
1182 license:expat
1183 license:bsd-2
1184 license:bsd-3))))
1185
1186 (define-public libosmium
1187 (package
1188 (name "libosmium")
1189 (version "2.18.0")
1190 (source
1191 (origin
1192 (method git-fetch)
1193 (uri (git-reference
1194 (url "https://github.com/osmcode/libosmium")
1195 (commit (string-append "v" version))))
1196 (file-name (git-file-name name version))
1197 (sha256
1198 (base32 "0fh57mpii1ksacwfx5rz213j896aklib53jbybld2i517q2mmxr0"))))
1199 (build-system cmake-build-system)
1200 (propagated-inputs
1201 (list boost
1202 bzip2
1203 expat
1204 gdal
1205 geos
1206 lz4
1207 proj
1208 protozero
1209 sparsehash
1210 utfcpp
1211 zlib))
1212 (native-inputs
1213 (list doxygen))
1214 (home-page "https://osmcode.org/libosmium/")
1215 (synopsis "C++ library for working with OpenStreetMap data")
1216 (description "Libosmium is a fast and flexible C++ library for working with
1217 OpenStreetMap data.")
1218 (license license:boost1.0)))
1219
1220 (define-public osmium-tool
1221 (package
1222 (name "osmium-tool")
1223 (version "1.14.0")
1224 (source
1225 (origin
1226 (method git-fetch)
1227 (uri (git-reference
1228 (url "https://github.com/osmcode/osmium-tool")
1229 (commit (string-append "v" version))))
1230 (file-name (git-file-name name version))
1231 (sha256
1232 (base32 "0zgyqyrs89vch0qnkh9m5xq079sr2wmydy5zz4l8xbysbjf6xry5"))
1233 (modules '((guix build utils)))
1234 (snippet
1235 ;; Remove bundled libraries.
1236 '(delete-file-recursively "include/rapidjson"))))
1237 (build-system cmake-build-system)
1238 (inputs
1239 (list libosmium
1240 rapidjson))
1241 (native-inputs
1242 (list pandoc))
1243 (home-page "https://osmcode.org/osmium-tool/")
1244 (synopsis "Osmium command-line tool")
1245 (description "Command line tool for working with OpenStreetMap data
1246 based on the Osmium library.")
1247 (license license:gpl3+)))
1248
1249 (define-public osm2pgsql
1250 (package
1251 (name "osm2pgsql")
1252 (version "1.5.1")
1253 (source
1254 (origin
1255 (method git-fetch)
1256 (uri (git-reference
1257 (url "https://github.com/openstreetmap/osm2pgsql")
1258 (commit version)))
1259 (file-name (git-file-name name version))
1260 (sha256
1261 (base32 "0i18mskcs087dn3f3h9n7j0wafn8502m0h13mrjwin38xsz0crfj"))
1262 (modules '((guix build utils)))
1263 (snippet
1264 '(begin
1265 (delete-file-recursively "contrib/protozero")
1266 (delete-file-recursively "contrib/libosmium")
1267 #t))))
1268 (build-system cmake-build-system)
1269 (arguments
1270 `(#:tests? #f; tests fail because we need to setup a database
1271 #:configure-flags
1272 (list (string-append "-DOSMIUM_INCLUDE_DIR="
1273 (assoc-ref %build-inputs "libosmium")
1274 "/include")
1275 (string-append "-DPROTOZERO_INCLUDE_DIR="
1276 (assoc-ref %build-inputs "protozero")
1277 "/include"))))
1278 (inputs
1279 (list boost
1280 bzip2
1281 expat
1282 libosmium
1283 lua
1284 postgresql
1285 proj
1286 protozero
1287 zlib))
1288 (native-inputs
1289 (list python python-psycopg2))
1290 (home-page "https://github.com/openstreetmap/osm2pgsql")
1291 (synopsis "OSM data importer to postgresql")
1292 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
1293 PostgreSQL / PostGIS database suitable for applications like rendering into a
1294 map, geocoding with Nominatim, or general analysis.")
1295 (license license:gpl2+)))
1296
1297 (define-public tippecanoe
1298 (package
1299 (name "tippecanoe")
1300 (version "1.36.0")
1301 (source
1302 (origin
1303 (method git-fetch)
1304 (uri (git-reference
1305 (url "https://github.com/mapbox/tippecanoe")
1306 (commit version)))
1307 (file-name (git-file-name name version))
1308 (sha256
1309 (base32 "0lbmhly4ivnqc6qk1k3sdqvsg6x3nfd8gnjx846bhqj4wag3f88m"))))
1310 (build-system gnu-build-system)
1311 (arguments
1312 `(#:phases
1313 (modify-phases %standard-phases (delete 'configure))
1314 #:test-target "test"
1315 #:make-flags
1316 (list (string-append "CC=" ,(cc-for-target))
1317 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
1318 (inputs
1319 (list perl sqlite zlib))
1320 (home-page "https://github.com/mapbox/tippecanoe")
1321 (synopsis "Vector tile server for maps")
1322 (description "Tippecanoe creates scale-independent view of data, so that
1323 the texture and density of features is visible at every zoom level, instead of
1324 dropping features at lower levels.")
1325 (license license:bsd-2)))
1326
1327 (define-public osmctools
1328 (package
1329 (name "osmctools")
1330 (version "0.9")
1331 (source
1332 (origin
1333 (method git-fetch)
1334 (uri (git-reference
1335 (url "https://gitlab.com/osm-c-tools/osmctools")
1336 (commit version)))
1337 (file-name (git-file-name name version))
1338 (sha256
1339 (base32
1340 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
1341 (build-system gnu-build-system)
1342 (native-inputs
1343 (list autoconf automake))
1344 (inputs
1345 (list zlib))
1346 (home-page "https://gitlab.com/osm-c-tools/osmctools")
1347 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
1348 (description "This project contains a few tools which are used in the
1349 OpenStreetMap project. They can be used to convert, filter and update
1350 OpenStreetMap data files.")
1351 (license license:agpl3)))
1352
1353 (define-public osm-gps-map
1354 (package
1355 (name "osm-gps-map")
1356 (version "1.1.0")
1357 (source
1358 (origin
1359 (method url-fetch)
1360 (uri (string-append
1361 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1362 version "/osm-gps-map-" version ".tar.gz"))
1363 (sha256
1364 (base32
1365 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1366 (build-system gnu-build-system)
1367 (native-inputs
1368 (list gnome-common gtk-doc/stable pkg-config))
1369 (inputs
1370 (list cairo glib gobject-introspection gtk+ libsoup-minimal-2))
1371 (home-page "https://nzjrs.github.io/osm-gps-map/")
1372 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1373 (description
1374 "This package provides a GTK+ widget (and Python bindings) that when
1375 given GPS coordinates,draws a GPS track, and points of interest on a moving
1376 map display. Downloads map data from a number of websites, including
1377 @url{https://www.openstreetmap.org}.")
1378 (license license:gpl2+)))
1379
1380 (define-public xygrib
1381 (package
1382 (name "xygrib")
1383 (version "1.2.6.1")
1384 (source (origin
1385 (method git-fetch)
1386 (uri (git-reference
1387 (url "https://github.com/opengribs/XyGrib")
1388 (commit (string-append "v" version))))
1389 (file-name (git-file-name name version))
1390 (patches (search-patches "xygrib-fix-finding-data.patch"))
1391 (sha256
1392 (base32
1393 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1394 (modules '((guix build utils)))
1395 (snippet
1396 '(begin
1397 (delete-file-recursively "data/fonts")
1398 ;; Fixes compilation, can be removed with the next release.
1399 ;; Upstream link: https://github.com/opengribs/XyGrib/pull/255
1400 (substitute* "src/SkewT.h"
1401 (("QMessageBox>") "QMessageBox>\n#include <QPainterPath>"))
1402 #t))))
1403 (build-system cmake-build-system)
1404 (arguments
1405 `(#:configure-flags (list "-DGNU_PACKAGE=ON")
1406
1407 #:phases
1408 (modify-phases %standard-phases
1409 (add-after 'unpack 'patch-directories
1410 (lambda* (#:key inputs #:allow-other-keys)
1411 (let ((jpeg (assoc-ref inputs "openjpeg"))
1412 (font (assoc-ref inputs "font-liberation")))
1413 (substitute* "CMakeLists.txt"
1414 ;; Skip looking for the static library.
1415 (("\"libnova.a\"") ""))
1416 ;; Don't use the bundled font-liberation.
1417 (substitute* "src/util/Font.cpp"
1418 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1419 (string-append "\"" font "/share/fonts/truetype/\"")))
1420 (substitute* "src/util/Util.h"
1421 (("pathData\\(\\)\\+\"data/fonts/\"")
1422 (string-append "\"" font "/share/fonts/\"")))))))
1423 #:tests? #f)) ; no tests
1424 (native-inputs
1425 (list qttools))
1426 (inputs
1427 (list bzip2
1428 font-liberation
1429 libnova
1430 libpng
1431 openjpeg
1432 proj
1433 qtbase-5
1434 zlib))
1435 (native-search-paths
1436 (list (search-path-specification
1437 (variable "XDG_DATA_DIRS")
1438 (files '("share")))))
1439 (synopsis "Weather Forecast Visualization")
1440 (description
1441 "XyGrib is a Grib file reader and visualizes meteorological data providing
1442 an off-line capability to analyse weather forecasts or hindcasts. It is
1443 intended to be used as a capable weather work station for anyone with a serious
1444 interest in examining weather. This would include members of the sailing
1445 community, private and sport aviators, farmers, weather buffs and many more.
1446 XyGrib is the continuation of the zyGrib software package with a new team of
1447 volunteers.")
1448 (home-page "https://opengribs.org")
1449 (license license:gpl3+)))
1450
1451 (define-public libspatialindex
1452 (package
1453 (name "libspatialindex")
1454 (version "1.9.3")
1455 (source
1456 (origin
1457 (method url-fetch)
1458 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1459 "releases/download/" version "/spatialindex-src-"
1460 version ".tar.bz2"))
1461 (sha256
1462 (base32
1463 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1464 (build-system cmake-build-system)
1465 (home-page "https://libspatialindex.org")
1466 (synopsis "Spatial indexing library")
1467 (description "The purpose of this library is to provide:
1468
1469 @itemize
1470 @item An extensible framework that will support robust spatial indexing
1471 methods.
1472 @item Support for sophisticated spatial queries. Range, point location,
1473 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1474 by spatial constraints) should be easy to deploy and run.
1475 @item Easy to use interfaces for inserting, deleting and updating information.
1476 @item Wide variety of customization capabilities. Basic index and storage
1477 characteristics like the page size, node capacity, minimum fan-out, splitting
1478 algorithm, etc. should be easy to customize.
1479 @item Index persistence. Internal memory and external memory structures
1480 should be supported. Clustered and non-clustered indices should be easy to be
1481 persisted.
1482 @end itemize
1483 ")
1484 (license license:expat)))
1485
1486 (define-public python-rtree
1487 (package
1488 (name "python-rtree")
1489 (version "0.9.7")
1490 (source
1491 (origin
1492 (method url-fetch)
1493 (uri (pypi-uri "Rtree" version))
1494 (sha256
1495 (base32 "0gna530vy6rh76035cqh7i2lx199cvxjrzjczg9rm6k96k5751xy"))))
1496 (build-system python-build-system)
1497 (arguments
1498 `(#:phases
1499 (modify-phases %standard-phases
1500 (add-after 'unpack 'find-libspatialindex
1501 (lambda* (#:key inputs #:allow-other-keys)
1502 (setenv "SPATIALINDEX_C_LIBRARY"
1503 (string-append (assoc-ref inputs "libspatialindex")
1504 "/lib/libspatialindex.so"))))
1505 (replace 'check
1506 (lambda* (#:key inputs outputs tests? #:allow-other-keys)
1507 (when tests?
1508 (add-installed-pythonpath inputs outputs)
1509 (invoke "python" "-m" "pytest")))))))
1510 (native-inputs
1511 (list python-numpy python-pytest python-wheel))
1512 (inputs
1513 (list libspatialindex))
1514 (home-page "https://github.com/Toblerity/rtree")
1515 (synopsis "R-Tree spatial index for Python GIS")
1516 (description
1517 "RTree is a Python package with bindings for @code{libspatialindex}.")
1518 (license license:expat)))
1519
1520 (define-public java-jmapviewer
1521 (package
1522 (name "java-jmapviewer")
1523 (version "2.13")
1524 (source (origin
1525 (method url-fetch)
1526 (uri (string-append "https://svn.openstreetmap.org/applications/"
1527 "viewer/jmapviewer/releases/" version
1528 "/JMapViewer-" version "-Source.zip"))
1529 (sha256
1530 (base32
1531 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1532 (build-system ant-build-system)
1533 (native-inputs
1534 (list unzip))
1535 (arguments
1536 `(#:build-target "pack"
1537 #:tests? #f; No tests
1538 #:phases
1539 (modify-phases %standard-phases
1540 (add-before 'build 'clean
1541 (lambda* _
1542 (invoke "ant" "clean")))
1543 (replace 'install
1544 (lambda* (#:key outputs #:allow-other-keys)
1545 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1546 (mkdir-p dir)
1547 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1548 #t))))))
1549 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1550 (synopsis "OSM map integration in Java")
1551 (description "JMapViewer is a Java component which easily
1552 integrates an OSM map view into your Java application. It is maintained as
1553 an independent project by the JOSM team.")
1554 (license license:gpl2)))
1555
1556 (define-public java-opening-hours-parser
1557 (package
1558 (name "java-opening-hours-parser")
1559 (version "0.23.0")
1560 (source (origin
1561 (method git-fetch)
1562 (uri (git-reference
1563 (url "https://github.com/simonpoole/OpeningHoursParser")
1564 (commit version)))
1565 (file-name (git-file-name name version))
1566 (sha256
1567 (base32
1568 "0yhbd2ix6h506aljh0jkrnp28m4xcqdcdpnqm30fn08kawdgxgsh"))))
1569 (build-system ant-build-system)
1570 (arguments
1571 `(#:jar-name "java-opening-hours-parser.jar"
1572 #:source-dir "src/main/java"
1573 #:phases
1574 (modify-phases %standard-phases
1575 (add-before 'build 'copy-resources
1576 (lambda _
1577 (copy-recursively "src/main/resources" "build/classes")
1578 #t))
1579 (add-before 'build 'generate-parser
1580 (lambda* _
1581 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1582 (file (string-append dir "/OpeningHoursParser.jj")))
1583 (invoke "javacc" "-DEBUG_PARSER=false"
1584 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1585 "-GRAMMAR_ENCODING=UTF-8"
1586 (string-append "-OUTPUT_DIRECTORY=" dir)
1587 file))
1588 #t)))))
1589 (inputs
1590 (list java-jetbrains-annotations))
1591 (native-inputs
1592 (list javacc java-junit java-hamcrest-core))
1593 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1594 (synopsis "Java parser for the OpenStreetMap opening hour format")
1595 (description "This is a very simplistic parser for string values according
1596 to the OSM opening hours specification.")
1597 (license license:expat)))
1598
1599 (define-public josm
1600 (package
1601 (name "josm")
1602 (version "18360")
1603 (source (origin
1604 (method svn-fetch)
1605 (uri (svn-reference
1606 (url "https://josm.openstreetmap.de/svn/trunk")
1607 (revision (string->number version))
1608 (recursive? #f)))
1609 (sha256
1610 (base32
1611 "0j7fhzh6hs2b5r1a3d1xpy6f5r6q1kh79bck28raang8ldd754c6"))
1612 (file-name (string-append name "-" version "-checkout"))
1613 (modules '((guix build utils)))
1614 (snippet
1615 '(begin
1616 (for-each delete-file (find-files "." ".*.jar$"))
1617 #t))))
1618 (build-system ant-build-system)
1619 (native-inputs
1620 (list javacc))
1621 (inputs
1622 (list java-commons-jcs
1623 java-commons-compress
1624 java-jmapviewer
1625 java-jsonp-api
1626 java-jsonp-impl ; runtime dependency
1627 java-jsr305
1628 java-metadata-extractor
1629 java-opening-hours-parser
1630 java-openjfx-media
1631 java-signpost-core
1632 java-svg-salamander))
1633 (arguments
1634 `(#:tests? #f
1635 #:jar-name "josm.jar"
1636 #:phases
1637 (modify-phases %standard-phases
1638 (add-after 'unpack 'rm-build.xml
1639 (lambda* _
1640 (delete-file "build.xml")
1641 #t))
1642 (add-before 'build 'fix-revision
1643 (lambda* _
1644 (with-output-to-file "REVISION.XML"
1645 (lambda _
1646 (display
1647 (string-append "<info><entry><commit revision=\"" ,version "\">"
1648 "<date>1970-01-01 00:00:00 +0000</date>"
1649 "</commit></entry></info>"))))
1650 #t))
1651 (add-before 'build 'fix-jcs
1652 (lambda _
1653 ;; This version of JOSM uses an unreleased version of commons-jcs,
1654 ;; which has renamed its classes to another namespace. Rename them
1655 ;; back so they can be used with our version of jcs.
1656 (substitute* (find-files "." ".*.java$")
1657 (("jcs3") "jcs")
1658 (("ICache.NAME_COMPONENT_DELIMITER") "\":\""))
1659 #t))
1660 (add-before 'build 'fix-classpath
1661 (lambda* (#:key inputs #:allow-other-keys)
1662 (setenv "CLASSPATH"
1663 (string-join
1664 (filter
1665 (lambda (s)
1666 (let ((source (assoc-ref inputs "source")))
1667 (not (equal? (substring s 0 (string-length source))
1668 source))))
1669 (string-split (getenv "CLASSPATH") #\:))
1670 ":"))
1671 #t))
1672 (add-before 'build 'generate-parser
1673 (lambda* _
1674 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1675 (out (string-append dir "/parsergen"))
1676 (file (string-append dir "/MapCSSParser.jj")))
1677 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1678 (invoke "javacc" "-DEBUG_PARSER=false"
1679 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1680 "-GRAMMAR_ENCODING=UTF-8"
1681 (string-append "-OUTPUT_DIRECTORY=" out)
1682 file))
1683 #t))
1684 (add-after 'build 'generate-epsg
1685 (lambda _
1686 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1687 "-cp" "build/classes")
1688 (mkdir-p "data/projection")
1689 (with-output-to-file "data/projection/custom-epsg"
1690 (lambda _ (display "")))
1691 (invoke "java" "-cp" "build/classes:scripts:."
1692 "BuildProjectionDefinitions" ".")
1693 #t))
1694 (add-after 'generate-epsg 'copy-resources
1695 (lambda _
1696 (copy-recursively "resources" "build/classes")
1697 #t))
1698 (add-before 'install 'regenerate-jar
1699 (lambda _
1700 ;; We need to regenerate the jar file to add data.
1701 (delete-file "build/jar/josm.jar")
1702 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1703 "build/classes" ".")
1704 #t))
1705 (add-before 'build 'copy-revision
1706 (lambda _
1707 (mkdir-p "build/classes")
1708 (with-output-to-file "build/classes/REVISION"
1709 (lambda _
1710 (display
1711 (string-append "Revision: " ,version "\n"
1712 "Is-Local-Build: true\n"
1713 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1714 #t))
1715 (add-after 'install 'install-share-directories
1716 (lambda* (#:key outputs #:allow-other-keys)
1717 (let ((out (assoc-ref outputs "out"))
1718 (share-directories '("applications" "icons" "man" "menu"
1719 "metainfo" "mime" "pixmaps"))
1720 (desktop "org.openstreetmap.josm.desktop"))
1721 (for-each (lambda (directory)
1722 (copy-recursively (string-append
1723 "native/linux/tested/usr/share/"
1724 directory)
1725 (string-append
1726 out "/share/" directory)))
1727 share-directories)
1728 (substitute* (string-append out "/share/applications/" desktop)
1729 (("josm-MainApplication") "josm-gui-MainApplication")))
1730 #t))
1731 (add-after 'install 'install-bin
1732 (lambda* (#:key outputs inputs #:allow-other-keys)
1733 (let* ((out (assoc-ref outputs "out"))
1734 (bin (string-append out "/bin")))
1735 (mkdir-p bin)
1736 (with-output-to-file (string-append bin "/josm")
1737 (lambda _
1738 (display
1739 (string-append "#!/bin/sh\n"
1740 (assoc-ref inputs "jdk") "/bin/java"
1741 " -cp " out "/share/java/josm.jar:"
1742 (getenv "CLASSPATH")
1743 " org.openstreetmap.josm.gui.MainApplication"))))
1744 (chmod (string-append bin "/josm") #o755))
1745 #t)))))
1746 (home-page "https://josm.openstreetmap.de")
1747 (synopsis "OSM editor")
1748 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1749 supports loading GPX tracks, background imagery and OSM data from local
1750 sources as well as from online sources and allows editing the OSM data (nodes,
1751 ways, and relations) and their metadata tags.")
1752 (license license:gpl2+)))
1753
1754 (define-public libmaxminddb
1755 (package
1756 (name "libmaxminddb")
1757 (version "1.4.3")
1758 (source
1759 (origin
1760 (method url-fetch)
1761 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1762 "/releases/download/" version "/"
1763 "/libmaxminddb-" version ".tar.gz"))
1764 (sha256
1765 (base32 "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5"))))
1766 (build-system gnu-build-system)
1767 (arguments
1768 `(#:make-flags
1769 (list ,(string-append "CC=" (cc-for-target)))))
1770 (native-inputs
1771 (list perl))
1772 (home-page "https://maxmind.github.io/libmaxminddb/")
1773 (synopsis "C library for the MaxMind DB file format")
1774 (description "The libmaxminddb library provides a C library for reading
1775 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1776 format is a custom, but open, binary format designed to facilitate fast
1777 lookups of IP addresses while allowing flexibility in the type of data
1778 associated with an address.")
1779 (license license:asl2.0)))
1780
1781 (define-public python-maxminddb
1782 (package
1783 (name "python-maxminddb")
1784 (version "1.5.1")
1785 (source
1786 (origin
1787 (method url-fetch)
1788 (uri (pypi-uri "maxminddb" version))
1789 (sha256
1790 (base32
1791 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1792 (build-system python-build-system)
1793 (arguments
1794 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1795 (inputs
1796 (list libmaxminddb))
1797 (home-page "https://www.maxmind.com/")
1798 (synopsis "Reader for the MaxMind DB format")
1799 (description "MaxMind DB is a binary file format that stores data indexed
1800 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1801 MaxMind DB files.")
1802 (license license:asl2.0)))
1803
1804 (define-public python-geoip2
1805 (package
1806 (name "python-geoip2")
1807 (version "2.9.0")
1808 (source
1809 (origin
1810 (method url-fetch)
1811 (uri (pypi-uri "geoip2" version))
1812 (sha256
1813 (base32
1814 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1815 (build-system python-build-system)
1816 (arguments
1817 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1818 (inputs
1819 (list python-maxminddb python-requests))
1820 (home-page "https://www.maxmind.com/")
1821 (synopsis "MaxMind GeoIP2 API")
1822 (description "Provides an API for the GeoIP2 web services and databases.
1823 The API also works with MaxMind’s free GeoLite2 databases.")
1824 (license license:asl2.0)))
1825
1826 (define-public routino
1827 (package
1828 (name "routino")
1829 (version "3.3.3")
1830 (source
1831 (origin
1832 (method url-fetch)
1833 (uri (string-append "http://www.routino.org/download/routino-"
1834 version ".tgz"))
1835 (sha256
1836 (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
1837 (build-system gnu-build-system)
1838 (native-inputs
1839 (list perl))
1840 (inputs
1841 (list bzip2 xz zlib))
1842 (arguments
1843 `(#:test-target "test"
1844 #:phases
1845 (modify-phases %standard-phases
1846 (replace 'configure
1847 (lambda* (#:key outputs #:allow-other-keys)
1848 (substitute* "Makefile.conf"
1849 (("prefix=/usr/local")
1850 (string-append "prefix=" (assoc-ref outputs "out")))
1851 (("LDFLAGS_LDSO=-Wl,-R\\.")
1852 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1853 (("#CFLAGS\\+=-DUSE_XZ")
1854 "CFLAGS+=-DUSE_XZ")
1855 (("#LDFLAGS\\+=-llzma")
1856 "LDFLAGS+=-llzma"))
1857 #t)))))
1858 (synopsis "Routing application for OpenStreetMap data")
1859 (description
1860 "Routino is an application for finding a route between two points
1861 using the dataset of topographical information collected by
1862 @url{https://www.OpenStreetMap.org}.")
1863 (home-page "https://www.routino.org/")
1864 (license license:agpl3+)))
1865
1866 (define-public qmapshack
1867 (package
1868 (name "qmapshack")
1869 (version "1.16.1")
1870 (source
1871 (origin
1872 (method git-fetch)
1873 (uri (git-reference
1874 (url "https://github.com/Maproom/qmapshack")
1875 (commit (string-append "V_" version))))
1876 (file-name (git-file-name name version))
1877 (sha256
1878 (base32 "184fqmsfzr3b333ssizjk6gvv7mncmygq8dj5r7rsvs5md26z2ys"))))
1879 (build-system qt-build-system)
1880 (native-inputs
1881 (list pkg-config qttools))
1882 (inputs
1883 (list gdal
1884 libjpeg-turbo
1885 proj
1886 qtbase-5
1887 qtdeclarative
1888 qtlocation
1889 qtwebchannel
1890 qtwebengine
1891 quazip
1892 routino
1893 sqlite ; See wrap phase
1894 zlib))
1895 (arguments
1896 `(#:tests? #f
1897 #:phases
1898 (modify-phases %standard-phases
1899 (add-after 'unpack 'fix-cmake-modules
1900 (lambda* (#:key inputs #:allow-other-keys)
1901 (substitute* "CMakeLists.txt"
1902 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1903 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1904 (substitute* "cmake/Modules/FindROUTINO.cmake"
1905 (("/usr/local")
1906 (assoc-ref inputs "routino"))))))))
1907 (synopsis "GPS mapping application")
1908 (description
1909 "QMapShack can be used to plan your next outdoor trip or to visualize and
1910 archive all the GPS recordings of your past trips. It is the successor of the
1911 QLandkarte GT application.")
1912 (home-page "https://github.com/Maproom/qmapshack/wiki")
1913 (license license:gpl3+)))
1914
1915 (define-public readosm
1916 (package
1917 (name "readosm")
1918 (version "1.1.0a")
1919 (source
1920 (origin
1921 (method url-fetch)
1922 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1923 "readosm-" version ".tar.gz"))
1924 (sha256
1925 (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
1926 (build-system gnu-build-system)
1927 (inputs
1928 (list expat zlib))
1929 (synopsis "Data extractor for OpenStreetMap files")
1930 (description
1931 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1932 input file (in @code{.osm} or @code{.osm.pbf} format).")
1933 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1934 (license (list license:gpl2+
1935 license:lgpl2.1+
1936 license:mpl1.1))))
1937
1938 (define-public shapelib
1939 (package
1940 (name "shapelib")
1941 (version "1.5.0")
1942 (source
1943 (origin
1944 (method git-fetch)
1945 (uri (git-reference
1946 (url "https://github.com/OSGeo/shapelib")
1947 (commit (string-append "v" version))))
1948 (file-name (git-file-name name version))
1949 (sha256
1950 (base32 "1lzch0jf6yqhw391phhafzw4ghmiz98zkf698h4fmq109fa2vhqd"))))
1951 (build-system gnu-build-system)
1952 (native-inputs
1953 (list autoconf automake libtool))
1954 (home-page "http://shapelib.maptools.org/")
1955 (synopsis "Provides C library to write and update ESRI Shapefiles")
1956 (description
1957 "The Shapefile C Library provides the ability to write simple C programs
1958 for reading, writing and updating (to a limited extent) ESRI Shapefiles, and the
1959 associated attribute file (@file{.dbf}).")
1960 (license license:gpl2+)))
1961
1962 (define-public spatialite-tools
1963 (package
1964 (name "spatialite-tools")
1965 (version "5.0.1")
1966 (source
1967 (origin
1968 (method url-fetch)
1969 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1970 "spatialite-tools-" version ".tar.gz"))
1971 (sha256
1972 (base32 "070p6pg541wvwb28wkn7k0z1qdyirik2qc2jpj4pf0vzx02w414n"))))
1973 (build-system gnu-build-system)
1974 (native-inputs
1975 (list pkg-config))
1976 (inputs
1977 (list expat
1978 freexl
1979 geos
1980 librttopo
1981 libspatialite
1982 libxml2
1983 minizip
1984 proj
1985 readosm
1986 sqlite))
1987 (synopsis "Collection of command line tools for SpatiaLite")
1988 (description
1989 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1990 tools supporting SpatiaLite.")
1991 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1992 (license license:gpl3+)))
1993
1994 (define-public virtualpg
1995 (package
1996 (name "virtualpg")
1997 (version "2.0.1")
1998 (source
1999 (origin
2000 (method url-fetch)
2001 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
2002 "virtualpg-" version ".tar.gz"))
2003 (sha256
2004 (base32 "12z0l7368r4116ljzg7nljy5hf425r11vxc540w79wlzikmynamy"))))
2005 (build-system gnu-build-system)
2006 (inputs
2007 (list postgresql sqlite))
2008 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
2009 (description
2010 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
2011 the VirtualPostgres driver, allowing to directly exchange data between SQLite
2012 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
2013 exchanged form one Spatial DBMS and the other.")
2014 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
2015 (license (list license:gpl2+
2016 license:lgpl2.1+
2017 license:mpl1.1))))
2018
2019 (define-public opencpn
2020 (package
2021 (name "opencpn")
2022 (version "5.6.0")
2023 (source
2024 (origin
2025 (method git-fetch)
2026 (uri (git-reference
2027 (url "https://github.com/OpenCPN/OpenCPN")
2028 (commit (string-append "Release_" version))))
2029 (file-name (git-file-name name version))
2030 (sha256
2031 (base32 "0g5x45wv3djfjmigk6kgs0i63yp8rs1fbmm4pb15wb3z6dml624y"))))
2032 (build-system cmake-build-system)
2033 (native-inputs
2034 `(("gettext" ,gettext-minimal)
2035 ("pkg-config" ,pkg-config)))
2036 (inputs
2037 (list alsa-utils
2038 bzip2
2039 cairo
2040 curl
2041 eudev
2042 glu
2043 gtk+
2044 jasper
2045 libarchive
2046 libelf
2047 libexif
2048 libjpeg-turbo
2049 libsndfile
2050 libusb
2051 lz4
2052 mesa
2053 pango
2054 portaudio
2055 sqlite
2056 tinyxml
2057 wxsvg
2058 wxwidgets
2059 xz
2060 zlib))
2061 (arguments
2062 `(#:configure-flags '("-DOCPN_USE_BUNDLED_LIBS=OFF"
2063 "-DOCPN_ENABLE_PORTAUDIO=ON"
2064 "-DOCPN_ENABLE_SNDFILE=ON"
2065 "-DOCPN_BUNDLE_TCDATA=ON"
2066 "-DOCPN_BUNDLE_GSHHS=ON")
2067 #:tests? #f ; No tests defined
2068 #:phases
2069 (modify-phases %standard-phases
2070 (add-after 'unpack 'fix-build
2071 (lambda* (#:key inputs #:allow-other-keys)
2072 (substitute* "CMakeLists.txt"
2073 (("wx-32.c; cc")
2074 "wx-32.c; gcc")
2075 (("\"/bin/sh\" \"-c\"")
2076 (string-append "\"" (which "bash") "\" \"-c\""))
2077 (("include\\(TargetSetup\\)")
2078 "set(PKG_TARGET \"guix\")\nset(PKG_TARGET_VERSION 1)")))))))
2079 (synopsis "Chart plotter and marine GPS navigation software")
2080 (description
2081 "OpenCPN is a chart plotter and marine navigation software designed to be
2082 used at the helm station of your boat while underway. Chart a course and
2083 track your position right from your laptop.")
2084 (home-page "https://opencpn.org/")
2085 (license (list license:asl2.0
2086 license:cc0
2087 license:bsd-2
2088 license:bsd-3
2089 license:expat
2090 license:gpl3+
2091 license:lgpl2.1+
2092 license:lgpl3+
2093 license:sgifreeb2.0
2094 license:zlib))))
2095
2096 (define-public openorienteering-mapper
2097 (package
2098 (name "openorienteering-mapper")
2099 (version "0.9.5")
2100 (source (origin
2101 (method git-fetch)
2102 (uri (git-reference
2103 (url "https://github.com/OpenOrienteering/mapper")
2104 (commit (string-append "v" version))))
2105 (file-name (git-file-name name version))
2106 (sha256
2107 (base32
2108 "11b578h8f3q9yvphbjhqmy2w1cfc9skslzawypqmc3k44v24aj0s"))))
2109 (build-system cmake-build-system)
2110 (arguments
2111 `(#:tests? #f
2112 #:configure-flags
2113 (list
2114 "-DLICENSING_PROVIDER:BOOL=OFF"
2115 "-DMapper_MANUAL_QTHELP:BOOL=OFF")))
2116 (inputs
2117 `(("clipper" ,clipper)
2118 ("cups" ,cups)
2119 ("gdal" ,gdal)
2120 ("proj" ,proj)
2121 ("qtbase" ,qtbase-5)
2122 ("qtimageformats" ,qtimageformats)
2123 ("qtlocation" ,qtlocation)
2124 ("qtsensors" ,qtsensors)
2125 ("zlib" ,zlib)))
2126 (native-inputs
2127 `(("doxygen" ,doxygen)
2128 ("qttools" ,qttools)))
2129 (home-page "https://www.openorienteering.org/apps/mapper/")
2130 (synopsis "OpenOrienteering Mapper (OOM)")
2131 (description
2132 "OpenOrienteering Mapper is a software for creating maps for the
2133 orienteering sport.")
2134 (license license:gpl3+)))
2135
2136 (define-public grass
2137 (let* ((version "7.8.6")
2138 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
2139 (grassxx (string-append "grass" majorminor)))
2140 (package
2141 (name "grass")
2142 (version version)
2143 (source
2144 (origin
2145 (method url-fetch)
2146 (uri (string-append "https://grass.osgeo.org/" grassxx
2147 "/source/grass-" version ".tar.gz"))
2148 (sha256
2149 (base32 "1glk74ly3j0x8ymn4jp73s6y8qv7p3g5nv4gvb6l9qqplyq1fpnq"))))
2150 (build-system gnu-build-system)
2151 (inputs
2152 `(("bzip2" ,bzip2)
2153 ("cairo" ,cairo)
2154 ("fftw" ,fftw)
2155 ("freetype" ,freetype)
2156 ("gdal" ,gdal)
2157 ("geos" ,geos)
2158 ("glu" ,glu)
2159 ("lapack" ,lapack)
2160 ("libpng" ,libpng)
2161 ("libtiff" ,libtiff)
2162 ("mesa" ,mesa)
2163 ("mariadb-dev" ,mariadb "dev")
2164 ("mariadb-lib" ,mariadb "lib")
2165 ("netcdf" ,netcdf)
2166 ("openblas" ,openblas)
2167 ("perl" ,perl)
2168 ("postgresql" ,postgresql)
2169 ("proj" ,proj)
2170 ("python" ,python)
2171 ("python-dateutil" ,python-dateutil)
2172 ("python-numpy" ,python-numpy)
2173 ("python-wxpython" ,python-wxpython)
2174 ("readline" ,readline)
2175 ("sqlite" ,sqlite)
2176 ("wxwidgets" ,wxwidgets)
2177 ("zlib" ,zlib)
2178 ("zstd" ,zstd "lib")))
2179 (native-inputs
2180 `(("bash" ,bash-minimal)
2181 ("bison" ,bison)
2182 ("flex" ,flex)
2183 ("pkg-config" ,pkg-config)))
2184 (arguments
2185 `(#:tests? #f ; No tests
2186 #:modules ((guix build gnu-build-system)
2187 ((guix build python-build-system) #:prefix python:)
2188 (guix build utils))
2189 #:imported-modules (,@%gnu-build-system-modules
2190 (guix build python-build-system))
2191 #:phases
2192 (modify-phases %standard-phases
2193 (replace 'configure
2194 (lambda* (#:key inputs outputs #:allow-other-keys)
2195 (let ((shell (search-input-file inputs "/bin/bash")))
2196 (setenv "SHELL" shell)
2197 (setenv "CONFIG_SHELL" shell)
2198 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
2199 (assoc-ref outputs "out")
2200 "/" ,grassxx "/lib")))
2201 (invoke "./configure"
2202 (string-append "--prefix="
2203 (assoc-ref outputs "out"))
2204 "--with-blas"
2205 "--with-bzlib"
2206 (string-append "--with-freetype-includes="
2207 (assoc-ref inputs "freetype")
2208 "/include/freetype2")
2209 (string-append "--with-freetype-libs="
2210 (assoc-ref inputs "freetype")
2211 "/lib")
2212 "--with-geos"
2213 "--with-lapack"
2214 "--with-mysql"
2215 (string-append "--with-mysql-includes="
2216 (assoc-ref inputs "mariadb-dev")
2217 "/include/mysql")
2218 (string-append "--with-mysql-libs="
2219 (assoc-ref inputs "mariadb-lib")
2220 "/lib")
2221 "--with-netcdf"
2222 "--with-postgres"
2223 (string-append "--with-proj-share="
2224 (assoc-ref inputs "proj")
2225 "/share/proj")
2226 "--with-pthread"
2227 "--with-readline"
2228 "--with-sqlite"
2229 "--with-wxwidgets")))
2230 (add-after 'install 'install-links
2231 (lambda* (#:key outputs #:allow-other-keys)
2232 ;; Put links for includes and libraries in the standard places.
2233 (let* ((out (assoc-ref outputs "out"))
2234 (dir (string-append out "/" ,grassxx)))
2235 (symlink (string-append dir "/include")
2236 (string-append out "/include"))
2237 (symlink (string-append dir "/lib")
2238 (string-append out "/lib")))
2239 #t))
2240 (add-after 'install-links 'python:wrap
2241 (assoc-ref python:%standard-phases 'wrap))
2242 (add-after 'python:wrap 'wrap-with-python-interpreter
2243 (lambda* (#:key outputs #:allow-other-keys)
2244 (let ((out (assoc-ref outputs "out")))
2245 (wrap-program (string-append out "/bin/" ,grassxx)
2246 `("GRASS_PYTHON" = (,(which "python3"))))
2247 #t))))))
2248 (synopsis "GRASS Geographic Information System")
2249 (description
2250 "GRASS (Geographic Resources Analysis Support System), is a Geographic
2251 Information System (GIS) software suite used for geospatial data management and
2252 analysis, image processing, graphics and maps production, spatial modeling, and
2253 visualization.")
2254 (home-page "https://grass.osgeo.org/")
2255 (license license:gpl2+))))
2256
2257 (define-public saga
2258 (package
2259 (name "saga")
2260 (version "7.9.0")
2261 (source
2262 (origin
2263 (method url-fetch)
2264 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
2265 (version-major version) "/SAGA%20-%20" version
2266 "/saga-" version ".tar.gz"))
2267 (sha256
2268 (base32 "1n051yxxkylly0k9rlkx2ih3j2lf9d4csg00sm7161r7nhjvggd1"))))
2269 (build-system gnu-build-system)
2270 (native-inputs
2271 (list pkg-config swig))
2272 (inputs
2273 (list curl
2274 fftw
2275 gdal
2276 hdf5
2277 jasper
2278 libharu
2279 libtiff
2280 opencv
2281 postgresql
2282 proj
2283 python
2284 qhull
2285 unixodbc
2286 vigra
2287 wxwidgets))
2288 (arguments
2289 '(#:configure-flags '("--enable-python")))
2290 (synopsis "System for Automated Geoscientific Analyses")
2291 (description
2292 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
2293 Information System (GIS) software. It has been designed for an easy and
2294 effective implementation of spatial algorithms and it offers a comprehensive,
2295 growing set of geoscientific methods.")
2296 (home-page "http://www.saga-gis.org")
2297 (license (list license:gpl2+ license:lgpl2.1+))))
2298
2299 (define-public qgis
2300 (package
2301 (name "qgis")
2302 (version "3.16.3")
2303 (source
2304 (origin
2305 (method url-fetch)
2306 (uri (string-append "https://qgis.org/downloads/qgis-"
2307 version ".tar.bz2"))
2308 (sha256
2309 (base32 "012dv8dcg7w4lf6k37i41wialwhi0kpkxw2dnq19yqqk35632mzx"))))
2310 (build-system cmake-build-system)
2311 (arguments
2312 `(#:modules ((guix build cmake-build-system)
2313 ((guix build python-build-system) #:prefix python:)
2314 (guix build qt-utils)
2315 (guix build utils))
2316 #:imported-modules (,@%cmake-build-system-modules
2317 (guix build python-build-system)
2318 (guix build qt-utils))
2319 #:configure-flags
2320 '("-DWITH_QTWEBKIT=NO")
2321 #:phases
2322 (modify-phases %standard-phases
2323 ;; Configure correct path to PyQt5 SIP directory
2324 (add-after 'unpack 'configure-pyqt5-sip-path
2325 (lambda* (#:key inputs #:allow-other-keys)
2326 (substitute* "cmake/FindPyQt5.py"
2327 (("sip_dir = cfg.default_sip_dir")
2328 (string-append "sip_dir = \""
2329 (assoc-ref inputs "python-pyqt+qscintilla")
2330 "/share/sip\""))
2331 ;; Fix building with python-sip@5.
2332 ;;
2333 ;; The reason for this is that python-sip@5 introduces some
2334 ;; changes such as a new build system 'sip-build' as well as the
2335 ;; use of the path "/lib/pythonX.X/site-packages/*/bindings/"
2336 ;; instead of "/share/sip/" for .sip files. However, we do not
2337 ;; actually use that those yet. QGIS detects SIP5 and assumes we
2338 ;; are, messing up the build. The long term solution is to fully
2339 ;; upgrade SIP, use sip-build and fix all failing packages, but
2340 ;; for now I just want to get the build working.
2341 ((".pyqt_sip_dir...os.path.join.*,")
2342 (string-append "'pyqt_sip_dir': \""
2343 (assoc-ref inputs "python-pyqt+qscintilla")
2344 "/share/sip" "\",")))
2345 (substitute* (list "scripts/prepare_commit.sh"
2346 "scripts/qstringfixup.sh"
2347 "scripts/release.pl"
2348 "scripts/runtests_local_travis_config.sh"
2349 "scripts/sip_include.sh"
2350 "scripts/sipdiff"
2351 "scripts/sipify_all.sh"
2352 "scripts/spell_check/check_spelling.sh"
2353 "scripts/spell_check/spell_test.sh"
2354 "scripts/verify_indentation.sh"
2355 "tests/code_layout/test_banned_keywords.sh"
2356 "tests/code_layout/test_licenses.sh"
2357 "tests/code_layout/test_shellcheck.sh"
2358 "tests/code_layout/test_sip_include.sh"
2359 "tests/code_layout/test_sipfiles.sh"
2360 "tests/code_layout/test_sipify.sh")
2361 (("\\$\\(git rev-parse --show-toplevel\\)")
2362 (getcwd)))
2363 (substitute* "tests/code_layout/test_sip_include.sh"
2364 (("^REV=.*") "REV=currentrev\n"))
2365 #t))
2366 (replace 'check
2367 (lambda* (#:key inputs tests? #:allow-other-keys)
2368 (when tests?
2369 (setenv "HOME" "/tmp")
2370 (system "Xvfb :1 &")
2371 (setenv "DISPLAY" ":1")
2372 (setenv "TRAVIS" "true")
2373 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
2374 (invoke "ctest"
2375 "-E" (string-join
2376 '(;; Disable tests that require network access
2377 "qgis_filedownloader"
2378 ;; TODO: Find why the following tests fail
2379 "ProcessingGdalAlgorithmsRasterTest"
2380 "ProcessingGdalAlgorithmsVectorTest"
2381 "ProcessingGrass7AlgorithmsImageryTest"
2382 "ProcessingGrass7AlgorithmsRasterTest"
2383 "ProcessingGrass7AlgorithmsVectorTest"
2384 "ProcessingOtbAlgorithmsTest"
2385 "ProcessingQgisAlgorithmsTestPt1"
2386 "ProcessingQgisAlgorithmsTestPt2"
2387 "ProcessingQgisAlgorithmsTestPt3"
2388 "ProcessingQgisAlgorithmsTestPt4"
2389 "PyCoreAdittions"
2390 "PyQgsAnnotation"
2391 "PyQgsAppStartup"
2392 "PyQgsAuthBasicMethod"
2393 "PyQgsAuthenticationSystem"
2394 "PyQgsAuxiliaryStorage"
2395 "PyQgsDBManagerGpkg"
2396 "PyQgsDBManagerSpatialite"
2397 "PyQgsDataItem"
2398 "PyQgsFieldValidator"
2399 "PyQgsFileUtils"
2400 "PyQgsGeometryTest"
2401 "PyQgsImageCache"
2402 "PyQgsImportIntoPostGIS"
2403 "PyQgsLayerDependencies"
2404 "PyQgsLayerMetadata"
2405 "PyQgsLayout"
2406 "PyQgsLayoutExporter"
2407 "PyQgsLayoutHtml"
2408 "PyQgsLayoutLegend"
2409 "PyQgsLayoutMapGrid"
2410 "PyQgsMapLayer"
2411 "PyQgsMetadataBase"
2412 "PyQgsOGRProvider"
2413 "PyQgsOGRProviderGpkg"
2414 "PyQgsOapifProvider"
2415 "PyQgsPalLabelingLayout"
2416 "PyQgsProject"
2417 "PyQgsProviderConnectionGpkg"
2418 "PyQgsProviderConnectionPostgres"
2419 "PyQgsProviderConnectionSpatialite"
2420 "PyQgsPythonProvider"
2421 "PyQgsRasterLayer"
2422 "PyQgsRulebasedRenderer"
2423 "PyQgsSelectiveMasking"
2424 "PyQgsSettings"
2425 "PyQgsShapefileProvider"
2426 "PyQgsSpatialiteProvider"
2427 "PyQgsSvgCache"
2428 "PyQgsSymbolExpressionVariables"
2429 "PyQgsTextRenderer"
2430 "PyQgsVectorFileWriter"
2431 "PyQgsVectorLayer"
2432 "PyQgsVectorLayerUtils"
2433 "PyQgsVirtualLayerProvider"
2434 "PyQgsWFSProvider"
2435 "qgis_arcgisrestutilstest"
2436 "qgis_authmanagertest"
2437 "qgis_compositionconvertertest"
2438 "qgis_coordinatereferencesystemtest"
2439 "qgis_expressiontest"
2440 "qgis_fontmarkertest"
2441 "qgis_geometrycheckstest"
2442 "qgis_geometrytest"
2443 "qgis_gpsinformationwidget"
2444 "qgis_grassprovidertest7"
2445 "qgis_imagecachetest"
2446 "qgis_labelingenginetest"
2447 "qgis_layouthtmltest"
2448 "qgis_layoutlabeltest"
2449 "qgis_layoutmanualtabletest"
2450 "qgis_layoutmapgridtest"
2451 "qgis_layoutmaptest"
2452 "qgis_layoutmultiframetest"
2453 "qgis_layoutpicturetest"
2454 "qgis_layouttabletest"
2455 "qgis_layouttest"
2456 "qgis_mapdevicepixelratiotest"
2457 "qgis_maprendererjobtest"
2458 "qgis_ogrproviderguitest"
2459 "qgis_painteffecttest"
2460 "qgis_pallabelingtest"
2461 "qgis_processingtest"
2462 "qgis_rasterlayertest"
2463 "qgis_shellcheck"
2464 "qgis_sip_include"
2465 "qgis_sip_uptodate"
2466 "qgis_sipify"
2467 "qgis_styletest"
2468 "qgis_svgmarkertest"
2469 "qgis_taskmanagertest"
2470 "qgis_wcsprovidertest"
2471 "qgis_ziplayertest")
2472 "|")))))
2473 (add-after 'install 'wrap-python
2474 (assoc-ref python:%standard-phases 'wrap))
2475 (add-after 'wrap-python 'wrap-qt
2476 (lambda* (#:key outputs inputs #:allow-other-keys)
2477 (let ((out (assoc-ref outputs "out")))
2478 (wrap-qt-program "qgis" #:output out #:inputs inputs))
2479 #t))
2480 (add-after 'wrap-qt 'wrap-gis
2481 (lambda* (#:key inputs outputs #:allow-other-keys)
2482 ;; TODO: Find if there is a way to get SAGA to work.
2483 ;; Currently QGIS says "version of SAGA not supported".
2484 ;; Disable it for now.
2485 (let* ((out (assoc-ref outputs "out"))
2486 ;;(saga (string-append (assoc-ref inputs "saga") "/bin"))
2487 (grass-version ,(package-version grass))
2488 (grass-majorminor (string-join
2489 (list-head
2490 (string-split grass-version #\.) 2)
2491 ""))
2492 (grass (string-append (assoc-ref inputs "grass")
2493 "/grass" grass-majorminor)))
2494 (wrap-program (string-append out "/bin/qgis")
2495 ;;`("PATH" ":" prefix (,saga))
2496 `("QGIS_PREFIX_PATH" = (,out))
2497 `("GISBASE" = (,grass))))
2498 #t)))))
2499 (inputs
2500 (list exiv2
2501 expat
2502 gdal
2503 geos
2504 gpsbabel
2505 grass
2506 gsl
2507 hdf5
2508 libspatialindex
2509 libspatialite
2510 libxml2
2511 libzip
2512 netcdf
2513 postgresql
2514 proj
2515 protobuf
2516 python
2517 python-chardet
2518 python-dateutil
2519 python-future
2520 python-gdal
2521 python-jinja2
2522 python-numpy
2523 python-owslib
2524 python-psycopg2
2525 python-pygments
2526 python-pyqt+qscintilla
2527 python-pytz
2528 python-pyyaml
2529 python-requests
2530 python-sip
2531 python-six
2532 python-urllib3
2533 qca
2534 qscintilla
2535 qtbase-5
2536 qtdeclarative
2537 qtkeychain
2538 qtlocation
2539 qtserialport
2540 qtsvg
2541 qwt
2542 ;;("saga" ,saga)
2543 sqlite))
2544 (native-inputs
2545 (list bison
2546 flex
2547 perl
2548 perl-yaml-tiny
2549 pkg-config
2550 python-mock
2551 python-nose2
2552 qttools
2553 shellcheck
2554 xorg-server-for-tests))
2555 (home-page "https://qgis.org")
2556 (synopsis "Geographical information system")
2557 (description "QGIS is an easy to use Geographical Information
2558 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2559 raster and vector data formats, with new support easily added using the plugin
2560 architecture.")
2561 (license
2562 (list
2563 license:asl1.1
2564 license:asl2.0
2565 license:bsd-2
2566 license:bsd-3
2567 license:boost1.0
2568 license:cc-by3.0
2569 license:cc-by4.0
2570 license:cc-by-sa3.0
2571 license:cc-by-sa4.0
2572 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2573 (license:fsf-free "file://debian/copyright" "Go Squared")
2574 license:expat
2575 license:fdl1.2+
2576 (license:fsf-free
2577 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2578 (license:fsf-free
2579 "file://debian/copyright"
2580 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2581 license:gpl2
2582 license:gpl2+
2583 license:gpl3
2584 license:gpl3+
2585 license:isc
2586 license:lgpl2.0+
2587 license:lgpl2.1
2588 license:lgpl2.1+
2589 license:lgpl3
2590 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2591 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2592 (license:non-copyleft
2593 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2594 "NCL Source Code License")
2595 license:ogl-psi1.0
2596 license:opl1.0+
2597 license:public-domain
2598 license:qwt1.0))))
2599
2600 (define-public python-geographiclib
2601 (package
2602 (name "python-geographiclib")
2603 (version "1.50")
2604 (source
2605 (origin
2606 (method url-fetch)
2607 (uri (pypi-uri "geographiclib" version))
2608 (sha256
2609 (base32
2610 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2611 (build-system python-build-system)
2612 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2613 (synopsis "Python geodesic routines from GeographicLib")
2614 (description
2615 "This is a python implementation of the geodesic routines in GeographicLib.")
2616 (license license:expat)))
2617
2618 (define-public python-geopy
2619 (package
2620 (name "python-geopy")
2621 (version "2.0.0")
2622 (source
2623 (origin
2624 (method url-fetch)
2625 (uri (pypi-uri "geopy" version))
2626 (sha256
2627 (base32
2628 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2629 (build-system python-build-system)
2630 (propagated-inputs
2631 (list python-geographiclib))
2632 (native-inputs
2633 (list python-async-generator
2634 python-coverage
2635 python-flake8
2636 python-isort
2637 python-pytest
2638 python-pytest-aiohttp
2639 python-readme-renderer
2640 python-pytz))
2641 (home-page "https://github.com/geopy/geopy")
2642 (synopsis "Geocoding library for Python")
2643 (description "@code{geopy} is a Python client for several popular geocoding
2644 web services. @code{geopy} makes it easy for Python developers to locate the
2645 coordinates of addresses, cities, countries, and landmarks across the globe
2646 using third-party geocoders and other data sources.")
2647 (license license:expat)))
2648
2649 (define-public gplates
2650 (package
2651 (name "gplates")
2652 (version "2.3.0")
2653 (source (origin
2654 (method url-fetch)
2655 (uri "https://www.earthbyte.org/download/8421/")
2656 (file-name (string-append name "-" version ".tar.bz2"))
2657 (sha256
2658 (base32
2659 "0lrcmcxc924ixddii8cyglqlwwxvk7f00g4yzbss5i3fgcbh8n96"))))
2660 (build-system cmake-build-system)
2661 (arguments
2662 `(#:configure-flags (list "-DBoost_NO_BOOST_CMAKE=ON")
2663 #:tests? #f)) ;no test target
2664 (inputs
2665 `(("boost" ,boost)
2666 ("cgal" ,cgal)
2667 ("gdal" ,gdal)
2668 ("glew" ,glew)
2669 ("glu" ,glu)
2670 ("gmp" ,gmp)
2671 ("mesa" ,mesa)
2672 ("mpfr" ,mpfr)
2673 ("proj" ,proj)
2674 ("python-3" ,python-3)
2675 ("python-numpy" ,python-numpy)
2676 ("qt" ,qtbase-5)
2677 ("qtsvg" ,qtsvg)
2678 ("qtxmlpatterns" ,qtxmlpatterns)
2679 ("qwt" ,qwt)
2680 ("zlib" ,zlib)))
2681 (home-page "https://www.gplates.org")
2682 (synopsis "Plate tectonics simulation program")
2683 (description "GPlates is a plate tectonics program. Manipulate
2684 reconstructions of geological and paleogeographic features through geological
2685 time. Interactively visualize vector, raster and volume data.")
2686 (license license:gpl2+)))