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)
47 #:use-module (gnu packages astronomy)
48 #:use-module (gnu packages autotools)
49 #:use-module (gnu packages boost)
50 #:use-module (gnu packages check)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages databases)
53 #:use-module (gnu packages datastructures)
54 #:use-module (gnu packages documentation)
55 #:use-module (gnu packages fonts)
56 #:use-module (gnu packages fontutils)
57 #:use-module (gnu packages glib)
58 #:use-module (gnu packages gnome)
59 #:use-module (gnu packages gtk)
60 #:use-module (gnu packages image)
61 #:use-module (gnu packages icu4c)
62 #:use-module (gnu packages java)
63 #:use-module (gnu packages lua)
64 #:use-module (gnu packages maths)
65 #:use-module (gnu packages pcre)
66 #:use-module (gnu packages perl)
67 #:use-module (gnu packages pkg-config)
68 #:use-module (gnu packages protobuf)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-web)
71 #:use-module (gnu packages python-xyz)
72 #:use-module (gnu packages qt)
73 #:use-module (gnu packages sqlite)
74 #:use-module (gnu packages web)
75 #:use-module (gnu packages webkit)
76 #:use-module (gnu packages wxwidgets)
77 #:use-module (gnu packages xml))
85 (uri (string-append "http://download.osgeo.org/geos/geos-"
90 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
91 (build-system gnu-build-system)
93 (modify-phases %standard-phases
95 'unpack 'patch-test-shebangs
97 (substitute* '("tests/xmltester/testrunner.sh"
98 "tests/geostest/testrunner.sh")
99 (("/bin/sh") (which "sh")))
103 (home-page "https://geos.osgeo.org/")
104 (synopsis "Geometry Engine for Geographic Information Systems")
106 "GEOS provides a spatial object model and fundamental geometric
107 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
108 it aims to contain the complete functionality of JTS in C++. This
109 includes all the OpenGIS Simple Features for SQL spatial predicate
110 functions and spatial operators, as well as specific JTS enhanced
111 topology functions.")
112 (license (list license:lgpl2.1+ ; Main distribution.
113 license:zlib ; tests/xmltester/tinyxml/*
114 license:public-domain)))) ; include/geos/timeval.h
116 (define-public gnome-maps
122 (uri (string-append "mirror://gnome/sources/" name "/"
123 (version-major+minor version) "/"
124 name "-" version ".tar.xz"))
127 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
128 (build-system meson-build-system)
132 (modify-phases %standard-phases
133 (add-after 'unpack 'skip-gtk-update-icon-cache
134 ;; Don't create 'icon-theme.cache'.
136 (substitute* "meson_post_install.py"
137 (("gtk-update-icon-cache") "true"))
139 (add-after 'install 'wrap
140 (lambda* (#:key inputs outputs #:allow-other-keys)
141 (let ((out (assoc-ref outputs "out"))
142 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
143 (geocode-glib-path (string-append
144 (assoc-ref inputs "geocode-glib")
146 (goa-path (string-append
147 (assoc-ref inputs "gnome-online-accounts:lib")
149 (gdk-pixbuf-path (string-append
150 (assoc-ref inputs "gdk-pixbuf")
152 (webkitgtk-path (string-append
153 (assoc-ref inputs "webkitgtk")
155 (wrap-program (string-append out "/bin/gnome-maps")
156 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
158 ;; There seems to be no way to embed the path of
159 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
160 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
161 ;; libgeocode-glib.so.0
162 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
165 ,geocode-glib-path)))
168 `(("gobject-introspection" ,gobject-introspection)
169 ("intltool" ,intltool)
170 ("pkg-config" ,pkg-config)))
173 ("libchamplain" ,libchamplain)
175 ("libsecret" ,libsecret)
177 ("libgweather" ,libgweather)
179 ("gdk-pixbuf" ,gdk-pixbuf+svg)
180 ("glib-networking" ,glib-networking)
182 ("geocode-glib" ,geocode-glib)
183 ("gfbgraph" ,gfbgraph)
186 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
187 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
189 ("webkitgtk" ,webkitgtk)))
192 (synopsis "Graphical map viewer and wayfinding program")
193 (description "GNOME Maps is a graphical map viewer. It uses map data from
194 the OpenStreetMap project. It can provide directions for walking, bicycling,
196 (home-page "https://wiki.gnome.org/Apps/Maps")
197 (license license:gpl2+)))
199 (define-public libgaiagraphics
201 (name "libgaiagraphics")
206 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
210 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
211 (build-system gnu-build-system)
213 `(("pkg-config" ,pkg-config)))
217 ("libjpeg-turbo" ,libjpeg-turbo)
219 ("libgeotiff" ,libgeotiff)
223 (synopsis "Gaia common graphics support")
224 (description "libgaiagraphics is a library supporting
225 common-utility raster handling methods.")
226 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
227 (license license:lgpl3+)))
229 (define-public libgeotiff
236 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
238 (patches (search-patches
239 ;; See libgeotiff 1.5.1 issue
240 ;; https://github.com/OSGeo/libgeotiff/issues/22
241 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
243 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
244 (modules '((guix build utils)))
247 ;; Remove .csv files, distributed from EPSG under a restricted
248 ;; license. See LICENSE for full license text.
249 (for-each delete-file (find-files "." "\\.csv$"))
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))))
331 (uri (string-append "http://download.osgeo.org/proj/proj-"
335 "0l1as8f4zfg74fms6h5p5psziw0lpznja1xnirzsscpnfbwc005k"))))
336 (build-system gnu-build-system)
338 `(("sqlite" ,sqlite)))
340 `(("pkg-config" ,pkg-config)))
341 (home-page "https://proj.org/")
342 (synopsis "Coordinate transformation software")
344 "Proj is a generic coordinate transformation software that transforms
345 geospatial coordinates from one coordinate reference system (CRS) to another.
346 This includes cartographic projections as well as geodetic transformations.
347 PROJ includes command line applications for easy conversion of coordinates
348 from text files or directly from user input. In addition, proj also exposes
349 an application programming interface that lets developers use the
350 functionality of proj in their own software.")
351 (license (list license:expat
352 ;; src/projections/patterson.cpp
354 ;; src/geodesic.*, src/tests/geodtest.cpp
357 (define-public proj.4
363 (uri (string-append "http://download.osgeo.org/proj/proj-"
367 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
368 (build-system gnu-build-system)
371 (modify-phases %standard-phases
372 (add-after 'unpack 'patch-test-paths
374 (substitute* '("nad/test27"
380 (("/bin/rm") (which "rm")))
382 ;; Precision problems on i686 and other platforms. See:
383 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
384 ;; Disable failing test.
385 (add-after 'patch-test-paths 'ignore-failing-tests
387 (substitute* '("nad/Makefile.in")
388 (("\tPROJ_LIB.*" all) (string-append "#" all)))
392 (home-page "http://proj4.org/")
393 (synopsis "Cartographic Projections Library")
395 "Proj.4 is a library for converting coordinates between cartographic
397 (license (list license:expat
398 ;; src/PJ_patterson.c
402 ;; Embedded EPSG database.
403 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
407 (define-public mapnik
414 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
415 version "/mapnik-v" version ".tar.bz2"))
418 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
419 (build-system scons-build-system)
423 ("freetype" ,freetype)
424 ("harfbuzz" ,harfbuzz)
426 ("libjpeg-turbo" ,libjpeg-turbo)
435 `(("pkg-config" ,pkg-config)))
437 `(#:scons ,scons-python2
440 (string-append "PREFIX=" %output)
441 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
442 (home-page "http://mapnik.org/")
443 (synopsis "Toolkit for developing mapping applications")
444 (description "Mapnik is a toolkit for developing mapping applications. It
445 is basically a collection of geographic objects like maps, layers,
446 datasources, features, and geometries. At its core is a C++ shared library
447 providing algorithms and patterns for spatial data access and visualization.
448 The library does not rely on any specific windowing system and can be deployed
449 to any server environment. It is intended to play fair in a multi-threaded
450 environment and is aimed primarily, but not exclusively, at web-based
452 (license (list license:lgpl2.1+
453 ;; demo/viewer, demo/python/rundemo.py
455 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
457 ;; deps/mapnik/sparsehash
460 (license:non-copyleft "file://deps/agg/copying")))))
462 (define-public python2-mapnik
464 (name "python2-mapnik")
469 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
471 (file-name (string-append name "-" version ".tar.gz"))
474 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
475 (build-system python-build-system)
478 ("harfbuzz" ,harfbuzz)
480 ("libjpeg-turbo" ,libjpeg-turbo)
486 ("python2-pycairo" ,python2-pycairo)))
488 (let ((test-data-input
489 (lambda (repository version hash)
492 (uri (string-append "https://github.com/mapnik/" repository
493 "/archive/v" version ".tar.gz"))
494 (file-name (string-append "python-mapnik-" repository
495 "-" version ".tar.gz"))
496 (sha256 (base32 hash))))))
497 `(("python2-nose" ,python2-nose)
498 ;; Test data is released as separate tarballs
500 ,(test-data-input "test-data" "3.0.18"
501 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
503 ,(test-data-input "test-data-visual" "3.0.18"
504 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
506 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
508 (modify-phases %standard-phases
509 ;; Unpack test data into the source tree
510 (add-after 'unpack 'unpack-submodules
511 (lambda* (#:key inputs #:allow-other-keys)
512 (let ((unpack (lambda (source target)
513 (with-directory-excursion target
514 (invoke "tar" "xvf" (assoc-ref inputs source)
515 "--strip-components=1")))))
516 (unpack "test-data" "test/data")
517 (unpack "test-data-visual" "test/data-visual"))))
518 ;; Skip failing tests
519 (add-after 'unpack 'skip-tests
521 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
522 "test_unicode_regex_replace"
523 "test_proj_antimeridian_bbox"
524 "test_render_with_scale_factor")))
525 (substitute* "setup.cfg"
526 (("\\[nosetests\\]" all)
527 (string-append all "\nexclude=^("
528 (string-join skipped-tests "|") ")$")))))))))
529 (home-page "https://github.com/mapnik/python-mapnik")
530 (synopsis "Python bindings for Mapnik")
531 (description "This package provides Python bindings for Mapnik.")
532 (license license:lgpl2.1+)))
534 (define-public spatialite-gui
536 (name "spatialite-gui")
541 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
545 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
546 (build-system gnu-build-system)
548 `(("pkg-config" ,pkg-config)))
552 ("libgaiagraphics" ,libgaiagraphics)
553 ("libspatialite" ,libspatialite)
557 ("wxwidgets" ,wxwidgets-2)
559 (synopsis "Graphical user interface for SpatiaLite")
560 (description "Spatialite-gui provides a visual interface for viewing and
561 maintaining a spatialite database. You can easily see the structure of the
562 tables and data contents using point and click functions, many of which
563 construct common SQL queries, or craft your own SQL queries.")
564 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
565 (license license:gpl3+)))
574 "http://download.osgeo.org/gdal/" version "/gdal-"
578 "0f80izh9wshrsw55kg9abpip74hk6frk3hgqrkqbyn3f6i8g2z3q"))
579 (modules '((guix build utils)))
582 ;; TODO: frmts contains a lot more bundled code.
583 (for-each delete-file-recursively
588 "frmts/jpeg/libjpeg12"
589 "frmts/gtiff/libtiff"
590 "frmts/gtiff/libgeotiff"
592 "ogr/ogrsf_frmts/geojson/libjson"))))))
593 (build-system gnu-build-system)
597 (let-syntax ((with (syntax-rules ()
599 (string-append option "="
600 (assoc-ref %build-inputs input))))))
602 ;; TODO: --with-pcidsk, --with-pcraster
603 (with "--with-freexl" "freexl")
604 (with "--with-libjson-c" "json-c")
605 (with "--with-png" "libpng")
606 (with "--with-webp" "libwebp")
607 (with "--with-gif" "giflib")
608 (with "--with-jpeg" "libjpeg-turbo")
609 (with "--with-libtiff" "libtiff")
610 (with "--with-geotiff" "libgeotiff")
611 (with "--with-libz" "zlib")
612 (with "--with-expat" "expat")
613 (with "--with-sqlite3" "sqlite")
616 (modify-phases %standard-phases
617 (add-before 'build 'fix-path
619 (substitute* "frmts/mrf/mrf_band.cpp"
620 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
627 ("libgeotiff" ,libgeotiff)
628 ("libjpeg-turbo" ,libjpeg-turbo)
637 (home-page "https://gdal.org/")
638 (synopsis "Raster and vector geospatial data format library")
639 (description "GDAL is a translator library for raster and vector geospatial
640 data formats. As a library, it presents a single raster abstract data model
641 and single vector abstract data model to the calling application for all
642 supported formats. It also comes with a variety of useful command line
643 utilities for data translation and processing.")
647 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
648 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
651 ;; frmts/hdf4/hdf-eos/*
652 ;; similar to the expat license, but without guarantee exclusion
653 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
654 ;; frmts/grib/degrib/
655 license:public-domain ; with guarantee exclusion
657 ;; Some bsd-inspired license
658 (license:non-copyleft "file://port/LICENCE_minizip")
659 ;; alg/internal_libqhull
660 ;; Some 5-clause license
661 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
665 (define-public python-gdal
666 (package (inherit gdal)
668 (build-system python-build-system)
670 '(#:tests? #f ; no tests
672 (modify-phases %standard-phases
673 (add-before 'build 'chdir
675 (chdir "swig/python")
679 `(("python-numpy" ,python-numpy)))
682 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
684 (define-public postgis
690 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
694 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
695 (build-system gnu-build-system)
699 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
700 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
701 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
702 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
704 (modify-phases %standard-phases
705 (add-before 'build 'fix-install-path
706 (lambda* (#:key outputs #:allow-other-keys)
707 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
708 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
709 (string-append (assoc-ref outputs "out") "/bin"))))))))
714 ("libjpeg" ,libjpeg-turbo)
717 ("postgresql" ,postgresql)
721 ("pkg-config" ,pkg-config)))
722 (home-page "https://postgis.net")
723 (synopsis "Spatial database extender for PostgreSQL")
724 (description "PostGIS is a spatial database extender for PostgreSQL
725 object-relational database. It adds support for geographic objects allowing
726 location queries to be run in SQL. This package provides a PostgreSQL
731 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
734 license:public-domain
736 license:bsd-3 ; files only say "BSD"
738 license:cc-by-sa3.0))))
740 (define-public tegola
747 "https://github.com/go-spatial/tegola/archive/v"
749 (file-name (string-append name "-" version ".tar.gz"))
752 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
753 (build-system go-build-system)
755 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
756 #:unpack-path "github.com/go-spatial/tegola"
758 (modify-phases %standard-phases
759 (add-before 'build 'set-version
761 (with-directory-excursion "src/github.com/go-spatial/tegola"
762 (substitute* '("cmd/tegola/cmd/root.go"
763 "cmd/tegola_lambda/main.go")
764 (("version not set") ,version)))
766 (home-page "http://tegola.io")
767 (synopsis "Vector tile server for maps")
768 (description "Tegola is a free vector tile server written in Go. Tegola
769 takes geospatial data and slices it into vector tiles that can be efficiently
770 delivered to any client.")
773 ;; Some packages in vendor have other licenses
779 (define-public imposm3
782 (version "0.6.0-alpha.4")
786 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
788 (file-name (string-append name "-" version ".tar.gz"))
791 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
792 (build-system go-build-system)
794 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
795 #:unpack-path "github.com/omniscale/imposm3"
797 (modify-phases %standard-phases
798 (add-before 'build 'set-version
800 (substitute* "src/github.com/omniscale/imposm3/version.go"
801 (("0.0.0-dev") ,version))
805 ("leveldb" ,leveldb)))
806 (home-page "https://imposm.org/")
807 (synopsis "OpenStreetMap importer for PostGIS")
808 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
809 files and imports the data into PostgreSQL/PostGIS databases. It is designed
810 to create databases that are optimized for rendering/tile/map-services.")
813 ;; Some dependencies in vendor have different licenses
818 (define-public libosmium
826 (url "https://github.com/osmcode/libosmium.git")
827 (commit (string-append "v" version))))
828 (file-name (git-file-name name version))
830 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
831 (build-system cmake-build-system)
838 ("protozero" ,protozero)
839 ("sparsehash" ,sparsehash)
842 `(("doxygen" ,doxygen)))
843 (home-page "https://osmcode.org/libosmium/")
844 (synopsis "C++ library for working with OpenStreetMap data")
845 (description "Libosmium is a fast and flexible C++ library for working with
846 OpenStreetMap data.")
847 (license license:boost1.0)))
849 (define-public osm2pgsql
857 (url "https://github.com/openstreetmap/osm2pgsql.git")
859 (file-name (git-file-name name version))
861 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
862 (modules '((guix build utils)))
865 (delete-file-recursively "contrib/protozero")
866 (delete-file-recursively "contrib/libosmium")
868 (build-system cmake-build-system)
870 `(#:tests? #f; tests fail because we need to setup a database
872 (list (string-append "-DOSMIUM_INCLUDE_DIR="
873 (assoc-ref %build-inputs "libosmium")
875 (string-append "-DPROTOZERO_INCLUDE_DIR="
876 (assoc-ref %build-inputs "protozero")
881 ("libosmium" ,libosmium)
883 ("postgresql" ,postgresql)
885 ("protozero" ,protozero)
888 `(("python-2" ,python-2)
889 ("python2-psycopg2" ,python2-psycopg2)))
890 (home-page "https://github.com/openstreetmap/osm2pgsql")
891 (synopsis "OSM data importer to postgresql")
892 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
893 PostgreSQL / PostGIS database suitable for applications like rendering into a
894 map, geocoding with Nominatim, or general analysis.")
895 (license license:gpl2+)))
897 (define-public tippecanoe
905 (url "https://github.com/mapbox/tippecanoe.git")
907 (file-name (git-file-name name version))
909 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
910 (build-system gnu-build-system)
913 (modify-phases %standard-phases (delete 'configure))
917 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
922 (home-page "https://github.com/mapbox/tippecanoe")
923 (synopsis "Vector tile server for maps")
924 (description "Tippecanoe creates scale-independent view of data, so that
925 the texture and density of features is visible at every zoom level, instead of
926 dropping features at lower levels.")
927 (license license:bsd-2)))
929 (define-public osmctools
937 (url "https://gitlab.com/osm-c-tools/osmctools")
939 (file-name (git-file-name name version))
942 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
943 (build-system gnu-build-system)
945 `(("autoconf" ,autoconf)
946 ("automake" ,automake)))
949 (home-page "https://gitlab.com/osm-c-tools/osmctools")
950 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
951 (description "This project contains a few tools which are used in the
952 OpenStreetMap project. They can be used to convert, filter and update
953 OpenStreetMap data files.")
954 (license license:agpl3)))
956 (define-public osm-gps-map
964 "https://github.com/nzjrs/osm-gps-map/releases/download/"
965 version "/osm-gps-map-" version ".tar.gz"))
968 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
969 (build-system gnu-build-system)
971 `(("gnome-common" ,gnome-common)
973 ("pkg-config" ,pkg-config)))
977 ("gobject-introspection" ,gobject-introspection)
979 ("libsoup" ,libsoup)))
980 (home-page "https://nzjrs.github.io/osm-gps-map/")
981 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
983 "This package provides a GTK+ widget (and Python bindings) that when
984 given GPS coordinates,draws a GPS track, and points of interest on a moving
985 map display. Downloads map data from a number of websites, including
986 @url{https://www.openstreetmap.org}.")
987 (license license:gpl2+)))
989 (define-public xygrib
996 (url "https://github.com/opengribs/XyGrib.git")
997 (commit (string-append "v" version))))
998 (file-name (git-file-name name version))
1001 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1002 (modules '((guix build utils)))
1004 '(begin (delete-file-recursively "data/fonts") #t))))
1005 (build-system cmake-build-system)
1008 (modify-phases %standard-phases
1009 (add-after 'unpack 'patch-directories
1010 (lambda* (#:key inputs #:allow-other-keys)
1011 (let ((jpeg (assoc-ref inputs "openjpeg"))
1012 (font (assoc-ref inputs "font-liberation")))
1013 (substitute* "CMakeLists.txt"
1016 ;; Fix install locations.
1017 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1018 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1019 ;; Skip looking for the static library.
1020 (("\"libnova.a\"") ""))
1021 ;; Don't use the bundled font-liberation.
1022 (substitute* "src/util/Font.cpp"
1023 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1024 (string-append "\"" font "/share/fonts/truetype/\"")))
1025 (substitute* "src/util/Util.h"
1026 (("pathData\\(\\)\\+\"data/fonts/\"")
1027 (string-append "\"" font "/share/fonts/\""))))
1029 #:tests? #f)) ; no tests
1031 `(("qttools" ,qttools)))
1034 ("font-liberation" ,font-liberation)
1035 ("libnova" ,libnova)
1037 ("openjpeg" ,openjpeg)
1041 (synopsis "Weather Forecast Visualization")
1043 "XyGrib is a Grib file reader and visualizes meteorological data providing
1044 an off-line capability to analyse weather forecasts or hindcasts. It is
1045 intended to be used as a capable weather work station for anyone with a serious
1046 interest in examining weather. This would include members of the sailing
1047 community, private and sport aviators, farmers, weather buffs and many more.
1048 XyGrib is the continuation of the zyGrib software package with a new team of
1050 (home-page "https://opengribs.org")
1051 (license license:gpl3+)))
1053 (define-public libspatialindex
1055 (name "libspatialindex")
1060 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1061 "releases/download/" version "/spatialindex-src-"
1062 version ".tar.bz2"))
1065 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1066 (build-system cmake-build-system)
1067 (home-page "https://libspatialindex.org")
1068 (synopsis "Spatial indexing library")
1069 (description "The purpose of this library is to provide:
1072 @item An extensible framework that will support robust spatial indexing
1074 @item Support for sophisticated spatial queries. Range, point location,
1075 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1076 by spatial constraints) should be easy to deploy and run.
1077 @item Easy to use interfaces for inserting, deleting and updating information.
1078 @item Wide variety of customization capabilities. Basic index and storage
1079 characteristics like the page size, node capacity, minimum fan-out, splitting
1080 algorithm, etc. should be easy to customize.
1081 @item Index persistence. Internal memory and external memory structures
1082 should be supported. Clustered and non-clustered indices should be easy to be
1086 (license license:expat)))
1088 (define-public java-jmapviewer
1090 (name "java-jmapviewer")
1094 (uri (string-append "https://svn.openstreetmap.org/applications/"
1095 "viewer/jmapviewer/releases/" version
1096 "/JMapViewer-" version "-Source.zip"))
1099 "08hbqsbs859v4m5d90560fdifavd1apnpz9v9iry1v31dsvy5707"))))
1100 (build-system ant-build-system)
1102 `(("unzip" ,unzip)))
1104 `(#:build-target "pack"
1105 #:tests? #f; No tests
1107 (modify-phases %standard-phases
1108 (add-before 'build 'clean
1110 (invoke "ant" "clean")))
1112 (lambda* (#:key outputs #:allow-other-keys)
1113 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1115 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1116 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1117 (synopsis "OSM map integration in Java")
1118 (description "JMapViewer is a Java component which allows to easily
1119 integrate an OSM map view into your Java application. It is maintained as
1120 an independent project by the JOSM team.")
1121 (license license:gpl2)))
1130 (url "https://josm.openstreetmap.de/svn/trunk")
1131 (revision (string->number version))
1135 "091pbcn4fnmk42fmxplhis3nw5dbljf6ws8acyhx5dflyn49xzmx"))
1136 (file-name (string-append name "-" version "-checkout"))
1137 (modules '((guix build utils)))
1140 (for-each delete-file (find-files "." ".*.jar$"))
1142 (build-system ant-build-system)
1144 `(("javacc" ,javacc)))
1146 `(("java-commons-jcs" ,java-commons-jcs)
1147 ("java-commons-compress" ,java-commons-compress)
1148 ("java-jmapviewer" ,java-jmapviewer)
1149 ("java-jsonp-api" ,java-jsonp-api)
1150 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1151 ("java-metadata-extractor" ,java-metadata-extractor)
1152 ("java-openjfx-media" ,java-openjfx-media)
1153 ("java-signpost-core" ,java-signpost-core)
1154 ("java-svg-salamander" ,java-svg-salamander)))
1157 #:jar-name "josm.jar"
1159 (modify-phases %standard-phases
1160 (add-after 'unpack 'rm-build.xml
1162 (delete-file "build.xml")
1164 (add-before 'build 'fix-revision
1166 (with-output-to-file "REVISION.XML"
1169 (string-append "<info><entry><commit revision=\"" ,version "\">"
1170 "<date>1970-01-01 00:00:00 +0000</date>"
1171 "</commit></entry></info>"))))
1173 (add-before 'build 'fix-classpath
1174 (lambda* (#:key inputs #:allow-other-keys)
1179 (let ((source (assoc-ref inputs "source")))
1180 (not (equal? (substring s 0 (string-length source)) source))))
1181 (string-split (getenv "CLASSPATH") #\:))
1184 (add-before 'build 'generate-parser
1186 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1187 (out (string-append dir "/parsergen"))
1188 (file (string-append dir "/MapCSSParser.jj")))
1189 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1190 (invoke "javacc" "-DEBUG_PARSER=false"
1191 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1192 "-GRAMMAR_ENCODING=UTF-8"
1193 (string-append "-OUTPUT_DIRECTORY=" out)
1196 (add-after 'build 'generate-epsg
1198 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1199 "-cp" "build/classes")
1200 (mkdir-p "data/projection")
1201 (with-output-to-file "data/projection/custom-epsg"
1202 (lambda _ (display "")))
1203 (invoke "java" "-cp" "build/classes:scripts:."
1204 "BuildProjectionDefinitions" ".")
1206 (add-after 'generate-epsg 'copy-data
1208 (mkdir-p "build/classes")
1209 (rename-file "data" "build/classes/data")
1211 (add-before 'install 'regenerate-jar
1213 ;; We need to regenerate the jar file to add data.
1214 (delete-file "build/jar/josm.jar")
1215 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1216 "build/classes" ".")
1218 (add-before 'build 'copy-styles
1220 (mkdir-p "build/classes")
1221 (rename-file "styles" "build/classes/styles")
1223 (add-before 'build 'copy-images
1225 (mkdir-p "build/classes")
1226 (rename-file "images" "build/classes/images")
1228 (add-before 'build 'copy-revision
1230 (mkdir-p "build/classes")
1231 (with-output-to-file "build/classes/REVISION"
1234 (string-append "Revision: " ,version "\n"
1235 "Is-Local-Build: true\n"
1236 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1238 (add-after 'install 'install-bin
1239 (lambda* (#:key outputs inputs #:allow-other-keys)
1240 (let* ((out (assoc-ref outputs "out"))
1241 (bin (string-append out "/bin")))
1243 (with-output-to-file (string-append bin "/josm")
1246 (string-append "#!/bin/sh\n"
1247 (assoc-ref inputs "jdk") "/bin/java"
1248 " -cp " out "/share/java/josm.jar:"
1249 (getenv "CLASSPATH")
1250 " org.openstreetmap.josm.gui.MainApplication"))))
1251 (chmod (string-append bin "/josm") #o755))
1253 (home-page "https://josm.openstreetmap.de")
1254 (synopsis "OSM editor")
1255 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1256 supports loading GPX tracks, background imagery and OSM data from local
1257 sources as well as from online sources and allows to edit the OSM data (nodes,
1258 ways, and relations) and their metadata tags.")
1259 (license license:gpl2+)))
1261 (define-public libmaxminddb
1263 (name "libmaxminddb")
1268 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1269 "/releases/download/" version "/"
1270 "/libmaxminddb-" version ".tar.gz"))
1272 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1273 (build-system gnu-build-system)
1276 (modify-phases %standard-phases
1277 (add-before 'configure 'set-cc-to-gcc
1279 (setenv "CC" "gcc"))))))
1282 (home-page "https://maxmind.github.io/libmaxminddb/")
1283 (synopsis "C library for the MaxMind DB file format")
1284 (description "The libmaxminddb library provides a C library for reading
1285 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1286 format is a custom, but open, binary format designed to facilitate fast
1287 lookups of IP addresses while allowing flexibility in the type of data
1288 associated with an address.")
1289 (license license:asl2.0)))
1291 (define-public python-maxminddb
1293 (name "python-maxminddb")
1298 (uri (pypi-uri "maxminddb" version))
1301 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1302 (build-system python-build-system)
1304 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1306 `(("libmaxminddb" ,libmaxminddb)))
1307 (home-page "http://www.maxmind.com/")
1308 (synopsis "Reader for the MaxMind DB format")
1309 (description "MaxMind DB is a binary file format that stores data indexed
1310 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1312 (license license:asl2.0)))
1314 (define-public python-geoip2
1316 (name "python-geoip2")
1321 (uri (pypi-uri "geoip2" version))
1324 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1325 (build-system python-build-system)
1327 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1329 `(("python-maxminddb" ,python-maxminddb)
1330 ("python-requests" ,python-requests)))
1331 (home-page "http://www.maxmind.com/")
1332 (synopsis "MaxMind GeoIP2 API")
1333 (description "Provides an API for the GeoIP2 web services and databases.
1334 The API also works with MaxMind’s free GeoLite2 databases.")
1335 (license license:asl2.0)))