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 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
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 "https://proj.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 "https://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 ("libjpeg-turbo" ,libjpeg-turbo)
558 ("libspatialite" ,libspatialite)
562 ("wxwidgets" ,wxwidgets-2)
564 (synopsis "Graphical user interface for SpatiaLite")
565 (description "Spatialite-gui provides a visual interface for viewing and
566 maintaining a spatialite database. You can easily see the structure of the
567 tables and data contents using point and click functions, many of which
568 construct common SQL queries, or craft your own SQL queries.")
569 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
570 (license license:gpl3+)))
579 "http://download.osgeo.org/gdal/" version "/gdal-"
583 "10symyajj1b7j98f889lqxxbmhcyvlhq9gg0l42h69bv22wx45gw"))
584 (modules '((guix build utils)))
587 ;; TODO: frmts contains a lot more bundled code.
588 (for-each delete-file-recursively
593 "frmts/jpeg/libjpeg12"
594 "frmts/gtiff/libtiff"
595 "frmts/gtiff/libgeotiff"
597 "ogr/ogrsf_frmts/geojson/libjson"))))))
598 (build-system gnu-build-system)
602 (let-syntax ((with (syntax-rules ()
604 (string-append option "="
605 (assoc-ref %build-inputs input))))))
607 ;; TODO: --with-pcidsk, --with-pcraster
608 (with "--with-freexl" "freexl")
609 (with "--with-libjson-c" "json-c")
610 (with "--with-png" "libpng")
611 (with "--with-webp" "libwebp")
612 (with "--with-gif" "giflib")
613 (with "--with-jpeg" "libjpeg-turbo")
614 (with "--with-libtiff" "libtiff")
615 (with "--with-geotiff" "libgeotiff")
616 (with "--with-libz" "zlib")
617 (with "--with-expat" "expat")
618 (with "--with-sqlite3" "sqlite")
621 (modify-phases %standard-phases
622 (add-before 'build 'fix-path
624 (substitute* "frmts/mrf/mrf_band.cpp"
625 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
632 ("libgeotiff" ,libgeotiff)
633 ("libjpeg-turbo" ,libjpeg-turbo)
642 (home-page "https://gdal.org/")
643 (synopsis "Raster and vector geospatial data format library")
644 (description "GDAL is a translator library for raster and vector geospatial
645 data formats. As a library, it presents a single raster abstract data model
646 and single vector abstract data model to the calling application for all
647 supported formats. It also comes with a variety of useful command line
648 utilities for data translation and processing.")
652 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
653 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
656 ;; frmts/hdf4/hdf-eos/*
657 ;; similar to the expat license, but without guarantee exclusion
658 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
659 ;; frmts/grib/degrib/
660 license:public-domain ; with guarantee exclusion
662 ;; Some bsd-inspired license
663 (license:non-copyleft "file://port/LICENCE_minizip")
664 ;; alg/internal_libqhull
665 ;; Some 5-clause license
666 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
670 (define-public python-gdal
671 (package (inherit gdal)
673 (build-system python-build-system)
675 '(#:tests? #f ; no tests
677 (modify-phases %standard-phases
678 (add-before 'build 'chdir
680 (chdir "swig/python")
684 `(("python-numpy" ,python-numpy)))
687 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
689 (define-public postgis
695 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
699 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
700 (build-system gnu-build-system)
704 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
705 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
706 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
707 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
709 (modify-phases %standard-phases
710 (add-before 'build 'fix-install-path
711 (lambda* (#:key outputs #:allow-other-keys)
712 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
713 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
714 (string-append (assoc-ref outputs "out") "/bin"))))))))
719 ("libjpeg" ,libjpeg-turbo)
722 ("postgresql" ,postgresql)
726 ("pkg-config" ,pkg-config)))
727 (home-page "https://postgis.net")
728 (synopsis "Spatial database extender for PostgreSQL")
729 (description "PostGIS is a spatial database extender for PostgreSQL
730 object-relational database. It adds support for geographic objects allowing
731 location queries to be run in SQL. This package provides a PostgreSQL
736 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
739 license:public-domain
741 license:bsd-3 ; files only say "BSD"
743 license:cc-by-sa3.0))))
745 (define-public tegola
752 "https://github.com/go-spatial/tegola/archive/v"
754 (file-name (string-append name "-" version ".tar.gz"))
757 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
758 (build-system go-build-system)
760 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
761 #:unpack-path "github.com/go-spatial/tegola"
763 (modify-phases %standard-phases
764 (add-before 'build 'set-version
766 (with-directory-excursion "src/github.com/go-spatial/tegola"
767 (substitute* '("cmd/tegola/cmd/root.go"
768 "cmd/tegola_lambda/main.go")
769 (("version not set") ,version)))
771 (home-page "http://tegola.io")
772 (synopsis "Vector tile server for maps")
773 (description "Tegola is a free vector tile server written in Go. Tegola
774 takes geospatial data and slices it into vector tiles that can be efficiently
775 delivered to any client.")
778 ;; Some packages in vendor have other licenses
784 (define-public imposm3
787 (version "0.6.0-alpha.4")
791 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
793 (file-name (string-append name "-" version ".tar.gz"))
796 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
797 (build-system go-build-system)
799 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
800 #:unpack-path "github.com/omniscale/imposm3"
802 (modify-phases %standard-phases
803 (add-before 'build 'set-version
805 (substitute* "src/github.com/omniscale/imposm3/version.go"
806 (("0.0.0-dev") ,version))
810 ("leveldb" ,leveldb)))
811 (home-page "https://imposm.org/")
812 (synopsis "OpenStreetMap importer for PostGIS")
813 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
814 files and imports the data into PostgreSQL/PostGIS databases. It is designed
815 to create databases that are optimized for rendering/tile/map-services.")
818 ;; Some dependencies in vendor have different licenses
823 (define-public libosmium
831 (url "https://github.com/osmcode/libosmium.git")
832 (commit (string-append "v" version))))
833 (file-name (git-file-name name version))
835 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
836 (build-system cmake-build-system)
843 ("protozero" ,protozero)
844 ("sparsehash" ,sparsehash)
847 `(("doxygen" ,doxygen)))
848 (home-page "https://osmcode.org/libosmium/")
849 (synopsis "C++ library for working with OpenStreetMap data")
850 (description "Libosmium is a fast and flexible C++ library for working with
851 OpenStreetMap data.")
852 (license license:boost1.0)))
854 (define-public osm2pgsql
862 (url "https://github.com/openstreetmap/osm2pgsql.git")
864 (file-name (git-file-name name version))
866 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
867 (modules '((guix build utils)))
870 (delete-file-recursively "contrib/protozero")
871 (delete-file-recursively "contrib/libosmium")
873 (build-system cmake-build-system)
875 `(#:tests? #f; tests fail because we need to setup a database
877 (list (string-append "-DOSMIUM_INCLUDE_DIR="
878 (assoc-ref %build-inputs "libosmium")
880 (string-append "-DPROTOZERO_INCLUDE_DIR="
881 (assoc-ref %build-inputs "protozero")
886 ("libosmium" ,libosmium)
888 ("postgresql" ,postgresql)
890 ("protozero" ,protozero)
893 `(("python-2" ,python-2)
894 ("python2-psycopg2" ,python2-psycopg2)))
895 (home-page "https://github.com/openstreetmap/osm2pgsql")
896 (synopsis "OSM data importer to postgresql")
897 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
898 PostgreSQL / PostGIS database suitable for applications like rendering into a
899 map, geocoding with Nominatim, or general analysis.")
900 (license license:gpl2+)))
902 (define-public tippecanoe
910 (url "https://github.com/mapbox/tippecanoe.git")
912 (file-name (git-file-name name version))
914 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
915 (build-system gnu-build-system)
918 (modify-phases %standard-phases (delete 'configure))
922 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
927 (home-page "https://github.com/mapbox/tippecanoe")
928 (synopsis "Vector tile server for maps")
929 (description "Tippecanoe creates scale-independent view of data, so that
930 the texture and density of features is visible at every zoom level, instead of
931 dropping features at lower levels.")
932 (license license:bsd-2)))
934 (define-public osmctools
942 (url "https://gitlab.com/osm-c-tools/osmctools")
944 (file-name (git-file-name name version))
947 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
948 (build-system gnu-build-system)
950 `(("autoconf" ,autoconf)
951 ("automake" ,automake)))
954 (home-page "https://gitlab.com/osm-c-tools/osmctools")
955 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
956 (description "This project contains a few tools which are used in the
957 OpenStreetMap project. They can be used to convert, filter and update
958 OpenStreetMap data files.")
959 (license license:agpl3)))
961 (define-public osm-gps-map
969 "https://github.com/nzjrs/osm-gps-map/releases/download/"
970 version "/osm-gps-map-" version ".tar.gz"))
973 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
974 (build-system gnu-build-system)
976 `(("gnome-common" ,gnome-common)
978 ("pkg-config" ,pkg-config)))
982 ("gobject-introspection" ,gobject-introspection)
984 ("libsoup" ,libsoup)))
985 (home-page "https://nzjrs.github.io/osm-gps-map/")
986 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
988 "This package provides a GTK+ widget (and Python bindings) that when
989 given GPS coordinates,draws a GPS track, and points of interest on a moving
990 map display. Downloads map data from a number of websites, including
991 @url{https://www.openstreetmap.org}.")
992 (license license:gpl2+)))
994 (define-public xygrib
1001 (url "https://github.com/opengribs/XyGrib.git")
1002 (commit (string-append "v" version))))
1003 (file-name (git-file-name name version))
1006 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1007 (modules '((guix build utils)))
1009 '(begin (delete-file-recursively "data/fonts") #t))))
1010 (build-system cmake-build-system)
1013 (modify-phases %standard-phases
1014 (add-after 'unpack 'patch-directories
1015 (lambda* (#:key inputs #:allow-other-keys)
1016 (let ((jpeg (assoc-ref inputs "openjpeg"))
1017 (font (assoc-ref inputs "font-liberation")))
1018 (substitute* "CMakeLists.txt"
1021 ;; Fix install locations.
1022 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1023 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1024 ;; Skip looking for the static library.
1025 (("\"libnova.a\"") ""))
1026 ;; Don't use the bundled font-liberation.
1027 (substitute* "src/util/Font.cpp"
1028 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1029 (string-append "\"" font "/share/fonts/truetype/\"")))
1030 (substitute* "src/util/Util.h"
1031 (("pathData\\(\\)\\+\"data/fonts/\"")
1032 (string-append "\"" font "/share/fonts/\""))))
1034 #:tests? #f)) ; no tests
1036 `(("qttools" ,qttools)))
1039 ("font-liberation" ,font-liberation)
1040 ("libnova" ,libnova)
1042 ("openjpeg" ,openjpeg)
1046 (synopsis "Weather Forecast Visualization")
1048 "XyGrib is a Grib file reader and visualizes meteorological data providing
1049 an off-line capability to analyse weather forecasts or hindcasts. It is
1050 intended to be used as a capable weather work station for anyone with a serious
1051 interest in examining weather. This would include members of the sailing
1052 community, private and sport aviators, farmers, weather buffs and many more.
1053 XyGrib is the continuation of the zyGrib software package with a new team of
1055 (home-page "https://opengribs.org")
1056 (license license:gpl3+)))
1058 (define-public libspatialindex
1060 (name "libspatialindex")
1065 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1066 "releases/download/" version "/spatialindex-src-"
1067 version ".tar.bz2"))
1070 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1071 (build-system cmake-build-system)
1072 (home-page "https://libspatialindex.org")
1073 (synopsis "Spatial indexing library")
1074 (description "The purpose of this library is to provide:
1077 @item An extensible framework that will support robust spatial indexing
1079 @item Support for sophisticated spatial queries. Range, point location,
1080 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1081 by spatial constraints) should be easy to deploy and run.
1082 @item Easy to use interfaces for inserting, deleting and updating information.
1083 @item Wide variety of customization capabilities. Basic index and storage
1084 characteristics like the page size, node capacity, minimum fan-out, splitting
1085 algorithm, etc. should be easy to customize.
1086 @item Index persistence. Internal memory and external memory structures
1087 should be supported. Clustered and non-clustered indices should be easy to be
1091 (license license:expat)))
1093 (define-public java-jmapviewer
1095 (name "java-jmapviewer")
1099 (uri (string-append "https://svn.openstreetmap.org/applications/"
1100 "viewer/jmapviewer/releases/" version
1101 "/JMapViewer-" version "-Source.zip"))
1104 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
1105 (build-system ant-build-system)
1107 `(("unzip" ,unzip)))
1109 `(#:build-target "pack"
1110 #:tests? #f; No tests
1112 (modify-phases %standard-phases
1113 (add-before 'build 'clean
1115 (invoke "ant" "clean")))
1117 (lambda* (#:key outputs #:allow-other-keys)
1118 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1120 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1121 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1122 (synopsis "OSM map integration in Java")
1123 (description "JMapViewer is a Java component which allows to easily
1124 integrate an OSM map view into your Java application. It is maintained as
1125 an independent project by the JOSM team.")
1126 (license license:gpl2)))
1135 (url "https://josm.openstreetmap.de/svn/trunk")
1136 (revision (string->number version))
1140 "00b8sw0wgkcf7xknmdpn5s521ax8x2660figidcrry37sgq3x946"))
1141 (file-name (string-append name "-" version "-checkout"))
1142 (modules '((guix build utils)))
1145 (for-each delete-file (find-files "." ".*.jar$"))
1147 (build-system ant-build-system)
1149 `(("javacc" ,javacc)))
1151 `(("java-commons-jcs" ,java-commons-jcs)
1152 ("java-commons-compress" ,java-commons-compress)
1153 ("java-jmapviewer" ,java-jmapviewer)
1154 ("java-jsonp-api" ,java-jsonp-api)
1155 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1156 ("java-metadata-extractor" ,java-metadata-extractor)
1157 ("java-openjfx-media" ,java-openjfx-media)
1158 ("java-signpost-core" ,java-signpost-core)
1159 ("java-svg-salamander" ,java-svg-salamander)))
1162 #:jar-name "josm.jar"
1164 (modify-phases %standard-phases
1165 (add-after 'unpack 'rm-build.xml
1167 (delete-file "build.xml")
1169 (add-before 'build 'fix-revision
1171 (with-output-to-file "REVISION.XML"
1174 (string-append "<info><entry><commit revision=\"" ,version "\">"
1175 "<date>1970-01-01 00:00:00 +0000</date>"
1176 "</commit></entry></info>"))))
1178 (add-before 'build 'fix-classpath
1179 (lambda* (#:key inputs #:allow-other-keys)
1184 (let ((source (assoc-ref inputs "source")))
1185 (not (equal? (substring s 0 (string-length source)) source))))
1186 (string-split (getenv "CLASSPATH") #\:))
1189 (add-before 'build 'generate-parser
1191 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1192 (out (string-append dir "/parsergen"))
1193 (file (string-append dir "/MapCSSParser.jj")))
1194 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1195 (invoke "javacc" "-DEBUG_PARSER=false"
1196 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1197 "-GRAMMAR_ENCODING=UTF-8"
1198 (string-append "-OUTPUT_DIRECTORY=" out)
1201 (add-after 'build 'generate-epsg
1203 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1204 "-cp" "build/classes")
1205 (mkdir-p "data/projection")
1206 (with-output-to-file "data/projection/custom-epsg"
1207 (lambda _ (display "")))
1208 (invoke "java" "-cp" "build/classes:scripts:."
1209 "BuildProjectionDefinitions" ".")
1211 (add-after 'generate-epsg 'copy-data
1213 (mkdir-p "build/classes")
1214 (rename-file "data" "build/classes/data")
1216 (add-before 'install 'regenerate-jar
1218 ;; We need to regenerate the jar file to add data.
1219 (delete-file "build/jar/josm.jar")
1220 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1221 "build/classes" ".")
1223 (add-before 'build 'copy-styles
1225 (mkdir-p "build/classes")
1226 (rename-file "styles" "build/classes/styles")
1228 (add-before 'build 'copy-images
1230 (mkdir-p "build/classes")
1231 (rename-file "images" "build/classes/images")
1233 (add-before 'build 'copy-revision
1235 (mkdir-p "build/classes")
1236 (with-output-to-file "build/classes/REVISION"
1239 (string-append "Revision: " ,version "\n"
1240 "Is-Local-Build: true\n"
1241 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1243 (add-after 'install 'install-bin
1244 (lambda* (#:key outputs inputs #:allow-other-keys)
1245 (let* ((out (assoc-ref outputs "out"))
1246 (bin (string-append out "/bin")))
1248 (with-output-to-file (string-append bin "/josm")
1251 (string-append "#!/bin/sh\n"
1252 (assoc-ref inputs "jdk") "/bin/java"
1253 " -cp " out "/share/java/josm.jar:"
1254 (getenv "CLASSPATH")
1255 " org.openstreetmap.josm.gui.MainApplication"))))
1256 (chmod (string-append bin "/josm") #o755))
1258 (home-page "https://josm.openstreetmap.de")
1259 (synopsis "OSM editor")
1260 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1261 supports loading GPX tracks, background imagery and OSM data from local
1262 sources as well as from online sources and allows to edit the OSM data (nodes,
1263 ways, and relations) and their metadata tags.")
1264 (license license:gpl2+)))
1266 (define-public libmaxminddb
1268 (name "libmaxminddb")
1273 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1274 "/releases/download/" version "/"
1275 "/libmaxminddb-" version ".tar.gz"))
1277 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1278 (build-system gnu-build-system)
1281 (modify-phases %standard-phases
1282 (add-before 'configure 'set-cc-to-gcc
1284 (setenv "CC" "gcc"))))))
1287 (home-page "https://maxmind.github.io/libmaxminddb/")
1288 (synopsis "C library for the MaxMind DB file format")
1289 (description "The libmaxminddb library provides a C library for reading
1290 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1291 format is a custom, but open, binary format designed to facilitate fast
1292 lookups of IP addresses while allowing flexibility in the type of data
1293 associated with an address.")
1294 (license license:asl2.0)))
1296 (define-public python-maxminddb
1298 (name "python-maxminddb")
1303 (uri (pypi-uri "maxminddb" version))
1306 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1307 (build-system python-build-system)
1309 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1311 `(("libmaxminddb" ,libmaxminddb)))
1312 (home-page "https://www.maxmind.com/")
1313 (synopsis "Reader for the MaxMind DB format")
1314 (description "MaxMind DB is a binary file format that stores data indexed
1315 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1317 (license license:asl2.0)))
1319 (define-public python-geoip2
1321 (name "python-geoip2")
1326 (uri (pypi-uri "geoip2" version))
1329 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1330 (build-system python-build-system)
1332 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1334 `(("python-maxminddb" ,python-maxminddb)
1335 ("python-requests" ,python-requests)))
1336 (home-page "https://www.maxmind.com/")
1337 (synopsis "MaxMind GeoIP2 API")
1338 (description "Provides an API for the GeoIP2 web services and databases.
1339 The API also works with MaxMind’s free GeoLite2 databases.")
1340 (license license:asl2.0)))
1342 (define-public routino
1349 (uri (string-append "http://www.routino.org/download/routino-"
1353 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1354 (build-system gnu-build-system)
1362 `(#:test-target "test"
1364 (modify-phases %standard-phases
1366 (lambda* (#:key outputs #:allow-other-keys)
1367 (substitute* "Makefile.conf"
1368 (("prefix=/usr/local")
1369 (string-append "prefix=" (assoc-ref outputs "out")))
1370 (("LDFLAGS_LDSO=-Wl,-R\\.")
1371 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1372 (("#CFLAGS\\+=-DUSE_XZ")
1374 (("#LDFLAGS\\+=-llzma")
1377 (synopsis "Routing application for OpenStreetMap data")
1379 "Routino is an application for finding a route between two points
1380 using the dataset of topographical information collected by
1381 @url{https://www.OpenStreetMap.org}.")
1382 (home-page "https://www.routino.org/")
1383 (license license:agpl3+)))
1385 (define-public qmapshack
1393 (url "https://github.com/Maproom/qmapshack.git")
1394 (commit (string-append "V_" version))))
1395 (file-name (git-file-name name version))
1398 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1399 (build-system qt-build-system)
1401 `(("pkg-config" ,pkg-config)
1402 ("qttools" ,qttools)))
1405 ("libjpeg-turbo" ,libjpeg-turbo)
1408 ("qtdeclarative" ,qtdeclarative)
1409 ("qtlocation" ,qtlocation)
1410 ("qtwebchannel" ,qtwebchannel)
1411 ("qtwebengine" ,qtwebengine)
1413 ("routino" ,routino)
1414 ("sqlite" ,sqlite) ; See wrap phase
1419 (modify-phases %standard-phases
1420 (add-after 'unpack 'fix-cmake-modules
1421 (lambda* (#:key inputs #:allow-other-keys)
1422 (substitute* "CMakeLists.txt"
1423 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1424 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1425 (substitute* "cmake/Modules/FindROUTINO.cmake"
1427 (assoc-ref inputs "routino")))
1428 ;; The following fixes are included as patches in the sources
1429 ;; of QMapShack, but they are not applied by default, for
1431 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1432 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1434 (add-after 'install 'wrap
1435 ;; The program fails to find the QtWebEngineProcess program,
1436 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1437 (lambda* (#:key inputs outputs #:allow-other-keys)
1438 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1439 (qtwebengineprocess (string-append
1440 (assoc-ref inputs "qtwebengine")
1441 "/lib/qt5/libexec/QtWebEngineProcess")))
1442 (for-each (lambda (program)
1443 (wrap-program program
1444 `("QTWEBENGINEPROCESS_PATH" =
1445 (,qtwebengineprocess))))
1446 (find-files bin ".*")))
1448 (synopsis "GPS mapping application")
1450 "QMapShack can be used to plan your next outdoor trip or to visualize and
1451 archive all the GPS recordings of your past trips. It is the successor of the
1452 QLandkarte GT application.")
1453 (home-page "https://github.com/Maproom/qmapshack/wiki")
1454 (license license:gpl3+)))
1456 (define-public readosm
1463 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1464 "readosm-" version ".tar.gz"))
1466 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1467 (build-system gnu-build-system)
1471 (synopsis "Data extractor for OpenStreetMap files")
1473 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1474 input file (in @code{.osm} or @code{.osm.pbf} format).")
1475 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1476 (license (list license:gpl2+
1480 (define-public spatialite-tools
1482 (name "spatialite-tools")
1487 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1488 "spatialite-tools-" version ".tar.gz"))
1490 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1491 (build-system gnu-build-system)
1493 `(("pkg-config" ,pkg-config)))
1498 ("libspatialite" ,libspatialite)
1499 ("libxml2" ,libxml2)
1501 ("readosm" ,readosm)
1504 (synopsis "Collection of command line tools for SpatiaLite")
1506 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1507 tools supporting SpatiaLite.")
1508 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1509 (license license:gpl3+)))