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