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 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>
15 ;;; This file is part of GNU Guix.
17 ;;; GNU Guix is free software; you can redistribute it and/or modify it
18 ;;; under the terms of the GNU General Public License as published by
19 ;;; the Free Software Foundation; either version 3 of the License, or (at
20 ;;; your option) any later version.
22 ;;; GNU Guix is distributed in the hope that it will be useful, but
23 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
24 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 ;;; GNU General Public License for more details.
27 ;;; You should have received a copy of the GNU General Public License
28 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
30 (define-module (gnu packages geo)
31 #:use-module (guix build-system ant)
32 #:use-module (guix build-system cmake)
33 #:use-module (guix build-system glib-or-gtk)
34 #:use-module (guix build-system gnu)
35 #:use-module (guix build-system go)
36 #:use-module (guix build-system meson)
37 #:use-module (guix build-system python)
38 #:use-module (guix build-system scons)
39 #:use-module (guix build-system r)
40 #:use-module (guix download)
41 #:use-module (guix git-download)
42 #:use-module (guix svn-download)
43 #:use-module ((guix licenses) #:prefix license:)
44 #:use-module (guix packages)
45 #:use-module (guix utils)
46 #:use-module (gnu packages astronomy)
47 #:use-module (gnu packages autotools)
48 #:use-module (gnu packages boost)
49 #:use-module (gnu packages check)
50 #:use-module (gnu packages compression)
51 #:use-module (gnu packages databases)
52 #:use-module (gnu packages datastructures)
53 #:use-module (gnu packages documentation)
54 #:use-module (gnu packages fonts)
55 #:use-module (gnu packages fontutils)
56 #:use-module (gnu packages glib)
57 #:use-module (gnu packages gnome)
58 #:use-module (gnu packages gtk)
59 #:use-module (gnu packages image)
60 #:use-module (gnu packages icu4c)
61 #:use-module (gnu packages java)
62 #:use-module (gnu packages lua)
63 #:use-module (gnu packages pcre)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages protobuf)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages python-web)
69 #:use-module (gnu packages python-xyz)
70 #:use-module (gnu packages qt)
71 #:use-module (gnu packages sqlite)
72 #:use-module (gnu packages web)
73 #:use-module (gnu packages webkit)
74 #:use-module (gnu packages wxwidgets)
75 #:use-module (gnu packages xml))
83 (uri (string-append "http://download.osgeo.org/geos/geos-"
88 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
89 (build-system gnu-build-system)
91 (modify-phases %standard-phases
93 'unpack 'patch-test-shebangs
95 (substitute* '("tests/xmltester/testrunner.sh"
96 "tests/geostest/testrunner.sh")
97 (("/bin/sh") (which "sh")))
101 (home-page "https://geos.osgeo.org/")
102 (synopsis "Geometry Engine for Geographic Information Systems")
104 "GEOS provides a spatial object model and fundamental geometric
105 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
106 it aims to contain the complete functionality of JTS in C++. This
107 includes all the OpenGIS Simple Features for SQL spatial predicate
108 functions and spatial operators, as well as specific JTS enhanced
109 topology functions.")
110 (license (list license:lgpl2.1+ ; Main distribution.
111 license:zlib ; tests/xmltester/tinyxml/*
112 license:public-domain)))) ; include/geos/timeval.h
114 (define-public gnome-maps
120 (uri (string-append "mirror://gnome/sources/" name "/"
121 (version-major+minor version) "/"
122 name "-" version ".tar.xz"))
125 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
126 (build-system meson-build-system)
130 (modify-phases %standard-phases
131 (add-after 'unpack 'skip-gtk-update-icon-cache
132 ;; Don't create 'icon-theme.cache'.
134 (substitute* "meson_post_install.py"
135 (("gtk-update-icon-cache") "true"))
137 (add-after 'install 'wrap
138 (lambda* (#:key inputs outputs #:allow-other-keys)
139 (let ((out (assoc-ref outputs "out"))
140 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
141 (geocode-glib-path (string-append
142 (assoc-ref inputs "geocode-glib")
144 (goa-path (string-append
145 (assoc-ref inputs "gnome-online-accounts:lib")
147 (gdk-pixbuf-path (string-append
148 (assoc-ref inputs "gdk-pixbuf")
150 (webkitgtk-path (string-append
151 (assoc-ref inputs "webkitgtk")
153 (wrap-program (string-append out "/bin/gnome-maps")
154 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
156 ;; There seems to be no way to embed the path of
157 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
158 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
159 ;; libgeocode-glib.so.0
160 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
163 ,geocode-glib-path)))
166 `(("gobject-introspection" ,gobject-introspection)
167 ("intltool" ,intltool)
168 ("pkg-config" ,pkg-config)))
171 ("libchamplain" ,libchamplain)
173 ("libsecret" ,libsecret)
175 ("libgweather" ,libgweather)
177 ("gdk-pixbuf" ,gdk-pixbuf+svg)
178 ("glib-networking" ,glib-networking)
180 ("geocode-glib" ,geocode-glib)
181 ("gfbgraph" ,gfbgraph)
184 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
185 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
187 ("webkitgtk" ,webkitgtk)))
190 (synopsis "Graphical map viewer and wayfinding program")
191 (description "GNOME Maps is a graphical map viewer. It uses map data from
192 the OpenStreetMap project. It can provide directions for walking, bicycling,
194 (home-page "https://wiki.gnome.org/Apps/Maps")
195 (license license:gpl2+)))
197 (define-public libgaiagraphics
199 (name "libgaiagraphics")
204 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
208 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
209 (build-system gnu-build-system)
211 `(("pkg-config" ,pkg-config)))
215 ("libjpeg-turbo" ,libjpeg-turbo)
217 ("libgeotiff" ,libgeotiff)
221 (synopsis "Gaia common graphics support")
222 (description "libgaiagraphics is a library supporting
223 common-utility raster handling methods.")
224 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
225 (license license:lgpl3+)))
227 (define-public libgeotiff
234 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
237 (base32 "0rbjqixi4c8yz19larlzq6jda0px2gpmpp9c52cyhplbjsdhsldq"))
238 (modules '((guix build utils)))
241 ;; Remove .csv files, distributed from EPSG under a restricted
242 ;; license. See LICENSE for full license text.
243 (for-each delete-file (find-files "." "\\.csv$"))
244 ;; Now that we have removed the csv files, we need to modify the Makefile.
245 (substitute* "Makefile.in"
247 "all-am: Makefile $(LTLIBRARIES) $(HEADERS) geo_config.h\n")
248 (("^install-data-am: .*$")
249 "install-data-am: install-includeHEADERS"))
251 (build-system gnu-build-system)
253 `(("libjpeg-turbo" ,libjpeg-turbo)
259 (list (string-append "--with-zlib")
260 (string-append "--with-jpeg")
261 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
262 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
263 (description "libgeotiff is a library on top of libtiff for reading and
264 writing GeoTIFF information tags.")
265 (home-page "https://trac.osgeo.org/geotiff/")
266 ;; This is a mixture of various contributions under different licenses.
267 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
268 ;; states, as its commercial redistribution is restricted. Hence, we have
269 ;; removed it from the package.
270 (license (list license:public-domain
273 (license:non-copyleft "file://LICENSE"
274 "See LICENSE in the distribution.")))))
276 (define-public libspatialite
278 (name "libspatialite")
283 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
287 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
288 (build-system gnu-build-system)
290 `(("pkg-config" ,pkg-config)))
300 (modify-phases %standard-phases
301 ;; 3 tests are failing, ignore them:
302 (add-after 'unpack 'ignore-broken-tests
304 (substitute* '("test/Makefile.in")
305 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
306 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
307 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
309 (synopsis "Extend SQLite to support Spatial SQL capabilities")
311 "SpatiaLite is a library intended to extend the SQLite core to support
312 fully fledged Spatial SQL capabilities.")
313 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
314 ;; For the genuine libspatialite-sources holds:
315 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
316 ;; Files under src/control_points are from GRASS
317 ;; and are licensed under GPL2+ only.
318 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
319 (license (list license:gpl2+
322 license:public-domain))))
324 (define-public proj.4
330 (uri (string-append "http://download.osgeo.org/proj/proj-"
334 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
335 (build-system gnu-build-system)
338 (modify-phases %standard-phases
339 (add-after 'unpack 'patch-test-paths
341 (substitute* '("nad/test27"
347 (("/bin/rm") (which "rm")))
349 ;; Precision problems on i686 and other platforms. See:
350 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
351 ;; Disable failing test.
352 (add-after 'patch-test-paths 'ignore-failing-tests
354 (substitute* '("nad/Makefile.in")
355 (("\tPROJ_LIB.*" all) (string-append "#" all)))
359 (home-page "http://proj4.org/")
360 (synopsis "Cartographic Projections Library")
362 "Proj.4 is a library for converting coordinates between cartographic
364 (license (list license:expat
365 ;; src/PJ_patterson.c
369 ;; Embedded EPSG database.
370 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
374 (define-public mapnik
381 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
382 version "/mapnik-v" version ".tar.bz2"))
385 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
386 (build-system scons-build-system)
390 ("freetype" ,freetype)
391 ("harfbuzz" ,harfbuzz)
393 ("libjpeg-turbo" ,libjpeg-turbo)
402 `(("pkg-config" ,pkg-config)))
404 `(#:scons ,scons-python2
407 (string-append "PREFIX=" %output)
408 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
409 (home-page "http://mapnik.org/")
410 (synopsis "Toolkit for developing mapping applications")
411 (description "Mapnik is a toolkit for developing mapping applications. It
412 is basically a collection of geographic objects like maps, layers,
413 datasources, features, and geometries. At its core is a C++ shared library
414 providing algorithms and patterns for spatial data access and visualization.
415 The library does not rely on any specific windowing system and can be deployed
416 to any server environment. It is intended to play fair in a multi-threaded
417 environment and is aimed primarily, but not exclusively, at web-based
419 (license (list license:lgpl2.1+
420 ;; demo/viewer, demo/python/rundemo.py
422 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
424 ;; deps/mapnik/sparsehash
427 (license:non-copyleft "file://deps/agg/copying")))))
429 (define-public python2-mapnik
431 (name "python2-mapnik")
436 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
438 (file-name (string-append name "-" version ".tar.gz"))
441 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
442 (build-system python-build-system)
445 ("harfbuzz" ,harfbuzz)
447 ("libjpeg-turbo" ,libjpeg-turbo)
453 ("python2-pycairo" ,python2-pycairo)))
455 (let ((test-data-input
456 (lambda (repository version hash)
459 (uri (string-append "https://github.com/mapnik/" repository
460 "/archive/v" version ".tar.gz"))
461 (file-name (string-append "python-mapnik-" repository
462 "-" version ".tar.gz"))
463 (sha256 (base32 hash))))))
464 `(("python2-nose" ,python2-nose)
465 ;; Test data is released as separate tarballs
467 ,(test-data-input "test-data" "3.0.18"
468 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
470 ,(test-data-input "test-data-visual" "3.0.18"
471 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
473 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
475 (modify-phases %standard-phases
476 ;; Unpack test data into the source tree
477 (add-after 'unpack 'unpack-submodules
478 (lambda* (#:key inputs #:allow-other-keys)
479 (let ((unpack (lambda (source target)
480 (with-directory-excursion target
481 (invoke "tar" "xvf" (assoc-ref inputs source)
482 "--strip-components=1")))))
483 (unpack "test-data" "test/data")
484 (unpack "test-data-visual" "test/data-visual"))))
485 ;; Skip failing tests
486 (add-after 'unpack 'skip-tests
488 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
489 "test_unicode_regex_replace"
490 "test_proj_antimeridian_bbox"
491 "test_render_with_scale_factor")))
492 (substitute* "setup.cfg"
493 (("\\[nosetests\\]" all)
494 (string-append all "\nexclude=^("
495 (string-join skipped-tests "|") ")$")))))))))
496 (home-page "https://github.com/mapnik/python-mapnik")
497 (synopsis "Python bindings for Mapnik")
498 (description "This package provides Python bindings for Mapnik.")
499 (license license:lgpl2.1+)))
501 (define-public spatialite-gui
503 (name "spatialite-gui")
508 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
512 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
513 (build-system gnu-build-system)
515 `(("pkg-config" ,pkg-config)))
519 ("libgaiagraphics" ,libgaiagraphics)
520 ("libspatialite" ,libspatialite)
524 ("wxwidgets" ,wxwidgets-2)
526 (synopsis "Graphical user interface for SpatiaLite")
527 (description "Spatialite-gui provides a visual interface for viewing and
528 maintaining a spatialite database. You can easily see the structure of the
529 tables and data contents using point and click functions, many of which
530 construct common SQL queries, or craft your own SQL queries.")
531 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
532 (license license:gpl3+)))
541 "http://download.osgeo.org/gdal/" version "/gdal-"
545 "1951f7b69x3d1vic0rmq92q8f4bj3hbxnxmj5jl0cc3zg0isgmdr"))
546 (modules '((guix build utils)))
549 ;; TODO: frmts contains a lot more bundled code.
550 (for-each delete-file-recursively
555 "frmts/jpeg/libjpeg12"
556 "frmts/gtiff/libtiff"
557 "frmts/gtiff/libgeotiff"
559 "ogr/ogrsf_frmts/geojson/libjson"))))))
560 (build-system gnu-build-system)
564 (let-syntax ((with (syntax-rules ()
566 (string-append option "="
567 (assoc-ref %build-inputs input))))))
569 ;; TODO: --with-pcidsk, --with-pcraster
570 (with "--with-freexl" "freexl")
571 (with "--with-libjson-c" "json-c")
572 (with "--with-png" "libpng")
573 (with "--with-webp" "libwebp")
574 (with "--with-gif" "giflib")
575 (with "--with-jpeg" "libjpeg-turbo")
576 (with "--with-libtiff" "libtiff")
577 (with "--with-geotiff" "libgeotiff")
578 (with "--with-libz" "zlib")
581 (modify-phases %standard-phases
582 (add-before 'build 'fix-path
584 (substitute* "frmts/mrf/mrf_band.cpp"
585 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
591 ("libgeotiff" ,libgeotiff)
592 ("libjpeg-turbo" ,libjpeg-turbo)
598 (home-page "http://www.gdal.org/")
599 (synopsis "Raster and vector geospatial data format library")
600 (description "GDAL is a translator library for raster and vector geospatial
601 data formats. As a library, it presents a single raster abstract data model
602 and single vector abstract data model to the calling application for all
603 supported formats. It also comes with a variety of useful command line
604 utilities for data translation and processing.")
608 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
609 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
612 ;; frmts/hdf4/hdf-eos/*
613 ;; similar to the expat license, but without guarantee exclusion
614 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
615 ;; frmts/grib/degrib/
616 license:public-domain ; with guarantee exclusion
618 ;; Some bsd-inspired license
619 (license:non-copyleft "file://port/LICENCE_minizip")
620 ;; alg/internal_libqhull
621 ;; Some 5-clause license
622 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
626 (define-public python-gdal
627 (package (inherit gdal)
629 (build-system python-build-system)
631 '(#:tests? #f ; no tests
633 (modify-phases %standard-phases
634 (add-before 'build 'chdir
636 (chdir "swig/python")
640 `(("python-numpy" ,python-numpy)))
643 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
645 (define-public postgis
651 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
655 "0nanza15xzfhbpbq49p1xqz96dgbsam5332y9zj6snmz2mq685ll"))))
656 (build-system gnu-build-system)
660 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
661 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
662 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
663 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
665 (modify-phases %standard-phases
666 (add-before 'build 'fix-install-path
667 (lambda* (#:key outputs #:allow-other-keys)
668 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
669 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
670 (string-append (assoc-ref outputs "out") "/bin"))))))))
676 ("postgresql" ,postgresql)
680 ("pkg-config" ,pkg-config)))
681 (home-page "https://postgis.net")
682 (synopsis "Spatial database extender for PostgreSQL")
683 (description "PostGIS is a spatial database extender for PostgreSQL
684 object-relational database. It adds support for geographic objects allowing
685 location queries to be run in SQL. This package provides a PostgreSQL
690 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
693 license:public-domain
695 license:bsd-3 ; files only say "BSD"
697 license:cc-by-sa3.0))))
699 (define-public tegola
706 "https://github.com/go-spatial/tegola/archive/v"
708 (file-name (string-append name "-" version ".tar.gz"))
711 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
712 (build-system go-build-system)
714 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
715 #:unpack-path "github.com/go-spatial/tegola"
717 (modify-phases %standard-phases
718 (add-before 'build 'set-version
720 (with-directory-excursion "src/github.com/go-spatial/tegola"
721 (substitute* '("cmd/tegola/cmd/root.go"
722 "cmd/tegola_lambda/main.go")
723 (("version not set") ,version)))
725 (home-page "http://tegola.io")
726 (synopsis "Vector tile server for maps")
727 (description "Tegola is a free vector tile server written in Go. Tegola
728 takes geospatial data and slices it into vector tiles that can be efficiently
729 delivered to any client.")
732 ;; Some packages in vendor have other licenses
738 (define-public imposm3
741 (version "0.6.0-alpha.4")
745 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
747 (file-name (string-append name "-" version ".tar.gz"))
750 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
751 (build-system go-build-system)
753 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
754 #:unpack-path "github.com/omniscale/imposm3"
756 (modify-phases %standard-phases
757 (add-before 'build 'set-version
759 (substitute* "src/github.com/omniscale/imposm3/version.go"
760 (("0.0.0-dev") ,version))
764 ("leveldb" ,leveldb)))
765 (home-page "https://imposm.org/")
766 (synopsis "OpenStreetMap importer for PostGIS")
767 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
768 files and imports the data into PostgreSQL/PostGIS databases. It is designed
769 to create databases that are optimized for rendering/tile/map-services.")
772 ;; Some dependencies in vendor have different licenses
777 (define-public libosmium
785 (url "https://github.com/osmcode/libosmium.git")
786 (commit (string-append "v" version))))
787 (file-name (git-file-name name version))
789 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
790 (build-system cmake-build-system)
797 ("protozero" ,protozero)
798 ("sparsehash" ,sparsehash)
801 `(("doxygen" ,doxygen)))
802 (home-page "https://osmcode.org/libosmium/")
803 (synopsis "C++ library for working with OpenStreetMap data")
804 (description "Libosmium is a fast and flexible C++ library for working with
805 OpenStreetMap data.")
806 (license license:boost1.0)))
808 (define-public osm2pgsql
816 (url "https://github.com/openstreetmap/osm2pgsql.git")
818 (file-name (git-file-name name version))
820 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
821 (modules '((guix build utils)))
824 (delete-file-recursively "contrib/protozero")
825 (delete-file-recursively "contrib/libosmium")
827 (build-system cmake-build-system)
829 `(#:tests? #f; tests fail because we need to setup a database
831 (list (string-append "-DOSMIUM_INCLUDE_DIR="
832 (assoc-ref %build-inputs "libosmium")
834 (string-append "-DPROTOZERO_INCLUDE_DIR="
835 (assoc-ref %build-inputs "protozero")
840 ("libosmium" ,libosmium)
842 ("postgresql" ,postgresql)
844 ("protozero" ,protozero)
847 `(("python-2" ,python-2)
848 ("python2-psycopg2" ,python2-psycopg2)))
849 (home-page "https://github.com/openstreetmap/osm2pgsql")
850 (synopsis "OSM data importer to postgresql")
851 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
852 PostgreSQL / PostGIS database suitable for applications like rendering into a
853 map, geocoding with Nominatim, or general analysis.")
854 (license license:gpl2+)))
856 (define-public tippecanoe
864 (url "https://github.com/mapbox/tippecanoe.git")
866 (file-name (git-file-name name version))
868 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
869 (build-system gnu-build-system)
872 (modify-phases %standard-phases (delete 'configure))
876 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
881 (home-page "https://github.com/mapbox/tippecanoe")
882 (synopsis "Vector tile server for maps")
883 (description "Tippecanoe creates scale-independent view of data, so that
884 the texture and density of features is visible at every zoom level, instead of
885 dropping features at lower levels.")
886 (license license:bsd-2)))
888 (define-public osmctools
896 (url "https://gitlab.com/osm-c-tools/osmctools")
898 (file-name (git-file-name name version))
901 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
902 (build-system gnu-build-system)
904 `(("autoconf" ,autoconf)
905 ("automake" ,automake)))
908 (home-page "https://gitlab.com/osm-c-tools/osmctools")
909 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
910 (description "This project contains a few tools which are used in the
911 OpenStreetMap project. They can be used to convert, filter and update
912 OpenStreetMap data files.")
913 (license license:agpl3)))
915 (define-public osm-gps-map
923 "https://github.com/nzjrs/osm-gps-map/releases/download/"
924 version "/osm-gps-map-" version ".tar.gz"))
927 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
928 (build-system gnu-build-system)
930 `(("gnome-common" ,gnome-common)
932 ("pkg-config" ,pkg-config)))
936 ("gobject-introspection" ,gobject-introspection)
938 ("libsoup" ,libsoup)))
939 (home-page "https://nzjrs.github.io/osm-gps-map/")
940 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
942 "This package provides a GTK+ widget (and Python bindings) that when
943 given GPS coordinates,draws a GPS track, and points of interest on a moving
944 map display. Downloads map data from a number of websites, including
945 @url{https://www.openstreetmap.org}.")
946 (license license:gpl2+)))
948 (define-public xygrib
955 (url "https://github.com/opengribs/XyGrib.git")
956 (commit (string-append "v" version))))
957 (file-name (git-file-name name version))
960 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
961 (modules '((guix build utils)))
963 '(begin (delete-file-recursively "data/fonts") #t))))
964 (build-system cmake-build-system)
967 (modify-phases %standard-phases
968 (add-after 'unpack 'patch-directories
969 (lambda* (#:key inputs #:allow-other-keys)
970 (let ((jpeg (assoc-ref inputs "openjpeg"))
971 (font (assoc-ref inputs "font-liberation")))
972 (substitute* "CMakeLists.txt"
975 ;; Fix install locations.
976 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
977 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
978 ;; Skip looking for the static library.
979 (("\"libnova.a\"") ""))
980 ;; Don't use the bundled font-liberation.
981 (substitute* "src/util/Font.cpp"
982 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
983 (string-append "\"" font "/share/fonts/truetype/\"")))
984 (substitute* "src/util/Util.h"
985 (("pathData\\(\\)\\+\"data/fonts/\"")
986 (string-append "\"" font "/share/fonts/\""))))
988 #:tests? #f)) ; no tests
990 `(("qttools" ,qttools)))
993 ("font-liberation" ,font-liberation)
996 ("openjpeg" ,openjpeg)
1000 (synopsis "Weather Forecast Visualization")
1002 "XyGrib is a Grib file reader and visualizes meteorological data providing
1003 an off-line capability to analyse weather forecasts or hindcasts. It is
1004 intended to be used as a capable weather work station for anyone with a serious
1005 interest in examining weather. This would include members of the sailing
1006 community, private and sport aviators, farmers, weather buffs and many more.
1007 XyGrib is the continuation of the zyGrib software package with a new team of
1009 (home-page "https://opengribs.org")
1010 (license license:gpl3+)))
1012 (define-public libspatialindex
1014 (name "libspatialindex")
1019 (uri (string-append "https://download.osgeo.org/libspatialindex/"
1020 "spatialindex-src-" version ".tar.gz"))
1023 "1vxzm7kczwnb6qdmc0hb00z8ykx11zk3sb68gc7rch4vrfi4dakw"))))
1024 (build-system gnu-build-system)
1025 (home-page "https://libspatialindex.org")
1026 (synopsis "Spatial indexing library")
1027 (description "The purpose of this library is to provide:
1030 @item An extensible framework that will support robust spatial indexing
1032 @item Support for sophisticated spatial queries. Range, point location,
1033 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1034 by spatial constraints) should be easy to deploy and run.
1035 @item Easy to use interfaces for inserting, deleting and updating information.
1036 @item Wide variety of customization capabilities. Basic index and storage
1037 characteristics like the page size, node capacity, minimum fan-out, splitting
1038 algorithm, etc. should be easy to customize.
1039 @item Index persistence. Internal memory and external memory structures
1040 should be supported. Clustered and non-clustered indices should be easy to be
1044 (license license:expat)))
1046 (define-public java-jmapviewer
1048 (name "java-jmapviewer")
1052 (uri (string-append "https://svn.openstreetmap.org/applications/"
1053 "viewer/jmapviewer/releases/" version
1054 "/JMapViewer-" version "-Source.zip"))
1057 "08hbqsbs859v4m5d90560fdifavd1apnpz9v9iry1v31dsvy5707"))))
1058 (build-system ant-build-system)
1060 `(("unzip" ,unzip)))
1062 `(#:build-target "pack"
1063 #:tests? #f; No tests
1065 (modify-phases %standard-phases
1066 (add-before 'build 'clean
1068 (invoke "ant" "clean")))
1070 (lambda* (#:key outputs #:allow-other-keys)
1071 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1073 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1074 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1075 (synopsis "OSM map integration in Java")
1076 (description "JMapViewer is a Java component which allows to easily
1077 integrate an OSM map view into your Java application. It is maintained as
1078 an independent project by the JOSM team.")
1079 (license license:gpl2)))
1088 (url "https://josm.openstreetmap.de/svn/trunk")
1089 (revision (string->number version))
1093 "091pbcn4fnmk42fmxplhis3nw5dbljf6ws8acyhx5dflyn49xzmx"))
1094 (file-name (string-append name "-" version "-checkout"))
1095 (modules '((guix build utils)))
1098 (for-each delete-file (find-files "." ".*.jar$"))
1100 (build-system ant-build-system)
1102 `(("javacc" ,javacc)))
1104 `(("java-commons-jcs" ,java-commons-jcs)
1105 ("java-commons-compress" ,java-commons-compress)
1106 ("java-jmapviewer" ,java-jmapviewer)
1107 ("java-jsonp-api" ,java-jsonp-api)
1108 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1109 ("java-metadata-extractor" ,java-metadata-extractor)
1110 ("java-openjfx-media" ,java-openjfx-media)
1111 ("java-signpost-core" ,java-signpost-core)
1112 ("java-svg-salamander" ,java-svg-salamander)))
1115 #:jar-name "josm.jar"
1117 (modify-phases %standard-phases
1118 (add-after 'unpack 'rm-build.xml
1120 (delete-file "build.xml")
1122 (add-before 'build 'fix-revision
1124 (with-output-to-file "REVISION.XML"
1127 (string-append "<info><entry><commit revision=\"" ,version "\">"
1128 "<date>1970-01-01 00:00:00 +0000</date>"
1129 "</commit></entry></info>"))))
1131 (add-before 'build 'fix-classpath
1132 (lambda* (#:key inputs #:allow-other-keys)
1137 (let ((source (assoc-ref inputs "source")))
1138 (not (equal? (substring s 0 (string-length source)) source))))
1139 (string-split (getenv "CLASSPATH") #\:))
1142 (add-before 'build 'generate-parser
1144 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1145 (out (string-append dir "/parsergen"))
1146 (file (string-append dir "/MapCSSParser.jj")))
1147 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1148 (invoke "javacc" "-DEBUG_PARSER=false"
1149 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1150 "-GRAMMAR_ENCODING=UTF-8"
1151 (string-append "-OUTPUT_DIRECTORY=" out)
1154 (add-after 'build 'generate-epsg
1156 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1157 "-cp" "build/classes")
1158 (mkdir-p "data/projection")
1159 (with-output-to-file "data/projection/custom-epsg"
1160 (lambda _ (display "")))
1161 (invoke "java" "-cp" "build/classes:scripts:."
1162 "BuildProjectionDefinitions" ".")
1164 (add-after 'generate-epsg 'copy-data
1166 (mkdir-p "build/classes")
1167 (rename-file "data" "build/classes/data")
1169 (add-before 'install 'regenerate-jar
1171 ;; We need to regenerate the jar file to add data.
1172 (delete-file "build/jar/josm.jar")
1173 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1174 "build/classes" ".")
1176 (add-before 'build 'copy-styles
1178 (mkdir-p "build/classes")
1179 (rename-file "styles" "build/classes/styles")
1181 (add-before 'build 'copy-images
1183 (mkdir-p "build/classes")
1184 (rename-file "images" "build/classes/images")
1186 (add-before 'build 'copy-revision
1188 (mkdir-p "build/classes")
1189 (with-output-to-file "build/classes/REVISION"
1192 (string-append "Revision: " ,version "\n"
1193 "Is-Local-Build: true\n"
1194 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1196 (add-after 'install 'install-bin
1197 (lambda* (#:key outputs inputs #:allow-other-keys)
1198 (let* ((out (assoc-ref outputs "out"))
1199 (bin (string-append out "/bin")))
1201 (with-output-to-file (string-append bin "/josm")
1204 (string-append "#!/bin/sh\n"
1205 (assoc-ref inputs "jdk") "/bin/java"
1206 " -cp " out "/share/java/josm.jar:"
1207 (getenv "CLASSPATH")
1208 " org.openstreetmap.josm.gui.MainApplication"))))
1209 (chmod (string-append bin "/josm") #o755))
1211 (home-page "https://josm.openstreetmap.de")
1212 (synopsis "OSM editor")
1213 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1214 supports loading GPX tracks, background imagery and OSM data from local
1215 sources as well as from online sources and allows to edit the OSM data (nodes,
1216 ways, and relations) and their metadata tags.")
1217 (license license:gpl2+)))
1219 (define-public libmaxminddb
1221 (name "libmaxminddb")
1226 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1227 "/releases/download/" version "/"
1228 "/libmaxminddb-" version ".tar.gz"))
1230 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1231 (build-system gnu-build-system)
1234 (modify-phases %standard-phases
1235 (add-before 'configure 'set-cc-to-gcc
1237 (setenv "CC" "gcc"))))))
1240 (home-page "https://maxmind.github.io/libmaxminddb/")
1241 (synopsis "C library for the MaxMind DB file format")
1242 (description "The libmaxminddb library provides a C library for reading
1243 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1244 format is a custom, but open, binary format designed to facilitate fast
1245 lookups of IP addresses while allowing flexibility in the type of data
1246 associated with an address.")
1247 (license license:asl2.0)))
1249 (define-public python-maxminddb
1251 (name "python-maxminddb")
1256 (uri (pypi-uri "maxminddb" version))
1259 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1260 (build-system python-build-system)
1262 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1264 `(("libmaxminddb" ,libmaxminddb)))
1265 (home-page "http://www.maxmind.com/")
1266 (synopsis "Reader for the MaxMind DB format")
1267 (description "MaxMind DB is a binary file format that stores data indexed
1268 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1270 (license license:asl2.0)))
1272 (define-public python-geoip2
1274 (name "python-geoip2")
1279 (uri (pypi-uri "geoip2" version))
1282 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1283 (build-system python-build-system)
1285 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1287 `(("python-maxminddb" ,python-maxminddb)
1288 ("python-requests" ,python-requests)))
1289 (home-page "http://www.maxmind.com/")
1290 (synopsis "MaxMind GeoIP2 API")
1291 (description "Provides an API for the GeoIP2 web services and databases.
1292 The API also works with MaxMind’s free GeoLite2 databases.")
1293 (license license:asl2.0)))