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 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>
16 ;;; This file is part of GNU Guix.
18 ;;; GNU Guix is free software; you can redistribute it and/or modify it
19 ;;; under the terms of the GNU General Public License as published by
20 ;;; the Free Software Foundation; either version 3 of the License, or (at
21 ;;; your option) any later version.
23 ;;; GNU Guix is distributed in the hope that it will be useful, but
24 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
25 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
26 ;;; GNU General Public License for more details.
28 ;;; You should have received a copy of the GNU General Public License
29 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31 (define-module (gnu packages geo)
32 #:use-module (guix build-system ant)
33 #:use-module (guix build-system cmake)
34 #:use-module (guix build-system glib-or-gtk)
35 #:use-module (guix build-system gnu)
36 #:use-module (guix build-system go)
37 #:use-module (guix build-system meson)
38 #:use-module (guix build-system python)
39 #:use-module (guix build-system qt)
40 #:use-module (guix build-system scons)
41 #:use-module (guix build-system r)
42 #:use-module (guix download)
43 #:use-module (guix git-download)
44 #:use-module (guix svn-download)
45 #:use-module ((guix licenses) #:prefix license:)
46 #:use-module (guix packages)
47 #:use-module (guix utils)
48 #:use-module (gnu packages)
49 #:use-module (gnu packages algebra)
50 #:use-module (gnu packages astronomy)
51 #:use-module (gnu packages audio)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages backup)
54 #:use-module (gnu packages bash)
55 #:use-module (gnu packages bison)
56 #:use-module (gnu packages boost)
57 #:use-module (gnu packages check)
58 #:use-module (gnu packages compression)
59 #:use-module (gnu packages curl)
60 #:use-module (gnu packages databases)
61 #:use-module (gnu packages datastructures)
62 #:use-module (gnu packages documentation)
63 #:use-module (gnu packages elf)
64 #:use-module (gnu packages flex)
65 #:use-module (gnu packages fonts)
66 #:use-module (gnu packages fontutils)
67 #:use-module (gnu packages gettext)
68 #:use-module (gnu packages gl)
69 #:use-module (gnu packages glib)
70 #:use-module (gnu packages gnome)
71 #:use-module (gnu packages gps)
72 #:use-module (gnu packages gtk)
73 #:use-module (gnu packages haskell-apps)
74 #:use-module (gnu packages image)
75 #:use-module (gnu packages image-processing)
76 #:use-module (gnu packages icu4c)
77 #:use-module (gnu packages java)
78 #:use-module (gnu packages kde)
79 #:use-module (gnu packages lua)
80 #:use-module (gnu packages maths)
81 #:use-module (gnu packages pcre)
82 #:use-module (gnu packages pdf)
83 #:use-module (gnu packages perl)
84 #:use-module (gnu packages photo)
85 #:use-module (gnu packages pkg-config)
86 #:use-module (gnu packages protobuf)
87 #:use-module (gnu packages pulseaudio)
88 #:use-module (gnu packages python)
89 #:use-module (gnu packages python-check)
90 #:use-module (gnu packages python-web)
91 #:use-module (gnu packages python-xyz)
92 #:use-module (gnu packages qt)
93 #:use-module (gnu packages readline)
94 #:use-module (gnu packages swig)
95 #:use-module (gnu packages sqlite)
96 #:use-module (gnu packages textutils)
97 #:use-module (gnu packages time)
98 #:use-module (gnu packages web)
99 #:use-module (gnu packages webkit)
100 #:use-module (gnu packages wxwidgets)
101 #:use-module (gnu packages xml)
102 #:use-module (gnu packages xorg))
110 (uri (string-append "http://download.osgeo.org/geos/geos-"
115 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
116 (build-system gnu-build-system)
117 (arguments `(#:phases
118 (modify-phases %standard-phases
120 'unpack 'patch-test-shebangs
122 (substitute* '("tests/xmltester/testrunner.sh"
123 "tests/geostest/testrunner.sh")
124 (("/bin/sh") (which "sh")))
128 (home-page "https://geos.osgeo.org/")
129 (synopsis "Geometry Engine for Geographic Information Systems")
131 "GEOS provides a spatial object model and fundamental geometric
132 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
133 it aims to contain the complete functionality of JTS in C++. This
134 includes all the OpenGIS Simple Features for SQL spatial predicate
135 functions and spatial operators, as well as specific JTS enhanced
136 topology functions.")
137 (license (list license:lgpl2.1+ ; Main distribution.
138 license:zlib ; tests/xmltester/tinyxml/*
139 license:public-domain)))) ; include/geos/timeval.h
141 (define-public gnome-maps
147 (uri (string-append "mirror://gnome/sources/" name "/"
148 (version-major+minor version) "/"
149 name "-" version ".tar.xz"))
152 "00xslcnhhwslqglgfv2im7vq3awa49y2jxzr8wsby7f713k28vf5"))))
153 (build-system meson-build-system)
157 (modify-phases %standard-phases
158 (add-after 'unpack 'skip-gtk-update-icon-cache
159 ;; Don't create 'icon-theme.cache'.
161 (substitute* "meson_post_install.py"
162 (("gtk-update-icon-cache") "true"))
164 (add-after 'install 'wrap
165 (lambda* (#:key inputs outputs #:allow-other-keys)
166 (let ((out (assoc-ref outputs "out"))
167 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
168 (geocode-glib-path (string-append
169 (assoc-ref inputs "geocode-glib")
171 (goa-path (string-append
172 (assoc-ref inputs "gnome-online-accounts:lib")
174 (gdk-pixbuf-path (string-append
175 (assoc-ref inputs "gdk-pixbuf")
177 (webkitgtk-path (string-append
178 (assoc-ref inputs "webkitgtk")
180 (wrap-program (string-append out "/bin/gnome-maps")
181 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
183 ;; There seems to be no way to embed the path of
184 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
185 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
186 ;; libgeocode-glib.so.0
187 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
190 ,geocode-glib-path)))
193 `(("gettext" ,gettext-minimal)
194 ("gobject-introspection" ,gobject-introspection)
195 ("pkg-config" ,pkg-config)))
197 `(("evolution-data-server" ,evolution-data-server)
199 ("libchamplain" ,libchamplain)
201 ("libsecret" ,libsecret)
203 ("libgweather" ,libgweather)
205 ("gdk-pixbuf" ,gdk-pixbuf+svg)
206 ("glib-networking" ,glib-networking)
208 ("geocode-glib" ,geocode-glib)
209 ("gfbgraph" ,gfbgraph)
212 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
213 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
216 ("webkitgtk" ,webkitgtk)))
217 (synopsis "Graphical map viewer and wayfinding program")
218 (description "GNOME Maps is a graphical map viewer. It uses map data from
219 the OpenStreetMap project. It can provide directions for walking, bicycling,
221 (home-page "https://wiki.gnome.org/Apps/Maps")
222 (license license:gpl2+)))
224 (define-public libgaiagraphics
226 (name "libgaiagraphics")
231 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
235 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
236 (build-system gnu-build-system)
238 `(("pkg-config" ,pkg-config)))
242 ("libjpeg-turbo" ,libjpeg-turbo)
244 ("libgeotiff" ,libgeotiff)
248 (synopsis "Gaia common graphics support")
249 (description "libgaiagraphics is a library supporting
250 common-utility raster handling methods.")
251 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
252 (license license:lgpl3+)))
254 (define-public libgeotiff
261 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
263 (patches (search-patches
264 ;; See libgeotiff 1.5.1 issue
265 ;; https://github.com/OSGeo/libgeotiff/issues/22
266 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
268 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
269 (modules '((guix build utils)))
272 ;; Remove .csv files, distributed from EPSG under a restricted
273 ;; license. See LICENSE for full license text.
274 (for-each delete-file (find-files "." "\\.csv$"))
276 (build-system gnu-build-system)
278 `(("libjpeg-turbo" ,libjpeg-turbo)
282 `(;; libgeotiff headers include proj headers, so ensure those are available.
286 (list "--disable-static"
287 "--with-zlib" "--with-jpeg"
288 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
289 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
290 (description "libgeotiff is a library on top of libtiff for reading and
291 writing GeoTIFF information tags.")
292 (home-page "https://trac.osgeo.org/geotiff/")
293 ;; This is a mixture of various contributions under different licenses.
294 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
295 ;; states, as its commercial redistribution is restricted. Hence, we have
296 ;; removed it from the package.
297 (license (list license:public-domain
300 (license:non-copyleft "file://LICENSE"
301 "See LICENSE in the distribution.")))))
303 (define-public libspatialite
305 (name "libspatialite")
310 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
314 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
315 (build-system gnu-build-system)
317 `(("pkg-config" ,pkg-config)))
327 (modify-phases %standard-phases
328 ;; 3 tests are failing, ignore them:
329 (add-after 'unpack 'ignore-broken-tests
331 (substitute* '("test/Makefile.in")
332 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
333 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
334 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
336 (synopsis "Extend SQLite to support Spatial SQL capabilities")
338 "SpatiaLite is a library intended to extend the SQLite core to support
339 fully fledged Spatial SQL capabilities.")
340 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
341 ;; For the genuine libspatialite-sources holds:
342 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
343 ;; Files under src/control_points are from GRASS
344 ;; and are licensed under GPL2+ only.
345 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
346 (license (list license:gpl2+
349 license:public-domain))))
358 (uri (string-append "http://download.osgeo.org/proj/proj-"
362 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
363 (build-system gnu-build-system)
365 `(("sqlite" ,sqlite)))
367 `(("pkg-config" ,pkg-config)))
368 (home-page "https://proj.org/")
369 (synopsis "Coordinate transformation software")
371 "Proj is a generic coordinate transformation software that transforms
372 geospatial coordinates from one coordinate reference system (CRS) to another.
373 This includes cartographic projections as well as geodetic transformations.
374 PROJ includes command line applications for easy conversion of coordinates
375 from text files or directly from user input. In addition, proj also exposes
376 an application programming interface that lets developers use the
377 functionality of proj in their own software.")
378 (license (list license:expat
379 ;; src/projections/patterson.cpp
381 ;; src/geodesic.*, src/tests/geodtest.cpp
384 (define-public proj.4
390 (uri (string-append "http://download.osgeo.org/proj/proj-"
394 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
395 (build-system gnu-build-system)
398 (modify-phases %standard-phases
399 (add-after 'unpack 'patch-test-paths
401 (substitute* '("nad/test27"
407 (("/bin/rm") (which "rm")))
409 ;; Precision problems on i686 and other platforms. See:
410 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
411 ;; Disable failing test.
412 (add-after 'patch-test-paths 'ignore-failing-tests
414 (substitute* '("nad/Makefile.in")
415 (("\tPROJ_LIB.*" all) (string-append "#" all)))
419 (home-page "https://proj.org/")
420 (synopsis "Cartographic Projections Library")
422 "Proj.4 is a library for converting coordinates between cartographic
424 (license (list license:expat
425 ;; src/PJ_patterson.c
429 ;; Embedded EPSG database.
430 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
434 (define-public mapnik
441 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
442 version "/mapnik-v" version ".tar.bz2"))
445 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
446 (build-system scons-build-system)
450 ("freetype" ,freetype)
451 ("harfbuzz" ,harfbuzz)
453 ("libjpeg-turbo" ,libjpeg-turbo)
462 `(("pkg-config" ,pkg-config)))
464 `(#:scons ,scons-python2
467 (string-append "PREFIX=" %output)
468 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
469 (home-page "https://mapnik.org/")
470 (synopsis "Toolkit for developing mapping applications")
471 (description "Mapnik is a toolkit for developing mapping applications. It
472 is basically a collection of geographic objects like maps, layers,
473 datasources, features, and geometries. At its core is a C++ shared library
474 providing algorithms and patterns for spatial data access and visualization.
475 The library does not rely on any specific windowing system and can be deployed
476 to any server environment. It is intended to play fair in a multi-threaded
477 environment and is aimed primarily, but not exclusively, at web-based
479 (license (list license:lgpl2.1+
480 ;; demo/viewer, demo/python/rundemo.py
482 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
484 ;; deps/mapnik/sparsehash
487 (license:non-copyleft "file://deps/agg/copying")))))
489 (define-public python2-mapnik
491 (name "python2-mapnik")
496 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
498 (file-name (string-append name "-" version ".tar.gz"))
501 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
502 (build-system python-build-system)
505 ("harfbuzz" ,harfbuzz)
507 ("libjpeg-turbo" ,libjpeg-turbo)
513 ("python2-pycairo" ,python2-pycairo)))
515 (let ((test-data-input
516 (lambda (repository version hash)
519 (uri (string-append "https://github.com/mapnik/" repository
520 "/archive/v" version ".tar.gz"))
521 (file-name (string-append "python-mapnik-" repository
522 "-" version ".tar.gz"))
523 (sha256 (base32 hash))))))
524 `(("python2-nose" ,python2-nose)
525 ;; Test data is released as separate tarballs
527 ,(test-data-input "test-data" "3.0.18"
528 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
530 ,(test-data-input "test-data-visual" "3.0.18"
531 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
533 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
535 (modify-phases %standard-phases
536 ;; Unpack test data into the source tree
537 (add-after 'unpack 'unpack-submodules
538 (lambda* (#:key inputs #:allow-other-keys)
539 (let ((unpack (lambda (source target)
540 (with-directory-excursion target
541 (invoke "tar" "xvf" (assoc-ref inputs source)
542 "--strip-components=1")))))
543 (unpack "test-data" "test/data")
544 (unpack "test-data-visual" "test/data-visual"))))
545 ;; Skip failing tests
546 (add-after 'unpack 'skip-tests
548 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
549 "test_unicode_regex_replace"
550 "test_proj_antimeridian_bbox"
551 "test_render_with_scale_factor")))
552 (substitute* "setup.cfg"
553 (("\\[nosetests\\]" all)
554 (string-append all "\nexclude=^("
555 (string-join skipped-tests "|") ")$")))))))))
556 (home-page "https://github.com/mapnik/python-mapnik")
557 (synopsis "Python bindings for Mapnik")
558 (description "This package provides Python bindings for Mapnik.")
559 (license license:lgpl2.1+)))
561 (define-public spatialite-gui
563 (name "spatialite-gui")
568 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
572 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
573 (build-system gnu-build-system)
575 `(("pkg-config" ,pkg-config)))
579 ("libgaiagraphics" ,libgaiagraphics)
580 ("libjpeg-turbo" ,libjpeg-turbo)
581 ("libspatialite" ,libspatialite)
585 ("wxwidgets" ,wxwidgets-2)
588 `(#:phases (modify-phases %standard-phases
589 (add-after 'unpack 'fix-gui
591 ;; Fix for the GUI not showing up.
592 (substitute* "Main.cpp"
593 (("Hide\\(\\);") ""))
595 (synopsis "Graphical user interface for SpatiaLite")
596 (description "Spatialite-gui provides a visual interface for viewing and
597 maintaining a spatialite database. You can easily see the structure of the
598 tables and data contents using point and click functions, many of which
599 construct common SQL queries, or craft your own SQL queries.")
600 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
601 (license license:gpl3+)))
610 "http://download.osgeo.org/gdal/" version "/gdal-"
614 "1p6nmlsr8wbyq350pa6c22vrp98dcsa7yjnqsbhdbp74yj53nw9r"))
615 (modules '((guix build utils)))
618 ;; TODO: frmts contains a lot more bundled code.
619 (for-each delete-file-recursively
624 "frmts/jpeg/libjpeg12"
625 "frmts/gtiff/libtiff"
626 "frmts/gtiff/libgeotiff"
628 "ogr/ogrsf_frmts/geojson/libjson"))))))
629 (build-system gnu-build-system)
633 (let-syntax ((with (syntax-rules ()
635 (string-append option "="
636 (assoc-ref %build-inputs input))))))
638 ;; TODO: --with-pcidsk, --with-pcraster
639 (with "--with-freexl" "freexl")
640 (with "--with-libjson-c" "json-c")
641 (with "--with-png" "libpng")
642 (with "--with-webp" "libwebp")
643 (with "--with-gif" "giflib")
644 (with "--with-jpeg" "libjpeg-turbo")
645 (with "--with-libtiff" "libtiff")
646 (with "--with-geotiff" "libgeotiff")
647 (with "--with-libz" "zlib")
648 (with "--with-expat" "expat")
649 (with "--with-sqlite3" "sqlite")
652 (modify-phases %standard-phases
653 (add-before 'build 'fix-path
655 (substitute* "frmts/mrf/mrf_band.cpp"
656 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
663 ("libgeotiff" ,libgeotiff)
664 ("libjpeg-turbo" ,libjpeg-turbo)
670 ("postgresql" ,postgresql) ; libpq
675 `(("pkg-config" ,pkg-config)))
676 (home-page "https://gdal.org/")
677 (synopsis "Raster and vector geospatial data format library")
678 (description "GDAL is a translator library for raster and vector geospatial
679 data formats. As a library, it presents a single raster abstract data model
680 and single vector abstract data model to the calling application for all
681 supported formats. It also comes with a variety of useful command line
682 utilities for data translation and processing.")
686 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
687 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
690 ;; frmts/hdf4/hdf-eos/*
691 ;; similar to the expat license, but without guarantee exclusion
692 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
693 ;; frmts/grib/degrib/
694 license:public-domain ; with guarantee exclusion
696 ;; Some bsd-inspired license
697 (license:non-copyleft "file://port/LICENCE_minizip")
698 ;; alg/internal_libqhull
699 ;; Some 5-clause license
700 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
704 (define-public python-gdal
705 (package (inherit gdal)
707 (build-system python-build-system)
709 '(#:tests? #f ; no tests
711 (modify-phases %standard-phases
712 (add-before 'build 'chdir
714 (chdir "swig/python")
718 `(("python-numpy" ,python-numpy)))
721 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
723 (define-public postgis
729 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
733 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
734 (build-system gnu-build-system)
738 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
739 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
740 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
741 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
743 (modify-phases %standard-phases
744 (add-before 'build 'fix-install-path
745 (lambda* (#:key outputs #:allow-other-keys)
746 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
747 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
748 (string-append (assoc-ref outputs "out") "/bin"))))))))
754 ("libjpeg" ,libjpeg-turbo)
757 ("postgresql" ,postgresql)
761 ("pkg-config" ,pkg-config)))
762 (home-page "https://postgis.net")
763 (synopsis "Spatial database extender for PostgreSQL")
764 (description "PostGIS is a spatial database extender for PostgreSQL
765 object-relational database. It adds support for geographic objects allowing
766 location queries to be run in SQL. This package provides a PostgreSQL
771 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
774 license:public-domain
776 license:bsd-3 ; files only say "BSD"
778 license:cc-by-sa3.0))))
780 (define-public tegola
787 "https://github.com/go-spatial/tegola/archive/v"
789 (file-name (string-append name "-" version ".tar.gz"))
792 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
793 (build-system go-build-system)
795 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
796 #:unpack-path "github.com/go-spatial/tegola"
798 (modify-phases %standard-phases
799 (add-before 'build 'set-version
801 (with-directory-excursion "src/github.com/go-spatial/tegola"
802 (substitute* '("cmd/tegola/cmd/root.go"
803 "cmd/tegola_lambda/main.go")
804 (("version not set") ,version)))
806 (home-page "https://tegola.io")
807 (synopsis "Vector tile server for maps")
808 (description "Tegola is a free vector tile server written in Go. Tegola
809 takes geospatial data and slices it into vector tiles that can be efficiently
810 delivered to any client.")
813 ;; Some packages in vendor have other licenses
819 (define-public imposm3
822 (version "0.6.0-alpha.4")
826 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
828 (file-name (string-append name "-" version ".tar.gz"))
831 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
832 (build-system go-build-system)
834 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
835 #:unpack-path "github.com/omniscale/imposm3"
837 (modify-phases %standard-phases
838 (add-before 'build 'set-version
840 (substitute* "src/github.com/omniscale/imposm3/version.go"
841 (("0.0.0-dev") ,version))
845 ("leveldb" ,leveldb)))
846 (home-page "https://imposm.org/")
847 (synopsis "OpenStreetMap importer for PostGIS")
848 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
849 files and imports the data into PostgreSQL/PostGIS databases. It is designed
850 to create databases that are optimized for rendering/tile/map-services.")
853 ;; Some dependencies in vendor have different licenses
858 (define-public libosmium
866 (url "https://github.com/osmcode/libosmium")
867 (commit (string-append "v" version))))
868 (file-name (git-file-name name version))
870 (base32 "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2"))))
871 (build-system cmake-build-system)
879 ("protozero" ,protozero)
880 ("sparsehash" ,sparsehash)
884 `(("doxygen" ,doxygen)))
885 (home-page "https://osmcode.org/libosmium/")
886 (synopsis "C++ library for working with OpenStreetMap data")
887 (description "Libosmium is a fast and flexible C++ library for working with
888 OpenStreetMap data.")
889 (license license:boost1.0)))
891 (define-public osm2pgsql
899 (url "https://github.com/openstreetmap/osm2pgsql")
901 (file-name (git-file-name name version))
903 (base32 "1j35aa8qinhavliqi5pdm0viyi7lm5xyk402rliaxxs1r2hbsafn"))
904 (modules '((guix build utils)))
907 (delete-file-recursively "contrib/protozero")
908 (delete-file-recursively "contrib/libosmium")
910 (build-system cmake-build-system)
912 `(#:tests? #f; tests fail because we need to setup a database
914 (list (string-append "-DOSMIUM_INCLUDE_DIR="
915 (assoc-ref %build-inputs "libosmium")
917 (string-append "-DPROTOZERO_INCLUDE_DIR="
918 (assoc-ref %build-inputs "protozero")
924 ("libosmium" ,libosmium)
926 ("postgresql" ,postgresql)
928 ("protozero" ,protozero)
932 ("python-psycopg2" ,python-psycopg2)))
933 (home-page "https://github.com/openstreetmap/osm2pgsql")
934 (synopsis "OSM data importer to postgresql")
935 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
936 PostgreSQL / PostGIS database suitable for applications like rendering into a
937 map, geocoding with Nominatim, or general analysis.")
938 (license license:gpl2+)))
940 (define-public tippecanoe
948 (url "https://github.com/mapbox/tippecanoe")
950 (file-name (git-file-name name version))
952 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
953 (build-system gnu-build-system)
956 (modify-phases %standard-phases (delete 'configure))
960 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
965 (home-page "https://github.com/mapbox/tippecanoe")
966 (synopsis "Vector tile server for maps")
967 (description "Tippecanoe creates scale-independent view of data, so that
968 the texture and density of features is visible at every zoom level, instead of
969 dropping features at lower levels.")
970 (license license:bsd-2)))
972 (define-public osmctools
980 (url "https://gitlab.com/osm-c-tools/osmctools")
982 (file-name (git-file-name name version))
985 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
986 (build-system gnu-build-system)
988 `(("autoconf" ,autoconf)
989 ("automake" ,automake)))
992 (home-page "https://gitlab.com/osm-c-tools/osmctools")
993 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
994 (description "This project contains a few tools which are used in the
995 OpenStreetMap project. They can be used to convert, filter and update
996 OpenStreetMap data files.")
997 (license license:agpl3)))
999 (define-public osm-gps-map
1001 (name "osm-gps-map")
1007 "https://github.com/nzjrs/osm-gps-map/releases/download/"
1008 version "/osm-gps-map-" version ".tar.gz"))
1011 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
1012 (build-system gnu-build-system)
1014 `(("gnome-common" ,gnome-common)
1015 ("gtk-doc" ,gtk-doc)
1016 ("pkg-config" ,pkg-config)))
1020 ("gobject-introspection" ,gobject-introspection)
1022 ("libsoup" ,libsoup)))
1023 (home-page "https://nzjrs.github.io/osm-gps-map/")
1024 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1026 "This package provides a GTK+ widget (and Python bindings) that when
1027 given GPS coordinates,draws a GPS track, and points of interest on a moving
1028 map display. Downloads map data from a number of websites, including
1029 @url{https://www.openstreetmap.org}.")
1030 (license license:gpl2+)))
1032 (define-public xygrib
1039 (url "https://github.com/opengribs/XyGrib")
1040 (commit (string-append "v" version))))
1041 (file-name (git-file-name name version))
1044 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1045 (modules '((guix build utils)))
1047 '(begin (delete-file-recursively "data/fonts") #t))))
1048 (build-system cmake-build-system)
1051 (modify-phases %standard-phases
1052 (add-after 'unpack 'patch-directories
1053 (lambda* (#:key inputs #:allow-other-keys)
1054 (let ((jpeg (assoc-ref inputs "openjpeg"))
1055 (font (assoc-ref inputs "font-liberation")))
1056 (substitute* "CMakeLists.txt"
1059 ;; Fix install locations.
1060 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1061 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1062 ;; Skip looking for the static library.
1063 (("\"libnova.a\"") ""))
1064 ;; Don't use the bundled font-liberation.
1065 (substitute* "src/util/Font.cpp"
1066 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1067 (string-append "\"" font "/share/fonts/truetype/\"")))
1068 (substitute* "src/util/Util.h"
1069 (("pathData\\(\\)\\+\"data/fonts/\"")
1070 (string-append "\"" font "/share/fonts/\""))))
1072 #:tests? #f)) ; no tests
1074 `(("qttools" ,qttools)))
1077 ("font-liberation" ,font-liberation)
1078 ("libnova" ,libnova)
1080 ("openjpeg" ,openjpeg)
1084 (synopsis "Weather Forecast Visualization")
1086 "XyGrib is a Grib file reader and visualizes meteorological data providing
1087 an off-line capability to analyse weather forecasts or hindcasts. It is
1088 intended to be used as a capable weather work station for anyone with a serious
1089 interest in examining weather. This would include members of the sailing
1090 community, private and sport aviators, farmers, weather buffs and many more.
1091 XyGrib is the continuation of the zyGrib software package with a new team of
1093 (home-page "https://opengribs.org")
1094 (license license:gpl3+)))
1096 (define-public libspatialindex
1098 (name "libspatialindex")
1103 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1104 "releases/download/" version "/spatialindex-src-"
1105 version ".tar.bz2"))
1108 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1109 (build-system cmake-build-system)
1110 (home-page "https://libspatialindex.org")
1111 (synopsis "Spatial indexing library")
1112 (description "The purpose of this library is to provide:
1115 @item An extensible framework that will support robust spatial indexing
1117 @item Support for sophisticated spatial queries. Range, point location,
1118 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1119 by spatial constraints) should be easy to deploy and run.
1120 @item Easy to use interfaces for inserting, deleting and updating information.
1121 @item Wide variety of customization capabilities. Basic index and storage
1122 characteristics like the page size, node capacity, minimum fan-out, splitting
1123 algorithm, etc. should be easy to customize.
1124 @item Index persistence. Internal memory and external memory structures
1125 should be supported. Clustered and non-clustered indices should be easy to be
1129 (license license:expat)))
1131 (define-public java-jmapviewer
1133 (name "java-jmapviewer")
1137 (uri (string-append "https://svn.openstreetmap.org/applications/"
1138 "viewer/jmapviewer/releases/" version
1139 "/JMapViewer-" version "-Source.zip"))
1142 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1143 (build-system ant-build-system)
1145 `(("unzip" ,unzip)))
1147 `(#:build-target "pack"
1148 #:tests? #f; No tests
1150 (modify-phases %standard-phases
1151 (add-before 'build 'clean
1153 (invoke "ant" "clean")))
1155 (lambda* (#:key outputs #:allow-other-keys)
1156 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1158 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
1160 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1161 (synopsis "OSM map integration in Java")
1162 (description "JMapViewer is a Java component which easily
1163 integrates an OSM map view into your Java application. It is maintained as
1164 an independent project by the JOSM team.")
1165 (license license:gpl2)))
1167 (define-public java-opening-hours-parser
1169 (name "java-opening-hours-parser")
1174 (url "https://github.com/simonpoole/OpeningHoursParser")
1176 (file-name (git-file-name name version))
1179 "1m8sp0jbjyv1nq3ddj8rk6rf3sva3mkacc6vw7rsj0c2n57k3i50"))))
1180 (build-system ant-build-system)
1182 `(#:jar-name "java-opening-hours-parser.jar"
1183 #:source-dir "src/main/java"
1185 (modify-phases %standard-phases
1186 (add-before 'build 'copy-resources
1188 (copy-recursively "src/main/resources" "build/classes")
1190 (add-before 'build 'generate-parser
1192 (let* ((dir "src/main/java/ch/poole/openinghoursparser")
1193 (file (string-append dir "/OpeningHoursParser.jj")))
1194 (invoke "javacc" "-DEBUG_PARSER=false"
1195 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1196 "-GRAMMAR_ENCODING=UTF-8"
1197 (string-append "-OUTPUT_DIRECTORY=" dir)
1201 `(("java-jetbrains-annotations" ,java-jetbrains-annotations)))
1203 `(("javacc" ,javacc)
1204 ("java-junit" ,java-junit)
1205 ("java-hamcrest-core" ,java-hamcrest-core)))
1206 (home-page "https://github.com/simonpoole/OpeningHoursParser")
1207 (synopsis "Java parser for the OpenStreetMap opening hour format")
1208 (description "This is a very simplistic parser for string values according
1209 to the OSM opening hours specification.")
1210 (license license:expat)))
1219 (url "https://josm.openstreetmap.de/svn/trunk")
1220 (revision (string->number version))
1224 "131ly6ah9ygrah1wq1h2199v4hyzgflnh62ychs4jqvy9wz0dal6"))
1225 (file-name (string-append name "-" version "-checkout"))
1226 (modules '((guix build utils)))
1229 (for-each delete-file (find-files "." ".*.jar$"))
1231 (build-system ant-build-system)
1233 `(("javacc" ,javacc)))
1235 `(("java-commons-jcs" ,java-commons-jcs)
1236 ("java-commons-compress" ,java-commons-compress)
1237 ("java-jmapviewer" ,java-jmapviewer)
1238 ("java-jsonp-api" ,java-jsonp-api)
1239 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1240 ("java-metadata-extractor" ,java-metadata-extractor)
1241 ("java-opening-hours-parser" ,java-opening-hours-parser)
1242 ("java-openjfx-media" ,java-openjfx-media)
1243 ("java-signpost-core" ,java-signpost-core)
1244 ("java-svg-salamander" ,java-svg-salamander)))
1247 #:jar-name "josm.jar"
1249 (modify-phases %standard-phases
1250 (add-after 'unpack 'rm-build.xml
1252 (delete-file "build.xml")
1254 (add-before 'build 'fix-revision
1256 (with-output-to-file "REVISION.XML"
1259 (string-append "<info><entry><commit revision=\"" ,version "\">"
1260 "<date>1970-01-01 00:00:00 +0000</date>"
1261 "</commit></entry></info>"))))
1263 (add-before 'build 'fix-jcs
1265 ;; This version of JOSM uses an unreleased version of commons-jcs,
1266 ;; which has renamed its classes to another namespace. Rename them
1267 ;; back so they can be used with our version of jcs.
1268 (substitute* (find-files "." ".*.java$")
1271 (add-before 'build 'fix-classpath
1272 (lambda* (#:key inputs #:allow-other-keys)
1277 (let ((source (assoc-ref inputs "source")))
1278 (not (equal? (substring s 0 (string-length source)) source))))
1279 (string-split (getenv "CLASSPATH") #\:))
1282 (add-before 'build 'generate-parser
1284 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1285 (out (string-append dir "/parsergen"))
1286 (file (string-append dir "/MapCSSParser.jj")))
1287 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1288 (invoke "javacc" "-DEBUG_PARSER=false"
1289 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1290 "-GRAMMAR_ENCODING=UTF-8"
1291 (string-append "-OUTPUT_DIRECTORY=" out)
1294 (add-after 'build 'generate-epsg
1296 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1297 "-cp" "build/classes")
1298 (mkdir-p "data/projection")
1299 (with-output-to-file "data/projection/custom-epsg"
1300 (lambda _ (display "")))
1301 (invoke "java" "-cp" "build/classes:scripts:."
1302 "BuildProjectionDefinitions" ".")
1304 (add-after 'generate-epsg 'copy-resources
1306 (copy-recursively "resources" "build/classes")
1308 (add-before 'install 'regenerate-jar
1310 ;; We need to regenerate the jar file to add data.
1311 (delete-file "build/jar/josm.jar")
1312 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1313 "build/classes" ".")
1315 (add-before 'build 'copy-revision
1317 (mkdir-p "build/classes")
1318 (with-output-to-file "build/classes/REVISION"
1321 (string-append "Revision: " ,version "\n"
1322 "Is-Local-Build: true\n"
1323 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1325 (add-after 'install 'install-bin
1326 (lambda* (#:key outputs inputs #:allow-other-keys)
1327 (let* ((out (assoc-ref outputs "out"))
1328 (bin (string-append out "/bin")))
1330 (with-output-to-file (string-append bin "/josm")
1333 (string-append "#!/bin/sh\n"
1334 (assoc-ref inputs "jdk") "/bin/java"
1335 " -cp " out "/share/java/josm.jar:"
1336 (getenv "CLASSPATH")
1337 " org.openstreetmap.josm.gui.MainApplication"))))
1338 (chmod (string-append bin "/josm") #o755))
1340 (home-page "https://josm.openstreetmap.de")
1341 (synopsis "OSM editor")
1342 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1343 supports loading GPX tracks, background imagery and OSM data from local
1344 sources as well as from online sources and allows editing the OSM data (nodes,
1345 ways, and relations) and their metadata tags.")
1346 (license license:gpl2+)))
1348 (define-public libmaxminddb
1350 (name "libmaxminddb")
1355 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1356 "/releases/download/" version "/"
1357 "/libmaxminddb-" version ".tar.gz"))
1359 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1360 (build-system gnu-build-system)
1363 (modify-phases %standard-phases
1364 (add-before 'configure 'set-cc-to-gcc
1366 (setenv "CC" "gcc"))))))
1369 (home-page "https://maxmind.github.io/libmaxminddb/")
1370 (synopsis "C library for the MaxMind DB file format")
1371 (description "The libmaxminddb library provides a C library for reading
1372 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1373 format is a custom, but open, binary format designed to facilitate fast
1374 lookups of IP addresses while allowing flexibility in the type of data
1375 associated with an address.")
1376 (license license:asl2.0)))
1378 (define-public python-maxminddb
1380 (name "python-maxminddb")
1385 (uri (pypi-uri "maxminddb" version))
1388 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1389 (build-system python-build-system)
1391 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1393 `(("libmaxminddb" ,libmaxminddb)))
1394 (home-page "https://www.maxmind.com/")
1395 (synopsis "Reader for the MaxMind DB format")
1396 (description "MaxMind DB is a binary file format that stores data indexed
1397 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1399 (license license:asl2.0)))
1401 (define-public python-geoip2
1403 (name "python-geoip2")
1408 (uri (pypi-uri "geoip2" version))
1411 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1412 (build-system python-build-system)
1414 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1416 `(("python-maxminddb" ,python-maxminddb)
1417 ("python-requests" ,python-requests)))
1418 (home-page "https://www.maxmind.com/")
1419 (synopsis "MaxMind GeoIP2 API")
1420 (description "Provides an API for the GeoIP2 web services and databases.
1421 The API also works with MaxMind’s free GeoLite2 databases.")
1422 (license license:asl2.0)))
1424 (define-public routino
1431 (uri (string-append "http://www.routino.org/download/routino-"
1435 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1436 (build-system gnu-build-system)
1444 `(#:test-target "test"
1446 (modify-phases %standard-phases
1448 (lambda* (#:key outputs #:allow-other-keys)
1449 (substitute* "Makefile.conf"
1450 (("prefix=/usr/local")
1451 (string-append "prefix=" (assoc-ref outputs "out")))
1452 (("LDFLAGS_LDSO=-Wl,-R\\.")
1453 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1454 (("#CFLAGS\\+=-DUSE_XZ")
1456 (("#LDFLAGS\\+=-llzma")
1459 (synopsis "Routing application for OpenStreetMap data")
1461 "Routino is an application for finding a route between two points
1462 using the dataset of topographical information collected by
1463 @url{https://www.OpenStreetMap.org}.")
1464 (home-page "https://www.routino.org/")
1465 (license license:agpl3+)))
1467 (define-public qmapshack
1475 (url "https://github.com/Maproom/qmapshack")
1476 (commit (string-append "V_" version))))
1477 (file-name (git-file-name name version))
1480 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1481 (build-system qt-build-system)
1483 `(("pkg-config" ,pkg-config)
1484 ("qttools" ,qttools)))
1487 ("libjpeg-turbo" ,libjpeg-turbo)
1490 ("qtdeclarative" ,qtdeclarative)
1491 ("qtlocation" ,qtlocation)
1492 ("qtwebchannel" ,qtwebchannel)
1493 ("qtwebengine" ,qtwebengine)
1495 ("routino" ,routino)
1496 ("sqlite" ,sqlite) ; See wrap phase
1501 (modify-phases %standard-phases
1502 (add-after 'unpack 'fix-cmake-modules
1503 (lambda* (#:key inputs #:allow-other-keys)
1504 (substitute* "CMakeLists.txt"
1505 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1506 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1507 (substitute* "cmake/Modules/FindROUTINO.cmake"
1509 (assoc-ref inputs "routino")))
1510 ;; The following fixes are included as patches in the sources
1511 ;; of QMapShack, but they are not applied by default, for
1513 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1514 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1516 (add-after 'install 'wrap
1517 ;; The program fails to find the QtWebEngineProcess program,
1518 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1519 (lambda* (#:key inputs outputs #:allow-other-keys)
1520 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1521 (qtwebengineprocess (string-append
1522 (assoc-ref inputs "qtwebengine")
1523 "/lib/qt5/libexec/QtWebEngineProcess")))
1524 (for-each (lambda (program)
1525 (wrap-program program
1526 `("QTWEBENGINEPROCESS_PATH" =
1527 (,qtwebengineprocess))))
1528 (find-files bin ".*")))
1530 (synopsis "GPS mapping application")
1532 "QMapShack can be used to plan your next outdoor trip or to visualize and
1533 archive all the GPS recordings of your past trips. It is the successor of the
1534 QLandkarte GT application.")
1535 (home-page "https://github.com/Maproom/qmapshack/wiki")
1536 (license license:gpl3+)))
1538 (define-public readosm
1545 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1546 "readosm-" version ".tar.gz"))
1548 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1549 (build-system gnu-build-system)
1553 (synopsis "Data extractor for OpenStreetMap files")
1555 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1556 input file (in @code{.osm} or @code{.osm.pbf} format).")
1557 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1558 (license (list license:gpl2+
1562 (define-public spatialite-tools
1564 (name "spatialite-tools")
1569 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1570 "spatialite-tools-" version ".tar.gz"))
1572 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1573 (build-system gnu-build-system)
1575 `(("pkg-config" ,pkg-config)))
1580 ("libspatialite" ,libspatialite)
1581 ("libxml2" ,libxml2)
1583 ("readosm" ,readosm)
1586 (synopsis "Collection of command line tools for SpatiaLite")
1588 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1589 tools supporting SpatiaLite.")
1590 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1591 (license license:gpl3+)))
1593 (define-public virtualpg
1600 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1601 "virtualpg-" version ".tar.gz"))
1603 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1604 (build-system gnu-build-system)
1606 `(("postgresql" ,postgresql)
1607 ("sqlite" ,sqlite)))
1608 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1610 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1611 the VirtualPostgres driver, allowing to directly exchange data between SQLite
1612 and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1613 exchanged form one Spatial DBMS and the other.")
1614 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1615 (license (list license:gpl2+
1619 (define-public opencpn
1627 (url "https://github.com/OpenCPN/OpenCPN")
1628 (commit (string-append "v" version))))
1629 (file-name (git-file-name name version))
1631 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1632 (build-system cmake-build-system)
1634 `(("gettext" ,gettext-minimal)
1635 ("pkg-config" ,pkg-config)))
1642 ("libarchive" ,libarchive)
1644 ("libexif" ,libexif)
1645 ("libsndfile" ,libsndfile)
1649 ("portaudio" ,portaudio)
1651 ("tinyxml" ,tinyxml)
1653 ("wxwidgets" ,wxwidgets)
1657 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1658 "-DENABLE_SNDFILE=ON"
1659 "-DBUNDLE_TCDATA=ON"
1660 "-DBUNDLE_GSHHS=CRUDE")
1661 #:tests? #f ; No tests defined
1663 (modify-phases %standard-phases
1664 (add-after 'unpack 'fix-build
1666 (substitute* "CMakeLists.txt"
1667 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1668 (string-append all " --libs all")))
1670 (synopsis "Chart plotter and marine GPS navigation software")
1672 "OpenCPN is a chart plotter and marine navigation software designed to be
1673 used at the helm station of your boat while underway. Chart a course and
1674 track your position right from your laptop.")
1675 (home-page "https://opencpn.org/")
1676 (license (list license:asl2.0
1687 (define-public grass
1688 (let* ((version "7.8.2")
1689 (majorminor (string-join (list-head (string-split version #\.) 2) ""))
1690 (grassxx (string-append "grass" majorminor)))
1697 (uri (string-append "https://grass.osgeo.org/" grassxx
1698 "/source/grass-" version ".tar.gz"))
1700 (base32 "1fwsm99kz0bxvjk7442qq1h45ikrmhba8bqclafb61gqg1q6ymrk"))))
1701 (build-system gnu-build-system)
1706 ("freetype" ,freetype)
1712 ("libtiff" ,libtiff)
1714 ("mariadb-dev" ,mariadb "dev")
1715 ("mariadb-lib" ,mariadb "lib")
1717 ("openblas" ,openblas)
1719 ("postgresql" ,postgresql)
1722 ("python-dateutil" ,python-dateutil)
1723 ("python-numpy" ,python-numpy)
1724 ("python-wxpython" ,python-wxpython)
1725 ("readline" ,readline)
1727 ("wxwidgets" ,wxwidgets)
1729 ("zstd" ,zstd "lib")))
1731 `(("bash" ,bash-minimal)
1734 ("pkg-config" ,pkg-config)))
1736 `(#:tests? #f ; No tests
1737 #:modules ((guix build gnu-build-system)
1738 ((guix build python-build-system) #:prefix python:)
1740 #:imported-modules (,@%gnu-build-system-modules
1741 (guix build python-build-system))
1743 (modify-phases %standard-phases
1745 (lambda* (#:key inputs outputs #:allow-other-keys)
1746 (let ((shell (string-append (assoc-ref inputs "bash")
1748 (setenv "SHELL" shell)
1749 (setenv "CONFIG_SHELL" shell)
1750 (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
1751 (assoc-ref outputs "out")
1752 "/" ,grassxx "/lib")))
1753 (invoke "./configure"
1754 (string-append "--prefix="
1755 (assoc-ref outputs "out"))
1758 (string-append "--with-freetype-includes="
1759 (assoc-ref inputs "freetype")
1760 "/include/freetype2")
1761 (string-append "--with-freetype-libs="
1762 (assoc-ref inputs "freetype")
1767 (string-append "--with-mysql-includes="
1768 (assoc-ref inputs "mariadb-dev")
1770 (string-append "--with-mysql-libs="
1771 (assoc-ref inputs "mariadb-lib")
1775 (string-append "--with-proj-share="
1776 (assoc-ref inputs "proj.4")
1781 "--with-wxwidgets")))
1782 (add-after 'install 'install-links
1783 (lambda* (#:key outputs #:allow-other-keys)
1784 ;; Put links for includes and libraries in the standard places.
1785 (let* ((out (assoc-ref outputs "out"))
1786 (dir (string-append out "/" ,grassxx)))
1787 (symlink (string-append dir "/include")
1788 (string-append out "/include"))
1789 (symlink (string-append dir "/lib")
1790 (string-append out "/lib")))
1792 (add-after 'install-links 'wrap-python
1793 (assoc-ref python:%standard-phases 'wrap)))))
1794 (synopsis "GRASS Geographic Information System")
1796 "GRASS (Geographic Resources Analysis Support System), is a Geographic
1797 Information System (GIS) software suite used for geospatial data management and
1798 analysis, image processing, graphics and maps production, spatial modeling, and
1800 (home-page "https://grass.osgeo.org/")
1801 (license license:gpl2+))))
1810 (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
1811 (version-major version) "/SAGA%20-%20" version
1812 "/saga-" version ".tar.gz"))
1814 (base32 "09j5magmayq2y620kqa490mfd1kpdp3lng2ifcgbrmssc079ybm0"))))
1815 (build-system gnu-build-system)
1817 `(("pkg-config" ,pkg-config)
1825 ("libharu" ,libharu)
1826 ("libtiff" ,libtiff)
1828 ("postgresql" ,postgresql)
1832 ("unixodbc" ,unixodbc)
1834 ("wxwidgets" ,wxwidgets)))
1836 '(#:configure-flags '("--enable-python")))
1837 (synopsis "System for Automated Geoscientific Analyses")
1839 "SAGA (System for Automated Geoscientific Analyses) is a Geographic
1840 Information System (GIS) software. It has been designed for an easy and
1841 effective implementation of spatial algorithms and it offers a comprehensive,
1842 growing set of geoscientific methods.")
1843 (home-page "http://www.saga-gis.org")
1844 (license (list license:gpl2+ license:lgpl2.1+))))
1853 (uri (string-append "https://qgis.org/downloads/qgis-"
1854 version ".tar.bz2"))
1856 (base32 "1a41525y8ac44gzcfaffjx0lyrm49hgnr83jrq40r5mqd3vpmp57"))))
1857 (build-system cmake-build-system)
1859 `(#:modules ((guix build cmake-build-system)
1860 ((guix build python-build-system) #:prefix python:)
1861 (guix build qt-utils)
1863 #:imported-modules (,@%cmake-build-system-modules
1864 (guix build python-build-system)
1865 (guix build qt-utils))
1867 (modify-phases %standard-phases
1868 ;; Configure correct path to PyQt5 SIP directory
1869 (add-after 'unpack 'configure-pyqt5-sip-path
1870 (lambda* (#:key inputs #:allow-other-keys)
1871 (substitute* "cmake/FindPyQt5.cmake"
1872 (("\"\\\\\\\\1\" PYQT5_SIP_DIR")
1873 (string-append "\"" (assoc-ref inputs "python-pyqt+qscintilla")
1874 "/share/sip\" PYQT5_SIP_DIR")))
1875 (substitute* (list "scripts/prepare-commit.sh"
1876 "scripts/runtests-local-travis-config.sh"
1877 "scripts/sip_include.sh"
1879 "scripts/sipify_all.sh"
1880 "scripts/spell_check/check_spelling.sh"
1881 "scripts/spell_check/spell_test.sh"
1882 "scripts/verify-indentation.sh"
1883 "tests/code_layout/test_banned_keywords.sh"
1884 "tests/code_layout/test_licenses.sh"
1885 "tests/code_layout/test_shellcheck.sh"
1886 "tests/code_layout/test_sip_include.sh"
1887 "tests/code_layout/test_sipfiles_uptodate.sh"
1888 "tests/code_layout/test_sipify.sh")
1889 (("\\$\\(git rev-parse --show-toplevel\\)")
1891 (substitute* "tests/code_layout/test_sip_include.sh"
1892 (("^REV=.*") "REV=currentrev\n"))
1895 (lambda* (#:key inputs #:allow-other-keys)
1896 (setenv "HOME" "/tmp")
1897 (system (string-append (assoc-ref inputs "xorg-server")
1899 (setenv "DISPLAY" ":1")
1900 (setenv "TRAVIS" "true")
1901 (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
1904 '(;; Disable tests that require network access
1905 "qgis_filedownloader"
1906 ;; TODO: Find why the following tests fail
1907 "ProcessingQgisAlgorithmsTestPt1"
1908 "ProcessingQgisAlgorithmsTestPt2"
1909 "ProcessingQgisAlgorithmsTestPt3"
1910 "ProcessingQgisAlgorithmsTestPt4"
1911 "ProcessingGdalAlgorithmsRasterTest"
1912 "ProcessingGdalAlgorithmsVectorTest"
1913 "ProcessingGrass7AlgorithmsImageryTest"
1914 "ProcessingGrass7AlgorithmsRasterTest"
1915 "ProcessingGrass7AlgorithmsVectorTest"
1916 "ProcessingOtbAlgorithmsTest"
1917 "qgis_authmanagertest"
1918 "qgis_compositionconvertertest"
1919 "qgis_coordinatereferencesystemtest"
1921 "qgis_layouthtmltest"
1922 "qgis_layoutmaptest"
1923 "qgis_layoutmapgridtest"
1924 "qgis_painteffecttest"
1925 "qgis_pallabelingtest"
1926 "qgis_svgmarkertest"
1927 "qgis_taskmanagertest"
1929 "qgis_processingtest"
1930 "qgis_wcsprovidertest"
1931 "qgis_arcgisrestutilstest"
1932 "qgis_grassprovidertest7"
1933 "qgis_gpsinformationwidget"
1935 "PyQgsPythonProvider"
1937 "PyQgsAuthenticationSystem"
1942 "PyQgsLayerMetadata"
1945 "PyQgsLayoutMapGrid"
1947 "PyQgsLayoutExporter"
1950 "PyQgsOGRProviderGpkg"
1951 "PyQgsPalLabelingLayout"
1952 "PyQgsImportIntoPostGIS"
1953 "PyQgsProviderConnectionPostgres"
1954 "PyQgsProviderConnectionGpkg"
1955 "PyQgsShapefileProvider"
1959 "PyQgsSpatialiteProvider"
1960 "PyQgsVectorFileWriter"
1962 "PyQgsVectorLayerUtils"
1963 "PyQgsVirtualLayerProvider"
1965 "PyQgsOapifProvider"
1966 "PyQgsLayerDependencies"
1967 "PyQgsDBManagerGpkg"
1968 "PyQgsDBManagerSpatialite"
1970 "PyQgsAuxiliaryStorage"
1971 "PyQgsSelectiveMasking"
1973 "qgis_geometrycheckstest"
1977 "qgis_sip_uptodate")
1979 (add-after 'install 'wrap-python
1980 (assoc-ref python:%standard-phases 'wrap))
1981 (add-after 'wrap-python 'wrap-qt
1982 (lambda* (#:key outputs #:allow-other-keys)
1983 (wrap-qt-program (assoc-ref outputs "out") "qgis")
1985 (add-after 'wrap-qt 'wrap-gis
1986 (lambda* (#:key inputs outputs #:allow-other-keys)
1987 (let* ((out (assoc-ref outputs "out"))
1988 (saga (string-append (assoc-ref inputs "saga") "/bin"))
1989 (grass-version ,(package-version grass))
1990 (grass-majorminor (string-join
1992 (string-split grass-version #\.) 2)
1994 (grass (string-append (assoc-ref inputs "grass")
1995 "/grass" grass-majorminor)))
1996 (wrap-program (string-append out "/bin/qgis")
1997 `("PATH" ":" prefix (,saga))
1998 `("QGIS_PREFIX_PATH" = (,out))
1999 `("GISBASE" = (,grass))))
2006 ("gpsbabel" ,gpsbabel)
2010 ("libspatialindex" ,libspatialindex)
2011 ("libspatialite" ,libspatialite)
2012 ("libxml2" ,libxml2)
2015 ("postgresql" ,postgresql)
2018 ("python-chardet" ,python-chardet)
2019 ("python-dateutil" ,python-dateutil)
2020 ("python-gdal" ,python-gdal)
2021 ("python-jinja2" ,python-jinja2)
2022 ("python-numpy" ,python-numpy)
2023 ("python-owslib" ,python-owslib)
2024 ("python-psycopg2" ,python-psycopg2)
2025 ("python-pygments" ,python-pygments)
2026 ("python-pyqt+qscintilla" ,python-pyqt+qscintilla)
2027 ("python-pytz" ,python-pytz)
2028 ("python-pyyaml" ,python-pyyaml)
2029 ("python-requests" ,python-requests)
2030 ("python-sip" ,python-sip)
2031 ("python-six" ,python-six)
2032 ("python-urllib3" ,python-urllib3)
2034 ("qscintilla" ,qscintilla)
2036 ("qtdeclarative" ,qtdeclarative)
2037 ("qtkeychain" ,qtkeychain)
2038 ("qtlocation" ,qtlocation)
2039 ("qtserialport" ,qtserialport)
2041 ("qtwebkit" ,qtwebkit)
2044 ("sqlite" ,sqlite)))
2049 ("perl-yaml-tiny" ,perl-yaml-tiny)
2050 ("pkg-config" ,pkg-config)
2051 ("python-mock" ,python-mock)
2052 ("python-nose2" ,python-nose2)
2053 ("qttools" ,qttools)
2054 ("shellcheck" ,shellcheck)
2055 ("xorg-server" ,xorg-server-for-tests)))
2056 (home-page "https://qgis.org")
2057 (synopsis "Geographical information system")
2058 (description "QGIS is an easy to use Geographical Information
2059 System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
2060 raster and vector data formats, with new support easily added using the plugin
2073 (license:fsdg-compatible "https://www.deviantart.com/elvensword")
2074 (license:fsf-free "file://debian/copyright" "Go Squared")
2078 "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
2080 "file://debian/copyright"
2081 "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
2091 (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
2092 (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
2093 (license:non-copyleft
2094 "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
2095 "NCL Source Code License")
2098 license:public-domain
2101 (define-public python-geographiclib
2103 (name "python-geographiclib")
2108 (uri (pypi-uri "geographiclib" version))
2111 "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
2112 (build-system python-build-system)
2113 (home-page "https://geographiclib.sourceforge.io/1.50/python/")
2114 (synopsis "Python geodesic routines from GeographicLib")
2116 "This is a python implementation of the geodesic routines in GeographicLib.")
2117 (license license:expat)))
2119 (define-public python-geopy
2121 (name "python-geopy")
2126 (uri (pypi-uri "geopy" version))
2129 "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
2130 (build-system python-build-system)
2132 `(("python-geographiclib" ,python-geographiclib)))
2134 `(("python-async-generator" ,python-async-generator)
2135 ("python-coverage" ,python-coverage)
2136 ("python-flake8" ,python-flake8)
2137 ("python-isort" ,python-isort)
2138 ("python-pytest" ,python-pytest)
2139 ("python-pytest-aiohttp" ,python-pytest-aiohttp)
2140 ("python-readme-renderer" ,python-readme-renderer)
2141 ("python-pytz" ,python-pytz)))
2142 (home-page "https://github.com/geopy/geopy")
2143 (synopsis "Geocoding library for Python")
2144 (description "@code{geopy} is a Python client for several popular geocoding
2145 web services. @code{geopy} makes it easy for Python developers to locate the
2146 coordinates of addresses, cities, countries, and landmarks across the globe
2147 using third-party geocoders and other data sources.")
2148 (license license:expat)))