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>
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 scons)
40 #:use-module (guix build-system r)
41 #:use-module (guix download)
42 #:use-module (guix git-download)
43 #:use-module (guix svn-download)
44 #:use-module ((guix licenses) #:prefix license:)
45 #:use-module (guix packages)
46 #:use-module (guix utils)
47 #:use-module (gnu packages)
48 #:use-module (gnu packages astronomy)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages boost)
51 #:use-module (gnu packages check)
52 #:use-module (gnu packages compression)
53 #:use-module (gnu packages databases)
54 #:use-module (gnu packages datastructures)
55 #:use-module (gnu packages documentation)
56 #:use-module (gnu packages fonts)
57 #:use-module (gnu packages fontutils)
58 #:use-module (gnu packages glib)
59 #:use-module (gnu packages gnome)
60 #:use-module (gnu packages gtk)
61 #:use-module (gnu packages image)
62 #:use-module (gnu packages icu4c)
63 #:use-module (gnu packages java)
64 #:use-module (gnu packages lua)
65 #:use-module (gnu packages maths)
66 #:use-module (gnu packages pcre)
67 #:use-module (gnu packages perl)
68 #:use-module (gnu packages pkg-config)
69 #:use-module (gnu packages protobuf)
70 #:use-module (gnu packages python)
71 #:use-module (gnu packages python-web)
72 #:use-module (gnu packages python-xyz)
73 #:use-module (gnu packages qt)
74 #:use-module (gnu packages sqlite)
75 #:use-module (gnu packages web)
76 #:use-module (gnu packages webkit)
77 #:use-module (gnu packages wxwidgets)
78 #:use-module (gnu packages xml))
86 (uri (string-append "http://download.osgeo.org/geos/geos-"
91 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
92 (build-system gnu-build-system)
94 (modify-phases %standard-phases
96 'unpack 'patch-test-shebangs
98 (substitute* '("tests/xmltester/testrunner.sh"
99 "tests/geostest/testrunner.sh")
100 (("/bin/sh") (which "sh")))
104 (home-page "https://geos.osgeo.org/")
105 (synopsis "Geometry Engine for Geographic Information Systems")
107 "GEOS provides a spatial object model and fundamental geometric
108 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
109 it aims to contain the complete functionality of JTS in C++. This
110 includes all the OpenGIS Simple Features for SQL spatial predicate
111 functions and spatial operators, as well as specific JTS enhanced
112 topology functions.")
113 (license (list license:lgpl2.1+ ; Main distribution.
114 license:zlib ; tests/xmltester/tinyxml/*
115 license:public-domain)))) ; include/geos/timeval.h
117 (define-public gnome-maps
123 (uri (string-append "mirror://gnome/sources/" name "/"
124 (version-major+minor version) "/"
125 name "-" version ".tar.xz"))
128 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
129 (build-system meson-build-system)
133 (modify-phases %standard-phases
134 (add-after 'unpack 'skip-gtk-update-icon-cache
135 ;; Don't create 'icon-theme.cache'.
137 (substitute* "meson_post_install.py"
138 (("gtk-update-icon-cache") "true"))
140 (add-after 'install 'wrap
141 (lambda* (#:key inputs outputs #:allow-other-keys)
142 (let ((out (assoc-ref outputs "out"))
143 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
144 (geocode-glib-path (string-append
145 (assoc-ref inputs "geocode-glib")
147 (goa-path (string-append
148 (assoc-ref inputs "gnome-online-accounts:lib")
150 (gdk-pixbuf-path (string-append
151 (assoc-ref inputs "gdk-pixbuf")
153 (webkitgtk-path (string-append
154 (assoc-ref inputs "webkitgtk")
156 (wrap-program (string-append out "/bin/gnome-maps")
157 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
159 ;; There seems to be no way to embed the path of
160 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
161 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
162 ;; libgeocode-glib.so.0
163 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
166 ,geocode-glib-path)))
169 `(("gobject-introspection" ,gobject-introspection)
170 ("intltool" ,intltool)
171 ("pkg-config" ,pkg-config)))
174 ("libchamplain" ,libchamplain)
176 ("libsecret" ,libsecret)
178 ("libgweather" ,libgweather)
180 ("gdk-pixbuf" ,gdk-pixbuf+svg)
181 ("glib-networking" ,glib-networking)
183 ("geocode-glib" ,geocode-glib)
184 ("gfbgraph" ,gfbgraph)
187 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
188 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
190 ("webkitgtk" ,webkitgtk)))
193 (synopsis "Graphical map viewer and wayfinding program")
194 (description "GNOME Maps is a graphical map viewer. It uses map data from
195 the OpenStreetMap project. It can provide directions for walking, bicycling,
197 (home-page "https://wiki.gnome.org/Apps/Maps")
198 (license license:gpl2+)))
200 (define-public libgaiagraphics
202 (name "libgaiagraphics")
207 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
211 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
212 (build-system gnu-build-system)
214 `(("pkg-config" ,pkg-config)))
218 ("libjpeg-turbo" ,libjpeg-turbo)
220 ("libgeotiff" ,libgeotiff)
224 (synopsis "Gaia common graphics support")
225 (description "libgaiagraphics is a library supporting
226 common-utility raster handling methods.")
227 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
228 (license license:lgpl3+)))
230 (define-public libgeotiff
237 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
239 (patches (search-patches
240 ;; See libgeotiff 1.5.1 issue
241 ;; https://github.com/OSGeo/libgeotiff/issues/22
242 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
244 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
245 (modules '((guix build utils)))
248 ;; Remove .csv files, distributed from EPSG under a restricted
249 ;; license. See LICENSE for full license text.
250 (for-each delete-file (find-files "." "\\.csv$"))
252 (build-system gnu-build-system)
254 `(("libjpeg-turbo" ,libjpeg-turbo)
258 `(;; libgeotiff headers include proj headers, so ensure those are available.
262 (list "--disable-static"
263 "--with-zlib" "--with-jpeg"
264 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
265 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
266 (description "libgeotiff is a library on top of libtiff for reading and
267 writing GeoTIFF information tags.")
268 (home-page "https://trac.osgeo.org/geotiff/")
269 ;; This is a mixture of various contributions under different licenses.
270 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
271 ;; states, as its commercial redistribution is restricted. Hence, we have
272 ;; removed it from the package.
273 (license (list license:public-domain
276 (license:non-copyleft "file://LICENSE"
277 "See LICENSE in the distribution.")))))
279 (define-public libspatialite
281 (name "libspatialite")
286 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
290 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
291 (build-system gnu-build-system)
293 `(("pkg-config" ,pkg-config)))
303 (modify-phases %standard-phases
304 ;; 3 tests are failing, ignore them:
305 (add-after 'unpack 'ignore-broken-tests
307 (substitute* '("test/Makefile.in")
308 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
309 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
310 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
312 (synopsis "Extend SQLite to support Spatial SQL capabilities")
314 "SpatiaLite is a library intended to extend the SQLite core to support
315 fully fledged Spatial SQL capabilities.")
316 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
317 ;; For the genuine libspatialite-sources holds:
318 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
319 ;; Files under src/control_points are from GRASS
320 ;; and are licensed under GPL2+ only.
321 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
322 (license (list license:gpl2+
325 license:public-domain))))
334 (uri (string-append "http://download.osgeo.org/proj/proj-"
338 "0l1as8f4zfg74fms6h5p5psziw0lpznja1xnirzsscpnfbwc005k"))))
339 (build-system gnu-build-system)
341 `(("sqlite" ,sqlite)))
343 `(("pkg-config" ,pkg-config)))
344 (home-page "https://proj.org/")
345 (synopsis "Coordinate transformation software")
347 "Proj is a generic coordinate transformation software that transforms
348 geospatial coordinates from one coordinate reference system (CRS) to another.
349 This includes cartographic projections as well as geodetic transformations.
350 PROJ includes command line applications for easy conversion of coordinates
351 from text files or directly from user input. In addition, proj also exposes
352 an application programming interface that lets developers use the
353 functionality of proj in their own software.")
354 (license (list license:expat
355 ;; src/projections/patterson.cpp
357 ;; src/geodesic.*, src/tests/geodtest.cpp
360 (define-public proj.4
366 (uri (string-append "http://download.osgeo.org/proj/proj-"
370 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
371 (build-system gnu-build-system)
374 (modify-phases %standard-phases
375 (add-after 'unpack 'patch-test-paths
377 (substitute* '("nad/test27"
383 (("/bin/rm") (which "rm")))
385 ;; Precision problems on i686 and other platforms. See:
386 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
387 ;; Disable failing test.
388 (add-after 'patch-test-paths 'ignore-failing-tests
390 (substitute* '("nad/Makefile.in")
391 (("\tPROJ_LIB.*" all) (string-append "#" all)))
395 (home-page "http://proj4.org/")
396 (synopsis "Cartographic Projections Library")
398 "Proj.4 is a library for converting coordinates between cartographic
400 (license (list license:expat
401 ;; src/PJ_patterson.c
405 ;; Embedded EPSG database.
406 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
410 (define-public mapnik
417 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
418 version "/mapnik-v" version ".tar.bz2"))
421 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
422 (build-system scons-build-system)
426 ("freetype" ,freetype)
427 ("harfbuzz" ,harfbuzz)
429 ("libjpeg-turbo" ,libjpeg-turbo)
438 `(("pkg-config" ,pkg-config)))
440 `(#:scons ,scons-python2
443 (string-append "PREFIX=" %output)
444 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
445 (home-page "http://mapnik.org/")
446 (synopsis "Toolkit for developing mapping applications")
447 (description "Mapnik is a toolkit for developing mapping applications. It
448 is basically a collection of geographic objects like maps, layers,
449 datasources, features, and geometries. At its core is a C++ shared library
450 providing algorithms and patterns for spatial data access and visualization.
451 The library does not rely on any specific windowing system and can be deployed
452 to any server environment. It is intended to play fair in a multi-threaded
453 environment and is aimed primarily, but not exclusively, at web-based
455 (license (list license:lgpl2.1+
456 ;; demo/viewer, demo/python/rundemo.py
458 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
460 ;; deps/mapnik/sparsehash
463 (license:non-copyleft "file://deps/agg/copying")))))
465 (define-public python2-mapnik
467 (name "python2-mapnik")
472 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
474 (file-name (string-append name "-" version ".tar.gz"))
477 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
478 (build-system python-build-system)
481 ("harfbuzz" ,harfbuzz)
483 ("libjpeg-turbo" ,libjpeg-turbo)
489 ("python2-pycairo" ,python2-pycairo)))
491 (let ((test-data-input
492 (lambda (repository version hash)
495 (uri (string-append "https://github.com/mapnik/" repository
496 "/archive/v" version ".tar.gz"))
497 (file-name (string-append "python-mapnik-" repository
498 "-" version ".tar.gz"))
499 (sha256 (base32 hash))))))
500 `(("python2-nose" ,python2-nose)
501 ;; Test data is released as separate tarballs
503 ,(test-data-input "test-data" "3.0.18"
504 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
506 ,(test-data-input "test-data-visual" "3.0.18"
507 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
509 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
511 (modify-phases %standard-phases
512 ;; Unpack test data into the source tree
513 (add-after 'unpack 'unpack-submodules
514 (lambda* (#:key inputs #:allow-other-keys)
515 (let ((unpack (lambda (source target)
516 (with-directory-excursion target
517 (invoke "tar" "xvf" (assoc-ref inputs source)
518 "--strip-components=1")))))
519 (unpack "test-data" "test/data")
520 (unpack "test-data-visual" "test/data-visual"))))
521 ;; Skip failing tests
522 (add-after 'unpack 'skip-tests
524 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
525 "test_unicode_regex_replace"
526 "test_proj_antimeridian_bbox"
527 "test_render_with_scale_factor")))
528 (substitute* "setup.cfg"
529 (("\\[nosetests\\]" all)
530 (string-append all "\nexclude=^("
531 (string-join skipped-tests "|") ")$")))))))))
532 (home-page "https://github.com/mapnik/python-mapnik")
533 (synopsis "Python bindings for Mapnik")
534 (description "This package provides Python bindings for Mapnik.")
535 (license license:lgpl2.1+)))
537 (define-public spatialite-gui
539 (name "spatialite-gui")
544 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
548 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
549 (build-system gnu-build-system)
551 `(("pkg-config" ,pkg-config)))
555 ("libgaiagraphics" ,libgaiagraphics)
556 ("libspatialite" ,libspatialite)
560 ("wxwidgets" ,wxwidgets-2)
562 (synopsis "Graphical user interface for SpatiaLite")
563 (description "Spatialite-gui provides a visual interface for viewing and
564 maintaining a spatialite database. You can easily see the structure of the
565 tables and data contents using point and click functions, many of which
566 construct common SQL queries, or craft your own SQL queries.")
567 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
568 (license license:gpl3+)))
577 "http://download.osgeo.org/gdal/" version "/gdal-"
581 "0f80izh9wshrsw55kg9abpip74hk6frk3hgqrkqbyn3f6i8g2z3q"))
582 (modules '((guix build utils)))
585 ;; TODO: frmts contains a lot more bundled code.
586 (for-each delete-file-recursively
591 "frmts/jpeg/libjpeg12"
592 "frmts/gtiff/libtiff"
593 "frmts/gtiff/libgeotiff"
595 "ogr/ogrsf_frmts/geojson/libjson"))))))
596 (build-system gnu-build-system)
600 (let-syntax ((with (syntax-rules ()
602 (string-append option "="
603 (assoc-ref %build-inputs input))))))
605 ;; TODO: --with-pcidsk, --with-pcraster
606 (with "--with-freexl" "freexl")
607 (with "--with-libjson-c" "json-c")
608 (with "--with-png" "libpng")
609 (with "--with-webp" "libwebp")
610 (with "--with-gif" "giflib")
611 (with "--with-jpeg" "libjpeg-turbo")
612 (with "--with-libtiff" "libtiff")
613 (with "--with-geotiff" "libgeotiff")
614 (with "--with-libz" "zlib")
615 (with "--with-expat" "expat")
616 (with "--with-sqlite3" "sqlite")
619 (modify-phases %standard-phases
620 (add-before 'build 'fix-path
622 (substitute* "frmts/mrf/mrf_band.cpp"
623 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
630 ("libgeotiff" ,libgeotiff)
631 ("libjpeg-turbo" ,libjpeg-turbo)
640 (home-page "https://gdal.org/")
641 (synopsis "Raster and vector geospatial data format library")
642 (description "GDAL is a translator library for raster and vector geospatial
643 data formats. As a library, it presents a single raster abstract data model
644 and single vector abstract data model to the calling application for all
645 supported formats. It also comes with a variety of useful command line
646 utilities for data translation and processing.")
650 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
651 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
654 ;; frmts/hdf4/hdf-eos/*
655 ;; similar to the expat license, but without guarantee exclusion
656 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
657 ;; frmts/grib/degrib/
658 license:public-domain ; with guarantee exclusion
660 ;; Some bsd-inspired license
661 (license:non-copyleft "file://port/LICENCE_minizip")
662 ;; alg/internal_libqhull
663 ;; Some 5-clause license
664 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
668 (define-public python-gdal
669 (package (inherit gdal)
671 (build-system python-build-system)
673 '(#:tests? #f ; no tests
675 (modify-phases %standard-phases
676 (add-before 'build 'chdir
678 (chdir "swig/python")
682 `(("python-numpy" ,python-numpy)))
685 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
687 (define-public postgis
693 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
697 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
698 (build-system gnu-build-system)
702 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
703 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
704 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
705 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
707 (modify-phases %standard-phases
708 (add-before 'build 'fix-install-path
709 (lambda* (#:key outputs #:allow-other-keys)
710 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
711 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
712 (string-append (assoc-ref outputs "out") "/bin"))))))))
717 ("libjpeg" ,libjpeg-turbo)
720 ("postgresql" ,postgresql)
724 ("pkg-config" ,pkg-config)))
725 (home-page "https://postgis.net")
726 (synopsis "Spatial database extender for PostgreSQL")
727 (description "PostGIS is a spatial database extender for PostgreSQL
728 object-relational database. It adds support for geographic objects allowing
729 location queries to be run in SQL. This package provides a PostgreSQL
734 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
737 license:public-domain
739 license:bsd-3 ; files only say "BSD"
741 license:cc-by-sa3.0))))
743 (define-public tegola
750 "https://github.com/go-spatial/tegola/archive/v"
752 (file-name (string-append name "-" version ".tar.gz"))
755 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
756 (build-system go-build-system)
758 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
759 #:unpack-path "github.com/go-spatial/tegola"
761 (modify-phases %standard-phases
762 (add-before 'build 'set-version
764 (with-directory-excursion "src/github.com/go-spatial/tegola"
765 (substitute* '("cmd/tegola/cmd/root.go"
766 "cmd/tegola_lambda/main.go")
767 (("version not set") ,version)))
769 (home-page "http://tegola.io")
770 (synopsis "Vector tile server for maps")
771 (description "Tegola is a free vector tile server written in Go. Tegola
772 takes geospatial data and slices it into vector tiles that can be efficiently
773 delivered to any client.")
776 ;; Some packages in vendor have other licenses
782 (define-public imposm3
785 (version "0.6.0-alpha.4")
789 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
791 (file-name (string-append name "-" version ".tar.gz"))
794 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
795 (build-system go-build-system)
797 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
798 #:unpack-path "github.com/omniscale/imposm3"
800 (modify-phases %standard-phases
801 (add-before 'build 'set-version
803 (substitute* "src/github.com/omniscale/imposm3/version.go"
804 (("0.0.0-dev") ,version))
808 ("leveldb" ,leveldb)))
809 (home-page "https://imposm.org/")
810 (synopsis "OpenStreetMap importer for PostGIS")
811 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
812 files and imports the data into PostgreSQL/PostGIS databases. It is designed
813 to create databases that are optimized for rendering/tile/map-services.")
816 ;; Some dependencies in vendor have different licenses
821 (define-public libosmium
829 (url "https://github.com/osmcode/libosmium.git")
830 (commit (string-append "v" version))))
831 (file-name (git-file-name name version))
833 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
834 (build-system cmake-build-system)
841 ("protozero" ,protozero)
842 ("sparsehash" ,sparsehash)
845 `(("doxygen" ,doxygen)))
846 (home-page "https://osmcode.org/libosmium/")
847 (synopsis "C++ library for working with OpenStreetMap data")
848 (description "Libosmium is a fast and flexible C++ library for working with
849 OpenStreetMap data.")
850 (license license:boost1.0)))
852 (define-public osm2pgsql
860 (url "https://github.com/openstreetmap/osm2pgsql.git")
862 (file-name (git-file-name name version))
864 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
865 (modules '((guix build utils)))
868 (delete-file-recursively "contrib/protozero")
869 (delete-file-recursively "contrib/libosmium")
871 (build-system cmake-build-system)
873 `(#:tests? #f; tests fail because we need to setup a database
875 (list (string-append "-DOSMIUM_INCLUDE_DIR="
876 (assoc-ref %build-inputs "libosmium")
878 (string-append "-DPROTOZERO_INCLUDE_DIR="
879 (assoc-ref %build-inputs "protozero")
884 ("libosmium" ,libosmium)
886 ("postgresql" ,postgresql)
888 ("protozero" ,protozero)
891 `(("python-2" ,python-2)
892 ("python2-psycopg2" ,python2-psycopg2)))
893 (home-page "https://github.com/openstreetmap/osm2pgsql")
894 (synopsis "OSM data importer to postgresql")
895 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
896 PostgreSQL / PostGIS database suitable for applications like rendering into a
897 map, geocoding with Nominatim, or general analysis.")
898 (license license:gpl2+)))
900 (define-public tippecanoe
908 (url "https://github.com/mapbox/tippecanoe.git")
910 (file-name (git-file-name name version))
912 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
913 (build-system gnu-build-system)
916 (modify-phases %standard-phases (delete 'configure))
920 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
925 (home-page "https://github.com/mapbox/tippecanoe")
926 (synopsis "Vector tile server for maps")
927 (description "Tippecanoe creates scale-independent view of data, so that
928 the texture and density of features is visible at every zoom level, instead of
929 dropping features at lower levels.")
930 (license license:bsd-2)))
932 (define-public osmctools
940 (url "https://gitlab.com/osm-c-tools/osmctools")
942 (file-name (git-file-name name version))
945 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
946 (build-system gnu-build-system)
948 `(("autoconf" ,autoconf)
949 ("automake" ,automake)))
952 (home-page "https://gitlab.com/osm-c-tools/osmctools")
953 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
954 (description "This project contains a few tools which are used in the
955 OpenStreetMap project. They can be used to convert, filter and update
956 OpenStreetMap data files.")
957 (license license:agpl3)))
959 (define-public osm-gps-map
967 "https://github.com/nzjrs/osm-gps-map/releases/download/"
968 version "/osm-gps-map-" version ".tar.gz"))
971 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
972 (build-system gnu-build-system)
974 `(("gnome-common" ,gnome-common)
976 ("pkg-config" ,pkg-config)))
980 ("gobject-introspection" ,gobject-introspection)
982 ("libsoup" ,libsoup)))
983 (home-page "https://nzjrs.github.io/osm-gps-map/")
984 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
986 "This package provides a GTK+ widget (and Python bindings) that when
987 given GPS coordinates,draws a GPS track, and points of interest on a moving
988 map display. Downloads map data from a number of websites, including
989 @url{https://www.openstreetmap.org}.")
990 (license license:gpl2+)))
992 (define-public xygrib
999 (url "https://github.com/opengribs/XyGrib.git")
1000 (commit (string-append "v" version))))
1001 (file-name (git-file-name name version))
1004 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
1005 (modules '((guix build utils)))
1007 '(begin (delete-file-recursively "data/fonts") #t))))
1008 (build-system cmake-build-system)
1011 (modify-phases %standard-phases
1012 (add-after 'unpack 'patch-directories
1013 (lambda* (#:key inputs #:allow-other-keys)
1014 (let ((jpeg (assoc-ref inputs "openjpeg"))
1015 (font (assoc-ref inputs "font-liberation")))
1016 (substitute* "CMakeLists.txt"
1019 ;; Fix install locations.
1020 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1021 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1022 ;; Skip looking for the static library.
1023 (("\"libnova.a\"") ""))
1024 ;; Don't use the bundled font-liberation.
1025 (substitute* "src/util/Font.cpp"
1026 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1027 (string-append "\"" font "/share/fonts/truetype/\"")))
1028 (substitute* "src/util/Util.h"
1029 (("pathData\\(\\)\\+\"data/fonts/\"")
1030 (string-append "\"" font "/share/fonts/\""))))
1032 #:tests? #f)) ; no tests
1034 `(("qttools" ,qttools)))
1037 ("font-liberation" ,font-liberation)
1038 ("libnova" ,libnova)
1040 ("openjpeg" ,openjpeg)
1044 (synopsis "Weather Forecast Visualization")
1046 "XyGrib is a Grib file reader and visualizes meteorological data providing
1047 an off-line capability to analyse weather forecasts or hindcasts. It is
1048 intended to be used as a capable weather work station for anyone with a serious
1049 interest in examining weather. This would include members of the sailing
1050 community, private and sport aviators, farmers, weather buffs and many more.
1051 XyGrib is the continuation of the zyGrib software package with a new team of
1053 (home-page "https://opengribs.org")
1054 (license license:gpl3+)))
1056 (define-public libspatialindex
1058 (name "libspatialindex")
1063 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1064 "releases/download/" version "/spatialindex-src-"
1065 version ".tar.bz2"))
1068 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1069 (build-system cmake-build-system)
1070 (home-page "https://libspatialindex.org")
1071 (synopsis "Spatial indexing library")
1072 (description "The purpose of this library is to provide:
1075 @item An extensible framework that will support robust spatial indexing
1077 @item Support for sophisticated spatial queries. Range, point location,
1078 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1079 by spatial constraints) should be easy to deploy and run.
1080 @item Easy to use interfaces for inserting, deleting and updating information.
1081 @item Wide variety of customization capabilities. Basic index and storage
1082 characteristics like the page size, node capacity, minimum fan-out, splitting
1083 algorithm, etc. should be easy to customize.
1084 @item Index persistence. Internal memory and external memory structures
1085 should be supported. Clustered and non-clustered indices should be easy to be
1089 (license license:expat)))
1091 (define-public java-jmapviewer
1093 (name "java-jmapviewer")
1097 (uri (string-append "https://svn.openstreetmap.org/applications/"
1098 "viewer/jmapviewer/releases/" version
1099 "/JMapViewer-" version "-Source.zip"))
1102 "08hbqsbs859v4m5d90560fdifavd1apnpz9v9iry1v31dsvy5707"))))
1103 (build-system ant-build-system)
1105 `(("unzip" ,unzip)))
1107 `(#:build-target "pack"
1108 #:tests? #f; No tests
1110 (modify-phases %standard-phases
1111 (add-before 'build 'clean
1113 (invoke "ant" "clean")))
1115 (lambda* (#:key outputs #:allow-other-keys)
1116 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1118 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1119 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1120 (synopsis "OSM map integration in Java")
1121 (description "JMapViewer is a Java component which allows to easily
1122 integrate an OSM map view into your Java application. It is maintained as
1123 an independent project by the JOSM team.")
1124 (license license:gpl2)))
1133 (url "https://josm.openstreetmap.de/svn/trunk")
1134 (revision (string->number version))
1138 "091pbcn4fnmk42fmxplhis3nw5dbljf6ws8acyhx5dflyn49xzmx"))
1139 (file-name (string-append name "-" version "-checkout"))
1140 (modules '((guix build utils)))
1143 (for-each delete-file (find-files "." ".*.jar$"))
1145 (build-system ant-build-system)
1147 `(("javacc" ,javacc)))
1149 `(("java-commons-jcs" ,java-commons-jcs)
1150 ("java-commons-compress" ,java-commons-compress)
1151 ("java-jmapviewer" ,java-jmapviewer)
1152 ("java-jsonp-api" ,java-jsonp-api)
1153 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1154 ("java-metadata-extractor" ,java-metadata-extractor)
1155 ("java-openjfx-media" ,java-openjfx-media)
1156 ("java-signpost-core" ,java-signpost-core)
1157 ("java-svg-salamander" ,java-svg-salamander)))
1160 #:jar-name "josm.jar"
1162 (modify-phases %standard-phases
1163 (add-after 'unpack 'rm-build.xml
1165 (delete-file "build.xml")
1167 (add-before 'build 'fix-revision
1169 (with-output-to-file "REVISION.XML"
1172 (string-append "<info><entry><commit revision=\"" ,version "\">"
1173 "<date>1970-01-01 00:00:00 +0000</date>"
1174 "</commit></entry></info>"))))
1176 (add-before 'build 'fix-classpath
1177 (lambda* (#:key inputs #:allow-other-keys)
1182 (let ((source (assoc-ref inputs "source")))
1183 (not (equal? (substring s 0 (string-length source)) source))))
1184 (string-split (getenv "CLASSPATH") #\:))
1187 (add-before 'build 'generate-parser
1189 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1190 (out (string-append dir "/parsergen"))
1191 (file (string-append dir "/MapCSSParser.jj")))
1192 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1193 (invoke "javacc" "-DEBUG_PARSER=false"
1194 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1195 "-GRAMMAR_ENCODING=UTF-8"
1196 (string-append "-OUTPUT_DIRECTORY=" out)
1199 (add-after 'build 'generate-epsg
1201 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1202 "-cp" "build/classes")
1203 (mkdir-p "data/projection")
1204 (with-output-to-file "data/projection/custom-epsg"
1205 (lambda _ (display "")))
1206 (invoke "java" "-cp" "build/classes:scripts:."
1207 "BuildProjectionDefinitions" ".")
1209 (add-after 'generate-epsg 'copy-data
1211 (mkdir-p "build/classes")
1212 (rename-file "data" "build/classes/data")
1214 (add-before 'install 'regenerate-jar
1216 ;; We need to regenerate the jar file to add data.
1217 (delete-file "build/jar/josm.jar")
1218 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1219 "build/classes" ".")
1221 (add-before 'build 'copy-styles
1223 (mkdir-p "build/classes")
1224 (rename-file "styles" "build/classes/styles")
1226 (add-before 'build 'copy-images
1228 (mkdir-p "build/classes")
1229 (rename-file "images" "build/classes/images")
1231 (add-before 'build 'copy-revision
1233 (mkdir-p "build/classes")
1234 (with-output-to-file "build/classes/REVISION"
1237 (string-append "Revision: " ,version "\n"
1238 "Is-Local-Build: true\n"
1239 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1241 (add-after 'install 'install-bin
1242 (lambda* (#:key outputs inputs #:allow-other-keys)
1243 (let* ((out (assoc-ref outputs "out"))
1244 (bin (string-append out "/bin")))
1246 (with-output-to-file (string-append bin "/josm")
1249 (string-append "#!/bin/sh\n"
1250 (assoc-ref inputs "jdk") "/bin/java"
1251 " -cp " out "/share/java/josm.jar:"
1252 (getenv "CLASSPATH")
1253 " org.openstreetmap.josm.gui.MainApplication"))))
1254 (chmod (string-append bin "/josm") #o755))
1256 (home-page "https://josm.openstreetmap.de")
1257 (synopsis "OSM editor")
1258 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1259 supports loading GPX tracks, background imagery and OSM data from local
1260 sources as well as from online sources and allows to edit the OSM data (nodes,
1261 ways, and relations) and their metadata tags.")
1262 (license license:gpl2+)))
1264 (define-public libmaxminddb
1266 (name "libmaxminddb")
1271 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1272 "/releases/download/" version "/"
1273 "/libmaxminddb-" version ".tar.gz"))
1275 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1276 (build-system gnu-build-system)
1279 (modify-phases %standard-phases
1280 (add-before 'configure 'set-cc-to-gcc
1282 (setenv "CC" "gcc"))))))
1285 (home-page "https://maxmind.github.io/libmaxminddb/")
1286 (synopsis "C library for the MaxMind DB file format")
1287 (description "The libmaxminddb library provides a C library for reading
1288 MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1289 format is a custom, but open, binary format designed to facilitate fast
1290 lookups of IP addresses while allowing flexibility in the type of data
1291 associated with an address.")
1292 (license license:asl2.0)))
1294 (define-public python-maxminddb
1296 (name "python-maxminddb")
1301 (uri (pypi-uri "maxminddb" version))
1304 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1305 (build-system python-build-system)
1307 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1309 `(("libmaxminddb" ,libmaxminddb)))
1310 (home-page "http://www.maxmind.com/")
1311 (synopsis "Reader for the MaxMind DB format")
1312 (description "MaxMind DB is a binary file format that stores data indexed
1313 by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1315 (license license:asl2.0)))
1317 (define-public python-geoip2
1319 (name "python-geoip2")
1324 (uri (pypi-uri "geoip2" version))
1327 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1328 (build-system python-build-system)
1330 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1332 `(("python-maxminddb" ,python-maxminddb)
1333 ("python-requests" ,python-requests)))
1334 (home-page "http://www.maxmind.com/")
1335 (synopsis "MaxMind GeoIP2 API")
1336 (description "Provides an API for the GeoIP2 web services and databases.
1337 The API also works with MaxMind’s free GeoLite2 databases.")
1338 (license license:asl2.0)))