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 Julien Lepiller <julien@lepiller.eu>
10 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
11 ;;; Copyright © 2019 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 astronomy)
50 #:use-module (gnu packages autotools)
51 #:use-module (gnu packages boost)
52 #:use-module (gnu packages check)
53 #:use-module (gnu packages compression)
54 #:use-module (gnu packages databases)
55 #:use-module (gnu packages datastructures)
56 #:use-module (gnu packages documentation)
57 #:use-module (gnu packages fonts)
58 #:use-module (gnu packages fontutils)
59 #:use-module (gnu packages glib)
60 #:use-module (gnu packages gnome)
61 #:use-module (gnu packages gtk)
62 #:use-module (gnu packages image)
63 #:use-module (gnu packages icu4c)
64 #:use-module (gnu packages java)
65 #:use-module (gnu packages lua)
66 #:use-module (gnu packages maths)
67 #:use-module (gnu packages pcre)
68 #:use-module (gnu packages perl)
69 #:use-module (gnu packages pkg-config)
70 #:use-module (gnu packages protobuf)
71 #:use-module (gnu packages python)
72 #:use-module (gnu packages python-web)
73 #:use-module (gnu packages python-xyz)
74 #:use-module (gnu packages qt)
75 #:use-module (gnu packages sqlite)
76 #:use-module (gnu packages web)
77 #:use-module (gnu packages webkit)
78 #:use-module (gnu packages wxwidgets)
79 #:use-module (gnu packages xml))
87 (uri (string-append "http://download.osgeo.org/geos/geos-"
92 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
93 (build-system gnu-build-system)
95 (modify-phases %standard-phases
97 'unpack 'patch-test-shebangs
99 (substitute* '("tests/xmltester/testrunner.sh"
100 "tests/geostest/testrunner.sh")
101 (("/bin/sh") (which "sh")))
105 (home-page "https://geos.osgeo.org/")
106 (synopsis "Geometry Engine for Geographic Information Systems")
108 "GEOS provides a spatial object model and fundamental geometric
109 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
110 it aims to contain the complete functionality of JTS in C++. This
111 includes all the OpenGIS Simple Features for SQL spatial predicate
112 functions and spatial operators, as well as specific JTS enhanced
113 topology functions.")
114 (license (list license:lgpl2.1+ ; Main distribution.
115 license:zlib ; tests/xmltester/tinyxml/*
116 license:public-domain)))) ; include/geos/timeval.h
118 (define-public gnome-maps
124 (uri (string-append "mirror://gnome/sources/" name "/"
125 (version-major+minor version) "/"
126 name "-" version ".tar.xz"))
129 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
130 (build-system meson-build-system)
134 (modify-phases %standard-phases
135 (add-after 'unpack 'skip-gtk-update-icon-cache
136 ;; Don't create 'icon-theme.cache'.
138 (substitute* "meson_post_install.py"
139 (("gtk-update-icon-cache") "true"))
141 (add-after 'install 'wrap
142 (lambda* (#:key inputs outputs #:allow-other-keys)
143 (let ((out (assoc-ref outputs "out"))
144 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
145 (geocode-glib-path (string-append
146 (assoc-ref inputs "geocode-glib")
148 (goa-path (string-append
149 (assoc-ref inputs "gnome-online-accounts:lib")
151 (gdk-pixbuf-path (string-append
152 (assoc-ref inputs "gdk-pixbuf")
154 (webkitgtk-path (string-append
155 (assoc-ref inputs "webkitgtk")
157 (wrap-program (string-append out "/bin/gnome-maps")
158 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
160 ;; There seems to be no way to embed the path of
161 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
162 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
163 ;; libgeocode-glib.so.0
164 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
167 ,geocode-glib-path)))
170 `(("gobject-introspection" ,gobject-introspection)
171 ("intltool" ,intltool)
172 ("pkg-config" ,pkg-config)))
175 ("libchamplain" ,libchamplain)
177 ("libsecret" ,libsecret)
179 ("libgweather" ,libgweather)
181 ("gdk-pixbuf" ,gdk-pixbuf+svg)
182 ("glib-networking" ,glib-networking)
184 ("geocode-glib" ,geocode-glib)
185 ("gfbgraph" ,gfbgraph)
188 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
189 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
191 ("webkitgtk" ,webkitgtk)))
194 (synopsis "Graphical map viewer and wayfinding program")
195 (description "GNOME Maps is a graphical map viewer. It uses map data from
196 the OpenStreetMap project. It can provide directions for walking, bicycling,
198 (home-page "https://wiki.gnome.org/Apps/Maps")
199 (license license:gpl2+)))
201 (define-public libgaiagraphics
203 (name "libgaiagraphics")
208 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
212 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
213 (build-system gnu-build-system)
215 `(("pkg-config" ,pkg-config)))
219 ("libjpeg-turbo" ,libjpeg-turbo)
221 ("libgeotiff" ,libgeotiff)
225 (synopsis "Gaia common graphics support")
226 (description "libgaiagraphics is a library supporting
227 common-utility raster handling methods.")
228 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
229 (license license:lgpl3+)))
231 (define-public libgeotiff
238 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
240 (patches (search-patches
241 ;; See libgeotiff 1.5.1 issue
242 ;; https://github.com/OSGeo/libgeotiff/issues/22
243 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
245 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
246 (modules '((guix build utils)))
249 ;; Remove .csv files, distributed from EPSG under a restricted
250 ;; license. See LICENSE for full license text.
251 (for-each delete-file (find-files "." "\\.csv$"))
253 (build-system gnu-build-system)
255 `(("libjpeg-turbo" ,libjpeg-turbo)
259 `(;; libgeotiff headers include proj headers, so ensure those are available.
263 (list "--disable-static"
264 "--with-zlib" "--with-jpeg"
265 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
266 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
267 (description "libgeotiff is a library on top of libtiff for reading and
268 writing GeoTIFF information tags.")
269 (home-page "https://trac.osgeo.org/geotiff/")
270 ;; This is a mixture of various contributions under different licenses.
271 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
272 ;; states, as its commercial redistribution is restricted. Hence, we have
273 ;; removed it from the package.
274 (license (list license:public-domain
277 (license:non-copyleft "file://LICENSE"
278 "See LICENSE in the distribution.")))))
280 (define-public libspatialite
282 (name "libspatialite")
287 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
291 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
292 (build-system gnu-build-system)
294 `(("pkg-config" ,pkg-config)))
304 (modify-phases %standard-phases
305 ;; 3 tests are failing, ignore them:
306 (add-after 'unpack 'ignore-broken-tests
308 (substitute* '("test/Makefile.in")
309 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
310 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
311 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
313 (synopsis "Extend SQLite to support Spatial SQL capabilities")
315 "SpatiaLite is a library intended to extend the SQLite core to support
316 fully fledged Spatial SQL capabilities.")
317 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
318 ;; For the genuine libspatialite-sources holds:
319 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
320 ;; Files under src/control_points are from GRASS
321 ;; and are licensed under GPL2+ only.
322 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
323 (license (list license:gpl2+
326 license:public-domain))))
335 (uri (string-append "http://download.osgeo.org/proj/proj-"
339 "0l1as8f4zfg74fms6h5p5psziw0lpznja1xnirzsscpnfbwc005k"))))
340 (build-system gnu-build-system)
342 `(("sqlite" ,sqlite)))
344 `(("pkg-config" ,pkg-config)))
345 (home-page "https://proj.org/")
346 (synopsis "Coordinate transformation software")
348 "Proj is a generic coordinate transformation software that transforms
349 geospatial coordinates from one coordinate reference system (CRS) to another.
350 This includes cartographic projections as well as geodetic transformations.
351 PROJ includes command line applications for easy conversion of coordinates
352 from text files or directly from user input. In addition, proj also exposes
353 an application programming interface that lets developers use the
354 functionality of proj in their own software.")
355 (license (list license:expat
356 ;; src/projections/patterson.cpp
358 ;; src/geodesic.*, src/tests/geodtest.cpp
361 (define-public proj.4
367 (uri (string-append "http://download.osgeo.org/proj/proj-"
371 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
372 (build-system gnu-build-system)
375 (modify-phases %standard-phases
376 (add-after 'unpack 'patch-test-paths
378 (substitute* '("nad/test27"
384 (("/bin/rm") (which "rm")))
386 ;; Precision problems on i686 and other platforms. See:
387 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
388 ;; Disable failing test.
389 (add-after 'patch-test-paths 'ignore-failing-tests
391 (substitute* '("nad/Makefile.in")
392 (("\tPROJ_LIB.*" all) (string-append "#" all)))
396 (home-page "http://proj4.org/")
397 (synopsis "Cartographic Projections Library")
399 "Proj.4 is a library for converting coordinates between cartographic
401 (license (list license:expat
402 ;; src/PJ_patterson.c
406 ;; Embedded EPSG database.
407 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
411 (define-public mapnik
418 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
419 version "/mapnik-v" version ".tar.bz2"))
422 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
423 (build-system scons-build-system)
427 ("freetype" ,freetype)
428 ("harfbuzz" ,harfbuzz)
430 ("libjpeg-turbo" ,libjpeg-turbo)
439 `(("pkg-config" ,pkg-config)))
441 `(#:scons ,scons-python2
444 (string-append "PREFIX=" %output)
445 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
446 (home-page "http://mapnik.org/")
447 (synopsis "Toolkit for developing mapping applications")
448 (description "Mapnik is a toolkit for developing mapping applications. It
449 is basically a collection of geographic objects like maps, layers,
450 datasources, features, and geometries. At its core is a C++ shared library
451 providing algorithms and patterns for spatial data access and visualization.
452 The library does not rely on any specific windowing system and can be deployed
453 to any server environment. It is intended to play fair in a multi-threaded
454 environment and is aimed primarily, but not exclusively, at web-based
456 (license (list license:lgpl2.1+
457 ;; demo/viewer, demo/python/rundemo.py
459 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
461 ;; deps/mapnik/sparsehash
464 (license:non-copyleft "file://deps/agg/copying")))))
466 (define-public python2-mapnik
468 (name "python2-mapnik")
473 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
475 (file-name (string-append name "-" version ".tar.gz"))
478 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
479 (build-system python-build-system)
482 ("harfbuzz" ,harfbuzz)
484 ("libjpeg-turbo" ,libjpeg-turbo)
490 ("python2-pycairo" ,python2-pycairo)))
492 (let ((test-data-input
493 (lambda (repository version hash)
496 (uri (string-append "https://github.com/mapnik/" repository
497 "/archive/v" version ".tar.gz"))
498 (file-name (string-append "python-mapnik-" repository
499 "-" version ".tar.gz"))
500 (sha256 (base32 hash))))))
501 `(("python2-nose" ,python2-nose)
502 ;; Test data is released as separate tarballs
504 ,(test-data-input "test-data" "3.0.18"
505 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
507 ,(test-data-input "test-data-visual" "3.0.18"
508 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
510 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
512 (modify-phases %standard-phases
513 ;; Unpack test data into the source tree
514 (add-after 'unpack 'unpack-submodules
515 (lambda* (#:key inputs #:allow-other-keys)
516 (let ((unpack (lambda (source target)
517 (with-directory-excursion target
518 (invoke "tar" "xvf" (assoc-ref inputs source)
519 "--strip-components=1")))))
520 (unpack "test-data" "test/data")
521 (unpack "test-data-visual" "test/data-visual"))))
522 ;; Skip failing tests
523 (add-after 'unpack 'skip-tests
525 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
526 "test_unicode_regex_replace"
527 "test_proj_antimeridian_bbox"
528 "test_render_with_scale_factor")))
529 (substitute* "setup.cfg"
530 (("\\[nosetests\\]" all)
531 (string-append all "\nexclude=^("
532 (string-join skipped-tests "|") ")$")))))))))
533 (home-page "https://github.com/mapnik/python-mapnik")
534 (synopsis "Python bindings for Mapnik")
535 (description "This package provides Python bindings for Mapnik.")
536 (license license:lgpl2.1+)))
538 (define-public spatialite-gui
540 (name "spatialite-gui")
545 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
549 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
550 (build-system gnu-build-system)
552 `(("pkg-config" ,pkg-config)))
556 ("libgaiagraphics" ,libgaiagraphics)
557 ("libspatialite" ,libspatialite)
561 ("wxwidgets" ,wxwidgets-2)
563 (synopsis "Graphical user interface for SpatiaLite")
564 (description "Spatialite-gui provides a visual interface for viewing and
565 maintaining a spatialite database. You can easily see the structure of the
566 tables and data contents using point and click functions, many of which
567 construct common SQL queries, or craft your own SQL queries.")
568 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
569 (license license:gpl3+)))
578 "http://download.osgeo.org/gdal/" version "/gdal-"
582 "0f80izh9wshrsw55kg9abpip74hk6frk3hgqrkqbyn3f6i8g2z3q"))
583 (modules '((guix build utils)))
586 ;; TODO: frmts contains a lot more bundled code.
587 (for-each delete-file-recursively
592 "frmts/jpeg/libjpeg12"
593 "frmts/gtiff/libtiff"
594 "frmts/gtiff/libgeotiff"
596 "ogr/ogrsf_frmts/geojson/libjson"))))))
597 (build-system gnu-build-system)
601 (let-syntax ((with (syntax-rules ()
603 (string-append option "="
604 (assoc-ref %build-inputs input))))))
606 ;; TODO: --with-pcidsk, --with-pcraster
607 (with "--with-freexl" "freexl")
608 (with "--with-libjson-c" "json-c")
609 (with "--with-png" "libpng")
610 (with "--with-webp" "libwebp")
611 (with "--with-gif" "giflib")
612 (with "--with-jpeg" "libjpeg-turbo")
613 (with "--with-libtiff" "libtiff")
614 (with "--with-geotiff" "libgeotiff")
615 (with "--with-libz" "zlib")
616 (with "--with-expat" "expat")
617 (with "--with-sqlite3" "sqlite")
620 (modify-phases %standard-phases
621 (add-before 'build 'fix-path
623 (substitute* "frmts/mrf/mrf_band.cpp"
624 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
631 ("libgeotiff" ,libgeotiff)
632 ("libjpeg-turbo" ,libjpeg-turbo)
641 (home-page "https://gdal.org/")
642 (synopsis "Raster and vector geospatial data format library")
643 (description "GDAL is a translator library for raster and vector geospatial
644 data formats. As a library, it presents a single raster abstract data model
645 and single vector abstract data model to the calling application for all
646 supported formats. It also comes with a variety of useful command line
647 utilities for data translation and processing.")
651 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
652 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
655 ;; frmts/hdf4/hdf-eos/*
656 ;; similar to the expat license, but without guarantee exclusion
657 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
658 ;; frmts/grib/degrib/
659 license:public-domain ; with guarantee exclusion
661 ;; Some bsd-inspired license
662 (license:non-copyleft "file://port/LICENCE_minizip")
663 ;; alg/internal_libqhull
664 ;; Some 5-clause license
665 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
669 (define-public python-gdal
670 (package (inherit gdal)
672 (build-system python-build-system)
674 '(#:tests? #f ; no tests
676 (modify-phases %standard-phases
677 (add-before 'build 'chdir
679 (chdir "swig/python")
683 `(("python-numpy" ,python-numpy)))
686 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
688 (define-public postgis
694 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
698 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
699 (build-system gnu-build-system)
703 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
704 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
705 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
706 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
708 (modify-phases %standard-phases
709 (add-before 'build 'fix-install-path
710 (lambda* (#:key outputs #:allow-other-keys)
711 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
712 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
713 (string-append (assoc-ref outputs "out") "/bin"))))))))
718 ("libjpeg" ,libjpeg-turbo)
721 ("postgresql" ,postgresql)
725 ("pkg-config" ,pkg-config)))
726 (home-page "https://postgis.net")
727 (synopsis "Spatial database extender for PostgreSQL")
728 (description "PostGIS is a spatial database extender for PostgreSQL
729 object-relational database. It adds support for geographic objects allowing
730 location queries to be run in SQL. This package provides a PostgreSQL
735 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
738 license:public-domain
740 license:bsd-3 ; files only say "BSD"
742 license:cc-by-sa3.0))))
744 (define-public tegola
751 "https://github.com/go-spatial/tegola/archive/v"
753 (file-name (string-append name "-" version ".tar.gz"))
756 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
757 (build-system go-build-system)
759 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
760 #:unpack-path "github.com/go-spatial/tegola"
762 (modify-phases %standard-phases
763 (add-before 'build 'set-version
765 (with-directory-excursion "src/github.com/go-spatial/tegola"
766 (substitute* '("cmd/tegola/cmd/root.go"
767 "cmd/tegola_lambda/main.go")
768 (("version not set") ,version)))
770 (home-page "http://tegola.io")
771 (synopsis "Vector tile server for maps")
772 (description "Tegola is a free vector tile server written in Go. Tegola
773 takes geospatial data and slices it into vector tiles that can be efficiently
774 delivered to any client.")
777 ;; Some packages in vendor have other licenses
783 (define-public imposm3
786 (version "0.6.0-alpha.4")
790 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
792 (file-name (string-append name "-" version ".tar.gz"))
795 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
796 (build-system go-build-system)
798 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
799 #:unpack-path "github.com/omniscale/imposm3"
801 (modify-phases %standard-phases
802 (add-before 'build 'set-version
804 (substitute* "src/github.com/omniscale/imposm3/version.go"
805 (("0.0.0-dev") ,version))
809 ("leveldb" ,leveldb)))
810 (home-page "https://imposm.org/")
811 (synopsis "OpenStreetMap importer for PostGIS")
812 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
813 files and imports the data into PostgreSQL/PostGIS databases. It is designed
814 to create databases that are optimized for rendering/tile/map-services.")
817 ;; Some dependencies in vendor have different licenses
822 (define-public libosmium
830 (url "https://github.com/osmcode/libosmium.git")
831 (commit (string-append "v" version))))
832 (file-name (git-file-name name version))
834 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
835 (build-system cmake-build-system)
842 ("protozero" ,protozero)
843 ("sparsehash" ,sparsehash)
846 `(("doxygen" ,doxygen)))
847 (home-page "https://osmcode.org/libosmium/")
848 (synopsis "C++ library for working with OpenStreetMap data")
849 (description "Libosmium is a fast and flexible C++ library for working with
850 OpenStreetMap data.")
851 (license license:boost1.0)))
853 (define-public osm2pgsql
861 (url "https://github.com/openstreetmap/osm2pgsql.git")
863 (file-name (git-file-name name version))
865 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
866 (modules '((guix build utils)))
869 (delete-file-recursively "contrib/protozero")
870 (delete-file-recursively "contrib/libosmium")
872 (build-system cmake-build-system)
874 `(#:tests? #f; tests fail because we need to setup a database
876 (list (string-append "-DOSMIUM_INCLUDE_DIR="
877 (assoc-ref %build-inputs "libosmium")
879 (string-append "-DPROTOZERO_INCLUDE_DIR="
880 (assoc-ref %build-inputs "protozero")
885 ("libosmium" ,libosmium)
887 ("postgresql" ,postgresql)
889 ("protozero" ,protozero)
892 `(("python-2" ,python-2)
893 ("python2-psycopg2" ,python2-psycopg2)))
894 (home-page "https://github.com/openstreetmap/osm2pgsql")
895 (synopsis "OSM data importer to postgresql")
896 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
897 PostgreSQL / PostGIS database suitable for applications like rendering into a
898 map, geocoding with Nominatim, or general analysis.")
899 (license license:gpl2+)))
901 (define-public tippecanoe
909 (url "https://github.com/mapbox/tippecanoe.git")
911 (file-name (git-file-name name version))
913 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
914 (build-system gnu-build-system)
917 (modify-phases %standard-phases (delete 'configure))
921 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
926 (home-page "https://github.com/mapbox/tippecanoe")
927 (synopsis "Vector tile server for maps")
928 (description "Tippecanoe creates scale-independent view of data, so that
929 the texture and density of features is visible at every zoom level, instead of
930 dropping features at lower levels.")
931 (license license:bsd-2)))
933 (define-public osmctools
941 (url "https://gitlab.com/osm-c-tools/osmctools")
943 (file-name (git-file-name name version))
946 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
947 (build-system gnu-build-system)
949 `(("autoconf" ,autoconf)
950 ("automake" ,automake)))
953 (home-page "https://gitlab.com/osm-c-tools/osmctools")
954 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
955 (description "This project contains a few tools which are used in the
956 OpenStreetMap project. They can be used to convert, filter and update
957 OpenStreetMap data files.")
958 (license license:agpl3)))
960 (define-public osm-gps-map
968 "https://github.com/nzjrs/osm-gps-map/releases/download/"
969 version "/osm-gps-map-" version ".tar.gz"))
972 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
973 (build-system gnu-build-system)
975 `(("gnome-common" ,gnome-common)
977 ("pkg-config" ,pkg-config)))
981 ("gobject-introspection" ,gobject-introspection)
983 ("libsoup" ,libsoup)))
984 (home-page "https://nzjrs.github.io/osm-gps-map/")
985 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
987 "This package provides a GTK+ widget (and Python bindings) that when
988 given GPS coordinates,draws a GPS track, and points of interest on a moving
989 map display. Downloads map data from a number of websites, including
990 @url{https://www.openstreetmap.org}.")
991 (license license:gpl2+)))
993 (define-public xygrib
1000 (url "https://github.com/opengribs/XyGrib.git")
1001 (commit (string-append "v" version))))
1002 (file-name (git-file-name name version))
1005 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1006 (modules '((guix build utils)))
1008 '(begin (delete-file-recursively "data/fonts") #t))))
1009 (build-system cmake-build-system)
1012 (modify-phases %standard-phases
1013 (add-after 'unpack 'patch-directories
1014 (lambda* (#:key inputs #:allow-other-keys)
1015 (let ((jpeg (assoc-ref inputs "openjpeg"))
1016 (font (assoc-ref inputs "font-liberation")))
1017 (substitute* "CMakeLists.txt"
1020 ;; Fix install locations.
1021 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1022 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1023 ;; Skip looking for the static library.
1024 (("\"libnova.a\"") ""))
1025 ;; Don't use the bundled font-liberation.
1026 (substitute* "src/util/Font.cpp"
1027 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1028 (string-append "\"" font "/share/fonts/truetype/\"")))
1029 (substitute* "src/util/Util.h"
1030 (("pathData\\(\\)\\+\"data/fonts/\"")
1031 (string-append "\"" font "/share/fonts/\""))))
1033 #:tests? #f)) ; no tests
1035 `(("qttools" ,qttools)))
1038 ("font-liberation" ,font-liberation)
1039 ("libnova" ,libnova)
1041 ("openjpeg" ,openjpeg)
1045 (synopsis "Weather Forecast Visualization")
1047 "XyGrib is a Grib file reader and visualizes meteorological data providing
1048 an off-line capability to analyse weather forecasts or hindcasts. It is
1049 intended to be used as a capable weather work station for anyone with a serious
1050 interest in examining weather. This would include members of the sailing
1051 community, private and sport aviators, farmers, weather buffs and many more.
1052 XyGrib is the continuation of the zyGrib software package with a new team of
1054 (home-page "https://opengribs.org")
1055 (license license:gpl3+)))
1057 (define-public libspatialindex
1059 (name "libspatialindex")
1064 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1065 "releases/download/" version "/spatialindex-src-"
1066 version ".tar.bz2"))
1069 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1070 (build-system cmake-build-system)
1071 (home-page "https://libspatialindex.org")
1072 (synopsis "Spatial indexing library")
1073 (description "The purpose of this library is to provide:
1076 @item An extensible framework that will support robust spatial indexing
1078 @item Support for sophisticated spatial queries. Range, point location,
1079 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1080 by spatial constraints) should be easy to deploy and run.
1081 @item Easy to use interfaces for inserting, deleting and updating information.
1082 @item Wide variety of customization capabilities. Basic index and storage
1083 characteristics like the page size, node capacity, minimum fan-out, splitting
1084 algorithm, etc. should be easy to customize.
1085 @item Index persistence. Internal memory and external memory structures
1086 should be supported. Clustered and non-clustered indices should be easy to be
1090 (license license:expat)))
1092 (define-public java-jmapviewer
1094 (name "java-jmapviewer")
1098 (uri (string-append "https://svn.openstreetmap.org/applications/"
1099 "viewer/jmapviewer/releases/" version
1100 "/JMapViewer-" version "-Source.zip"))
1103 "08hbqsbs859v4m5d90560fdifavd1apnpz9v9iry1v31dsvy5707"))))
1104 (build-system ant-build-system)
1106 `(("unzip" ,unzip)))
1108 `(#:build-target "pack"
1109 #:tests? #f; No tests
1111 (modify-phases %standard-phases
1112 (add-before 'build 'clean
1114 (invoke "ant" "clean")))
1116 (lambda* (#:key outputs #:allow-other-keys)
1117 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1119 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1120 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1121 (synopsis "OSM map integration in Java")
1122 (description "JMapViewer is a Java component which allows to easily
1123 integrate an OSM map view into your Java application. It is maintained as
1124 an independent project by the JOSM team.")
1125 (license license:gpl2)))
1134 (url "https://josm.openstreetmap.de/svn/trunk")
1135 (revision (string->number version))
1139 "091pbcn4fnmk42fmxplhis3nw5dbljf6ws8acyhx5dflyn49xzmx"))
1140 (file-name (string-append name "-" version "-checkout"))
1141 (modules '((guix build utils)))
1144 (for-each delete-file (find-files "." ".*.jar$"))
1146 (build-system ant-build-system)
1148 `(("javacc" ,javacc)))
1150 `(("java-commons-jcs" ,java-commons-jcs)
1151 ("java-commons-compress" ,java-commons-compress)
1152 ("java-jmapviewer" ,java-jmapviewer)
1153 ("java-jsonp-api" ,java-jsonp-api)
1154 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1155 ("java-metadata-extractor" ,java-metadata-extractor)
1156 ("java-openjfx-media" ,java-openjfx-media)
1157 ("java-signpost-core" ,java-signpost-core)
1158 ("java-svg-salamander" ,java-svg-salamander)))
1161 #:jar-name "josm.jar"
1163 (modify-phases %standard-phases
1164 (add-after 'unpack 'rm-build.xml
1166 (delete-file "build.xml")
1168 (add-before 'build 'fix-revision
1170 (with-output-to-file "REVISION.XML"
1173 (string-append "<info><entry><commit revision=\"" ,version "\">"
1174 "<date>1970-01-01 00:00:00 +0000</date>"
1175 "</commit></entry></info>"))))
1177 (add-before 'build 'fix-classpath
1178 (lambda* (#:key inputs #:allow-other-keys)
1183 (let ((source (assoc-ref inputs "source")))
1184 (not (equal? (substring s 0 (string-length source)) source))))
1185 (string-split (getenv "CLASSPATH") #\:))
1188 (add-before 'build 'generate-parser
1190 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1191 (out (string-append dir "/parsergen"))
1192 (file (string-append dir "/MapCSSParser.jj")))
1193 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
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=" out)
1200 (add-after 'build 'generate-epsg
1202 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1203 "-cp" "build/classes")
1204 (mkdir-p "data/projection")
1205 (with-output-to-file "data/projection/custom-epsg"
1206 (lambda _ (display "")))
1207 (invoke "java" "-cp" "build/classes:scripts:."
1208 "BuildProjectionDefinitions" ".")
1210 (add-after 'generate-epsg 'copy-data
1212 (mkdir-p "build/classes")
1213 (rename-file "data" "build/classes/data")
1215 (add-before 'install 'regenerate-jar
1217 ;; We need to regenerate the jar file to add data.
1218 (delete-file "build/jar/josm.jar")
1219 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1220 "build/classes" ".")
1222 (add-before 'build 'copy-styles
1224 (mkdir-p "build/classes")
1225 (rename-file "styles" "build/classes/styles")
1227 (add-before 'build 'copy-images
1229 (mkdir-p "build/classes")
1230 (rename-file "images" "build/classes/images")
1232 (add-before 'build 'copy-revision
1234 (mkdir-p "build/classes")
1235 (with-output-to-file "build/classes/REVISION"
1238 (string-append "Revision: " ,version "\n"
1239 "Is-Local-Build: true\n"
1240 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1242 (add-after 'install 'install-bin
1243 (lambda* (#:key outputs inputs #:allow-other-keys)
1244 (let* ((out (assoc-ref outputs "out"))
1245 (bin (string-append out "/bin")))
1247 (with-output-to-file (string-append bin "/josm")
1250 (string-append "#!/bin/sh\n"
1251 (assoc-ref inputs "jdk") "/bin/java"
1252 " -cp " out "/share/java/josm.jar:"
1253 (getenv "CLASSPATH")
1254 " org.openstreetmap.josm.gui.MainApplication"))))
1255 (chmod (string-append bin "/josm") #o755))
1257 (home-page "https://josm.openstreetmap.de")
1258 (synopsis "OSM editor")
1259 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1260 supports loading GPX tracks, background imagery and OSM data from local
1261 sources as well as from online sources and allows to edit the OSM data (nodes,
1262 ways, and relations) and their metadata tags.")
1263 (license license:gpl2+)))
1265 (define-public libmaxminddb
1267 (name "libmaxminddb")
1272 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1273 "/releases/download/" version "/"
1274 "/libmaxminddb-" version ".tar.gz"))
1276 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1277 (build-system gnu-build-system)
1280 (modify-phases %standard-phases
1281 (add-before 'configure 'set-cc-to-gcc
1283 (setenv "CC" "gcc"))))))
1286 (home-page "https://maxmind.github.io/libmaxminddb/")
1287 (synopsis "C library for the MaxMind DB file format")
1288 (description "The libmaxminddb library provides a C library for reading
1289 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1290 format is a custom, but open, binary format designed to facilitate fast
1291 lookups of IP addresses while allowing flexibility in the type of data
1292 associated with an address.")
1293 (license license:asl2.0)))
1295 (define-public python-maxminddb
1297 (name "python-maxminddb")
1302 (uri (pypi-uri "maxminddb" version))
1305 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1306 (build-system python-build-system)
1308 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1310 `(("libmaxminddb" ,libmaxminddb)))
1311 (home-page "https://www.maxmind.com/")
1312 (synopsis "Reader for the MaxMind DB format")
1313 (description "MaxMind DB is a binary file format that stores data indexed
1314 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1316 (license license:asl2.0)))
1318 (define-public python-geoip2
1320 (name "python-geoip2")
1325 (uri (pypi-uri "geoip2" version))
1328 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1329 (build-system python-build-system)
1331 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1333 `(("python-maxminddb" ,python-maxminddb)
1334 ("python-requests" ,python-requests)))
1335 (home-page "https://www.maxmind.com/")
1336 (synopsis "MaxMind GeoIP2 API")
1337 (description "Provides an API for the GeoIP2 web services and databases.
1338 The API also works with MaxMind’s free GeoLite2 databases.")
1339 (license license:asl2.0)))
1341 (define-public routino
1348 (uri (string-append "http://www.routino.org/download/routino-"
1352 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1353 (build-system gnu-build-system)
1361 `(#:test-target "test"
1363 (modify-phases %standard-phases
1365 (lambda* (#:key outputs #:allow-other-keys)
1366 (substitute* "Makefile.conf"
1367 (("prefix=/usr/local")
1368 (string-append "prefix=" (assoc-ref outputs "out")))
1369 (("LDFLAGS_LDSO=-Wl,-R\\.")
1370 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1371 (("#CFLAGS\\+=-DUSE_XZ")
1373 (("#LDFLAGS\\+=-llzma")
1376 (synopsis "Routing application for OpenStreetMap data")
1378 "Routino is an application for finding a route between two points
1379 using the dataset of topographical information collected by
1380 @url{https://www.OpenStreetMap.org}.")
1381 (home-page "https://www.routino.org/")
1382 (license license:agpl3+)))
1384 (define-public qmapshack
1392 (url "https://github.com/Maproom/qmapshack.git")
1393 (commit (string-append "V_" version))))
1394 (file-name (git-file-name name version))
1397 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1398 (build-system qt-build-system)
1400 `(("pkg-config" ,pkg-config)
1401 ("qttools" ,qttools)))
1404 ("libjpeg-turbo" ,libjpeg-turbo)
1407 ("qtdeclarative" ,qtdeclarative)
1408 ("qtlocation" ,qtlocation)
1409 ("qtwebchannel" ,qtwebchannel)
1410 ("qtwebengine" ,qtwebengine)
1412 ("routino" ,routino)
1413 ("sqlite" ,sqlite-with-column-metadata) ; See wrap phase
1418 (modify-phases %standard-phases
1419 (add-after 'unpack 'fix-cmake-modules
1420 (lambda* (#:key inputs #:allow-other-keys)
1421 (substitute* "CMakeLists.txt"
1422 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1423 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1424 (substitute* "cmake/Modules/FindROUTINO.cmake"
1426 (assoc-ref inputs "routino")))
1427 ;; The following fixes are included as patches in the sources
1428 ;; of QMapShack, but they are not applied by default, for
1430 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1431 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1433 (add-after 'install 'wrap
1434 ;; The program fails to run with the error:
1435 ;; undefined symbol: sqlite3_column_table_name16
1436 ;; Forcing the program to use sqlite-with-column-metadata instead
1437 ;; of sqlite using LD_LIBRARY_PATH solves the problem.
1439 ;; The program also fails to find the QtWebEngineProcess program,
1440 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1441 (lambda* (#:key inputs outputs #:allow-other-keys)
1442 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1443 (qtwebengineprocess (string-append
1444 (assoc-ref inputs "qtwebengine")
1445 "/lib/qt5/libexec/QtWebEngineProcess"))
1446 (sqlite-lib (string-append (assoc-ref inputs "sqlite")
1448 (for-each (lambda (program)
1449 (wrap-program program
1450 `("LD_LIBRARY_PATH" ":" prefix (,sqlite-lib))
1451 `("QTWEBENGINEPROCESS_PATH" =
1452 (,qtwebengineprocess))))
1453 (find-files bin ".*")))
1455 (synopsis "GPS mapping application")
1457 "QMapShack can be used to plan your next outdoor trip or to visualize and
1458 archive all the GPS recordings of your past trips. It is the successor of the
1459 QLandkarte GT application.")
1460 (home-page "https://github.com/Maproom/qmapshack/wiki")
1461 (license license:gpl3+)))