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