gnu: emacs-company: Update to 0.9.12.
[jackhill/guix/guix.git] / gnu / packages / geo.scm
CommitLineData
03c1662e
LF
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
ad1ff78d 3;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
f6c507e1 4;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
257c826c 5;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
8d26f48e 6;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
d33afa26 7;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
3d60f426 8;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
6dd0e41d 9;;; Copyright © 2018, 2019 Julien Lepiller <julien@lepiller.eu>
30fa6b16 10;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
0f7b8a7f 11;;; Copyright © 2019 Efraim Flashner <efraim@flashner.co.il>
41b4b713 12;;; Copyright © 2019 Wiktor Żelazny <wzelazny@vurv.cz>
53c9b398 13;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
517c5538 14;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
03c1662e
LF
15;;;
16;;; This file is part of GNU Guix.
17;;;
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.
22;;;
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.
27;;;
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/>.
30
31(define-module (gnu packages geo)
6dd0e41d 32 #:use-module (guix build-system ant)
8fa3451c 33 #:use-module (guix build-system cmake)
03c1662e 34 #:use-module (guix build-system glib-or-gtk)
065d0125 35 #:use-module (guix build-system gnu)
be7c64ba 36 #:use-module (guix build-system go)
5339d2bb 37 #:use-module (guix build-system meson)
f25e1e24 38 #:use-module (guix build-system python)
bccbeece 39 #:use-module (guix build-system qt)
f2b005f6 40 #:use-module (guix build-system scons)
3d60f426 41 #:use-module (guix build-system r)
03c1662e 42 #:use-module (guix download)
d56af1ff 43 #:use-module (guix git-download)
f041db86 44 #:use-module (guix svn-download)
065d0125 45 #:use-module ((guix licenses) #:prefix license:)
03c1662e
LF
46 #:use-module (guix packages)
47 #:use-module (guix utils)
f9d32883 48 #:use-module (gnu packages)
0f7b8a7f 49 #:use-module (gnu packages astronomy)
7b1fb40d 50 #:use-module (gnu packages audio)
ed72a133 51 #:use-module (gnu packages autotools)
7b1fb40d 52 #:use-module (gnu packages backup)
f2b005f6 53 #:use-module (gnu packages boost)
f25e1e24 54 #:use-module (gnu packages check)
1a39141d 55 #:use-module (gnu packages compression)
7b1fb40d 56 #:use-module (gnu packages curl)
f2b005f6 57 #:use-module (gnu packages databases)
889e94e3
JL
58 #:use-module (gnu packages datastructures)
59 #:use-module (gnu packages documentation)
7b1fb40d 60 #:use-module (gnu packages elf)
0f7b8a7f 61 #:use-module (gnu packages fonts)
f2b005f6 62 #:use-module (gnu packages fontutils)
7b1fb40d
GLV
63 #:use-module (gnu packages gettext)
64 #:use-module (gnu packages gl)
03c1662e
LF
65 #:use-module (gnu packages glib)
66 #:use-module (gnu packages gnome)
67 #:use-module (gnu packages gtk)
1a39141d 68 #:use-module (gnu packages image)
f2b005f6 69 #:use-module (gnu packages icu4c)
f041db86 70 #:use-module (gnu packages java)
b0e2299a 71 #:use-module (gnu packages lua)
6cde0737 72 #:use-module (gnu packages maths)
996e45cb 73 #:use-module (gnu packages pcre)
2b9be1a6 74 #:use-module (gnu packages perl)
7b1fb40d 75 #:use-module (gnu packages photo)
03c1662e 76 #:use-module (gnu packages pkg-config)
dc8621a2 77 #:use-module (gnu packages protobuf)
7b1fb40d 78 #:use-module (gnu packages pulseaudio)
f2b005f6 79 #:use-module (gnu packages python)
0a71e34e 80 #:use-module (gnu packages python-web)
44d10b1f 81 #:use-module (gnu packages python-xyz)
0f7b8a7f 82 #:use-module (gnu packages qt)
cd0322a3 83 #:use-module (gnu packages sqlite)
5b19776e 84 #:use-module (gnu packages web)
03c1662e 85 #:use-module (gnu packages webkit)
a2a53274 86 #:use-module (gnu packages wxwidgets)
03c1662e
LF
87 #:use-module (gnu packages xml))
88
a7607572
BH
89(define-public geos
90 (package
91 (name "geos")
d33afa26 92 (version "3.8.0")
a7607572
BH
93 (source (origin
94 (method url-fetch)
95 (uri (string-append "http://download.osgeo.org/geos/geos-"
96 version
97 ".tar.bz2"))
98 (sha256
99 (base32
d33afa26 100 "1mb2v9fy1gnbjhcgv0xny11ggfb17vkzsajdyibigwsxr4ylq4cr"))))
a7607572
BH
101 (build-system gnu-build-system)
102 (arguments `(#:phases
103 (modify-phases %standard-phases
104 (add-after
105 'unpack 'patch-test-shebangs
106 (lambda _
107 (substitute* '("tests/xmltester/testrunner.sh"
108 "tests/geostest/testrunner.sh")
109 (("/bin/sh") (which "sh")))
110 #t)))))
111 (inputs
112 `(("glib" ,glib)))
113 (home-page "https://geos.osgeo.org/")
114 (synopsis "Geometry Engine for Geographic Information Systems")
115 (description
116 "GEOS provides a spatial object model and fundamental geometric
117functions. It is a C++ port of the Java Topology Suite (JTS). As such,
118it aims to contain the complete functionality of JTS in C++. This
119includes all the OpenGIS Simple Features for SQL spatial predicate
120functions and spatial operators, as well as specific JTS enhanced
121topology functions.")
122 (license (list license:lgpl2.1+ ; Main distribution.
123 license:zlib ; tests/xmltester/tinyxml/*
124 license:public-domain)))) ; include/geos/timeval.h
125
03c1662e
LF
126(define-public gnome-maps
127 (package
128 (name "gnome-maps")
62f0e9bd 129 (version "3.32.2.1")
03c1662e
LF
130 (source (origin
131 (method url-fetch)
132 (uri (string-append "mirror://gnome/sources/" name "/"
133 (version-major+minor version) "/"
134 name "-" version ".tar.xz"))
135 (sha256
136 (base32
62f0e9bd 137 "1m191iq1gjaqz79ci3dkbmwrkxp7pzknngimlf5bqib5x8yairlb"))))
5339d2bb 138 (build-system meson-build-system)
03c1662e 139 (arguments
5339d2bb 140 `(#:glib-or-gtk? #t
03c1662e
LF
141 #:phases
142 (modify-phases %standard-phases
b0a7c0c3
EF
143 (add-after 'unpack 'skip-gtk-update-icon-cache
144 ;; Don't create 'icon-theme.cache'.
145 (lambda _
146 (substitute* "meson_post_install.py"
147 (("gtk-update-icon-cache") "true"))
148 #t))
67bd376b
KK
149 (add-after 'install 'wrap
150 (lambda* (#:key inputs outputs #:allow-other-keys)
151 (let ((out (assoc-ref outputs "out"))
152 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
5339d2bb
RW
153 (geocode-glib-path (string-append
154 (assoc-ref inputs "geocode-glib")
155 "/lib"))
67bd376b 156 (goa-path (string-append
2cf1e37c 157 (assoc-ref inputs "gnome-online-accounts:lib")
67bd376b 158 "/lib"))
2cf1e37c
KK
159 (gdk-pixbuf-path (string-append
160 (assoc-ref inputs "gdk-pixbuf")
161 "/lib"))
67bd376b
KK
162 (webkitgtk-path (string-append
163 (assoc-ref inputs "webkitgtk")
164 "/lib")))
165 (wrap-program (string-append out "/bin/gnome-maps")
166 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
03c1662e 167
67bd376b 168 ;; There seems to be no way to embed the path of
5339d2bb 169 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37,
2cf1e37c
KK
170 ;; libgdk_pixbuf-2.0.so, libjavascriptcoregtk-4.0.so.18, and
171 ;; libgeocode-glib.so.0
5339d2bb
RW
172 `("LD_LIBRARY_PATH" ":" prefix (,goa-path
173 ,webkitgtk-path
2cf1e37c 174 ,gdk-pixbuf-path
5339d2bb 175 ,geocode-glib-path)))
67bd376b 176 #t))))))
03c1662e 177 (native-inputs
b0a7c0c3 178 `(("gobject-introspection" ,gobject-introspection)
03c1662e
LF
179 ("intltool" ,intltool)
180 ("pkg-config" ,pkg-config)))
181 (inputs
182 `(("folks" ,folks)
183 ("libchamplain" ,libchamplain)
184 ("libgee" ,libgee)
8d26f48e
RW
185 ("libsecret" ,libsecret)
186 ("libsoup" ,libsoup)
187 ("libgweather" ,libgweather)
03c1662e 188 ("libxml2" ,libxml2)
2cf1e37c 189 ("gdk-pixbuf" ,gdk-pixbuf+svg)
8d26f48e 190 ("glib-networking" ,glib-networking)
03c1662e
LF
191 ("geoclue" ,geoclue)
192 ("geocode-glib" ,geocode-glib)
193 ("gfbgraph" ,gfbgraph)
194 ("gjs" ,gjs)
195 ("glib" ,glib)
2cf1e37c 196 ("gnome-online-accounts:lib" ,gnome-online-accounts "lib")
8d26f48e 197 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
03c1662e
LF
198 ("rest" ,rest)
199 ("webkitgtk" ,webkitgtk)))
200 (propagated-inputs
201 `(("gtk+3" ,gtk+)))
202 (synopsis "Graphical map viewer and wayfinding program")
203 (description "GNOME Maps is a graphical map viewer. It uses map data from
204the OpenStreetMap project. It can provide directions for walking, bicycling,
205and driving.")
206 (home-page "https://wiki.gnome.org/Apps/Maps")
065d0125
BH
207 (license license:gpl2+)))
208
22c7c775
BH
209(define-public libgaiagraphics
210 (package
211 (name "libgaiagraphics")
212 (version "0.5")
213 (source
214 (origin
215 (method url-fetch)
216 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
217 version ".tar.gz"))
218 (sha256
219 (base32
220 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
221 (build-system gnu-build-system)
222 (native-inputs
223 `(("pkg-config" ,pkg-config)))
224 (inputs
225 `(("cairo" ,cairo)
226 ("libpng" ,libpng)
56e53392 227 ("libjpeg-turbo" ,libjpeg-turbo)
22c7c775
BH
228 ("libtiff" ,libtiff)
229 ("libgeotiff" ,libgeotiff)
230 ("proj.4" ,proj.4)
231 ("libxml2" ,libxml2)
232 ("zlib" ,zlib)))
233 (synopsis "Gaia common graphics support")
234 (description "libgaiagraphics is a library supporting
235 common-utility raster handling methods.")
236 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
237 (license license:lgpl3+)))
238
1a39141d
BH
239(define-public libgeotiff
240 (package
241 (name "libgeotiff")
f9d32883 242 (version "1.5.1")
1a39141d
BH
243 (source
244 (origin
245 (method url-fetch)
246 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
247 version ".tar.gz"))
f9d32883
AI
248 (patches (search-patches
249 ;; See libgeotiff 1.5.1 issue
250 ;; https://github.com/OSGeo/libgeotiff/issues/22
251 "libgeotiff-adapt-test-script-for-proj-6.2.patch"))
1a39141d 252 (sha256
f9d32883 253 (base32 "0b31mlzcv5b1y7jdvb7p0pa3xradrg3x5g32ym911lbhq4rrgsgr"))
1a39141d
BH
254 (modules '((guix build utils)))
255 (snippet
256 '(begin
257 ;; Remove .csv files, distributed from EPSG under a restricted
258 ;; license. See LICENSE for full license text.
259 (for-each delete-file (find-files "." "\\.csv$"))
6cbee49d 260 #t))))
1a39141d
BH
261 (build-system gnu-build-system)
262 (inputs
263 `(("libjpeg-turbo" ,libjpeg-turbo)
264 ("libtiff" ,libtiff)
1a39141d 265 ("zlib" ,zlib)))
517c5538
MB
266 (propagated-inputs
267 `(;; libgeotiff headers include proj headers, so ensure those are available.
268 ("proj" ,proj)))
1a39141d
BH
269 (arguments
270 `(#:configure-flags
1ecadbfe
MB
271 (list "--disable-static"
272 "--with-zlib" "--with-jpeg"
1a39141d
BH
273 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
274 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
275 (description "libgeotiff is a library on top of libtiff for reading and
276writing GeoTIFF information tags.")
277 (home-page "https://trac.osgeo.org/geotiff/")
278 ;; This is a mixture of various contributions under different licenses.
279 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
280 ;; states, as its commercial redistribution is restricted. Hence, we have
281 ;; removed it from the package.
282 (license (list license:public-domain
283 license:x11
284 license:bsd-3
285 (license:non-copyleft "file://LICENSE"
286 "See LICENSE in the distribution.")))))
287
f6c507e1
BH
288(define-public libspatialite
289 (package
290 (name "libspatialite")
291 (version "4.3.0a")
292 (source
293 (origin
294 (method url-fetch)
295 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
296 version ".tar.gz"))
297 (sha256
298 (base32
299 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
300 (build-system gnu-build-system)
301 (native-inputs
302 `(("pkg-config" ,pkg-config)))
303 (inputs
304 `(("freexl" ,freexl)
305 ("geos" ,geos)
306 ("libxml2" ,libxml2)
307 ("proj.4" ,proj.4)
308 ("sqlite" ,sqlite)
309 ("zlib" ,zlib)))
310 (arguments
311 `(#:phases
312 (modify-phases %standard-phases
313 ;; 3 tests are failing, ignore them:
314 (add-after 'unpack 'ignore-broken-tests
315 (lambda _
316 (substitute* '("test/Makefile.in")
317 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
318 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
319 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
320 #t)))))
321 (synopsis "Extend SQLite to support Spatial SQL capabilities")
322 (description
323 "SpatiaLite is a library intended to extend the SQLite core to support
324fully fledged Spatial SQL capabilities.")
325 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
326 ;; For the genuine libspatialite-sources holds:
327 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
328 ;; Files under src/control_points are from GRASS
329 ;; and are licensed under GPL2+ only.
330 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
331 (license (list license:gpl2+
332 license:lgpl2.1+
333 license:mpl1.1
334 license:public-domain))))
335
3500d7ad
AI
336(define-public proj
337 (package
338 (name "proj")
9147d121 339 (version "6.3.1")
3500d7ad
AI
340 (source
341 (origin
342 (method url-fetch)
343 (uri (string-append "http://download.osgeo.org/proj/proj-"
344 version ".tar.gz"))
345 (sha256
346 (base32
9147d121 347 "1y46ij32j9b4x1kjnnlykcwk3kkjwkg44sfc1ziwm3a3g0ki3q3d"))))
3500d7ad
AI
348 (build-system gnu-build-system)
349 (inputs
350 `(("sqlite" ,sqlite)))
351 (native-inputs
352 `(("pkg-config" ,pkg-config)))
353 (home-page "https://proj.org/")
354 (synopsis "Coordinate transformation software")
355 (description
356 "Proj is a generic coordinate transformation software that transforms
357geospatial coordinates from one coordinate reference system (CRS) to another.
358This includes cartographic projections as well as geodetic transformations.
359PROJ includes command line applications for easy conversion of coordinates
360from text files or directly from user input. In addition, proj also exposes
361an application programming interface that lets developers use the
362functionality of proj in their own software.")
363 (license (list license:expat
364 ;; src/projections/patterson.cpp
365 license:asl2.0
366 ;; src/geodesic.*, src/tests/geodtest.cpp
367 license:x11))))
368
065d0125
BH
369(define-public proj.4
370 (package
371 (name "proj.4")
372 (version "4.9.3")
373 (source (origin
374 (method url-fetch)
375 (uri (string-append "http://download.osgeo.org/proj/proj-"
376 version ".tar.gz"))
377 (sha256
378 (base32
379 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
380 (build-system gnu-build-system)
381 (arguments
382 `(#:phases
383 (modify-phases %standard-phases
384 (add-after 'unpack 'patch-test-paths
385 (lambda _
386 (substitute* '("nad/test27"
387 "nad/test83"
388 "nad/testvarious"
389 "nad/testdatumfile"
390 "nad/testflaky"
391 "nad/testIGNF")
392 (("/bin/rm") (which "rm")))
393 #t))
394 ;; Precision problems on i686 and other platforms. See:
395 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
396 ;; Disable failing test.
397 (add-after 'patch-test-paths 'ignore-failing-tests
398 (lambda _
399 (substitute* '("nad/Makefile.in")
400 (("\tPROJ_LIB.*" all) (string-append "#" all)))
401 #t)))))
402 (inputs
403 `(("glib" ,glib)))
3fbb7bec 404 (home-page "https://proj.org/")
065d0125
BH
405 (synopsis "Cartographic Projections Library")
406 (description
407 "Proj.4 is a library for converting coordinates between cartographic
408projections.")
409 (license (list license:expat
410 ;; src/PJ_patterson.c
411 license:asl2.0
412 ;; src/geodesic.c/h
413 license:x11
414 ;; Embedded EPSG database.
415 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
416 ;; cmake/*
417 license:boost1.0))))
f2b005f6
AI
418
419(define-public mapnik
420 (package
421 (name "mapnik")
422 (version "3.0.18")
423 (source
424 (origin
425 (method url-fetch)
426 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
427 version "/mapnik-v" version ".tar.bz2"))
428 (sha256
429 (base32
430 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
431 (build-system scons-build-system)
432 (inputs
433 `(("boost" ,boost)
434 ("cairo" ,cairo)
435 ("freetype" ,freetype)
436 ("harfbuzz" ,harfbuzz)
437 ("icu4c" ,icu4c)
438 ("libjpeg-turbo" ,libjpeg-turbo)
439 ("libpng" ,libpng)
440 ("libtiff" ,libtiff)
441 ("libwebp" ,libwebp)
442 ("libxml2" ,libxml2)
443 ("proj.4" ,proj.4)
444 ("sqlite" ,sqlite)
445 ("zlib" ,zlib)))
446 (native-inputs
447 `(("pkg-config" ,pkg-config)))
448 (arguments
449 `(#:scons ,scons-python2
450 #:scons-flags
451 (list "CC=gcc"
452 (string-append "PREFIX=" %output)
453 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
711ebe77 454 (home-page "https://mapnik.org/")
f2b005f6
AI
455 (synopsis "Toolkit for developing mapping applications")
456 (description "Mapnik is a toolkit for developing mapping applications. It
457is basically a collection of geographic objects like maps, layers,
458datasources, features, and geometries. At its core is a C++ shared library
459providing algorithms and patterns for spatial data access and visualization.
460The library does not rely on any specific windowing system and can be deployed
461to any server environment. It is intended to play fair in a multi-threaded
462environment and is aimed primarily, but not exclusively, at web-based
463development.")
464 (license (list license:lgpl2.1+
465 ;; demo/viewer, demo/python/rundemo.py
466 license:gpl2+
467 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
468 license:boost1.0
469 ;; deps/mapnik/sparsehash
470 license:bsd-3
471 ;; deps/agg
472 (license:non-copyleft "file://deps/agg/copying")))))
473
f25e1e24
AI
474(define-public python2-mapnik
475 (package
476 (name "python2-mapnik")
477 (version "3.0.16")
478 (source
479 (origin
480 (method url-fetch)
481 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
482 version ".tar.gz"))
483 (file-name (string-append name "-" version ".tar.gz"))
484 (sha256
485 (base32
486 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
487 (build-system python-build-system)
488 (inputs
489 `(("boost" ,boost)
490 ("harfbuzz" ,harfbuzz)
491 ("icu4c" ,icu4c)
492 ("libjpeg-turbo" ,libjpeg-turbo)
493 ("libpng" ,libpng)
494 ("libtiff" ,libtiff)
495 ("libwebp" ,libwebp)
496 ("mapnik" ,mapnik)
497 ("proj.4" ,proj.4)
498 ("python2-pycairo" ,python2-pycairo)))
499 (native-inputs
500 (let ((test-data-input
501 (lambda (repository version hash)
502 (origin
503 (method url-fetch)
504 (uri (string-append "https://github.com/mapnik/" repository
505 "/archive/v" version ".tar.gz"))
506 (file-name (string-append "python-mapnik-" repository
507 "-" version ".tar.gz"))
508 (sha256 (base32 hash))))))
509 `(("python2-nose" ,python2-nose)
510 ;; Test data is released as separate tarballs
511 ("test-data"
512 ,(test-data-input "test-data" "3.0.18"
513 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
514 ("test-data-visual"
515 ,(test-data-input "test-data-visual" "3.0.18"
516 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
517 (arguments
518 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
519 #:phases
520 (modify-phases %standard-phases
521 ;; Unpack test data into the source tree
522 (add-after 'unpack 'unpack-submodules
523 (lambda* (#:key inputs #:allow-other-keys)
524 (let ((unpack (lambda (source target)
525 (with-directory-excursion target
526 (invoke "tar" "xvf" (assoc-ref inputs source)
527 "--strip-components=1")))))
528 (unpack "test-data" "test/data")
529 (unpack "test-data-visual" "test/data-visual"))))
530 ;; Skip failing tests
531 (add-after 'unpack 'skip-tests
532 (lambda _
533 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
534 "test_unicode_regex_replace"
535 "test_proj_antimeridian_bbox"
536 "test_render_with_scale_factor")))
537 (substitute* "setup.cfg"
538 (("\\[nosetests\\]" all)
539 (string-append all "\nexclude=^("
540 (string-join skipped-tests "|") ")$")))))))))
541 (home-page "https://github.com/mapnik/python-mapnik")
542 (synopsis "Python bindings for Mapnik")
543 (description "This package provides Python bindings for Mapnik.")
544 (license license:lgpl2.1+)))
a2a53274
BH
545
546(define-public spatialite-gui
547 (package
548 (name "spatialite-gui")
549 (version "1.7.1")
550 (source
551 (origin
552 (method url-fetch)
553 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
554 version ".tar.gz"))
555 (sha256
556 (base32
557 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
558 (build-system gnu-build-system)
559 (native-inputs
560 `(("pkg-config" ,pkg-config)))
561 (inputs
562 `(("freexl" ,freexl)
563 ("geos" ,geos)
564 ("libgaiagraphics" ,libgaiagraphics)
e8906d86 565 ("libjpeg-turbo" ,libjpeg-turbo)
a2a53274
BH
566 ("libspatialite" ,libspatialite)
567 ("libxml2" ,libxml2)
568 ("proj.4" ,proj.4)
569 ("sqlite" ,sqlite)
570 ("wxwidgets" ,wxwidgets-2)
571 ("zlib" ,zlib)))
f7f67495
GLV
572 (arguments
573 `(#:phases (modify-phases %standard-phases
574 (add-after 'unpack 'fix-gui
575 (lambda _
576 ;; Fix for the GUI not showing up.
577 (substitute* "Main.cpp"
578 (("Hide\\(\\);") ""))
579 #t)))))
a2a53274
BH
580 (synopsis "Graphical user interface for SpatiaLite")
581 (description "Spatialite-gui provides a visual interface for viewing and
582 maintaining a spatialite database. You can easily see the structure of the
583 tables and data contents using point and click functions, many of which
584 construct common SQL queries, or craft your own SQL queries.")
585 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
586 (license license:gpl3+)))
3d60f426 587
996e45cb
JL
588(define-public gdal
589 (package
590 (name "gdal")
3cf0a5dc 591 (version "3.0.4")
996e45cb
JL
592 (source (origin
593 (method url-fetch)
594 (uri (string-append
595 "http://download.osgeo.org/gdal/" version "/gdal-"
596 version ".tar.gz"))
597 (sha256
598 (base32
3cf0a5dc 599 "10symyajj1b7j98f889lqxxbmhcyvlhq9gg0l42h69bv22wx45gw"))
996e45cb
JL
600 (modules '((guix build utils)))
601 (snippet
602 `(begin
603 ;; TODO: frmts contains a lot more bundled code.
604 (for-each delete-file-recursively
605 ;; bundled code
606 '("frmts/png/libpng"
607 "frmts/gif/giflib"
608 "frmts/jpeg/libjpeg"
609 "frmts/jpeg/libjpeg12"
610 "frmts/gtiff/libtiff"
611 "frmts/gtiff/libgeotiff"
612 "frmts/zlib"
613 "ogr/ogrsf_frmts/geojson/libjson"))))))
614 (build-system gnu-build-system)
615 (arguments
616 `(#:tests? #f
617 #:configure-flags
618 (let-syntax ((with (syntax-rules ()
619 ((_ option input)
620 (string-append option "="
621 (assoc-ref %build-inputs input))))))
622 (list
623 ;; TODO: --with-pcidsk, --with-pcraster
624 (with "--with-freexl" "freexl")
625 (with "--with-libjson-c" "json-c")
626 (with "--with-png" "libpng")
627 (with "--with-webp" "libwebp")
628 (with "--with-gif" "giflib")
109f022e 629 (with "--with-jpeg" "libjpeg-turbo")
996e45cb
JL
630 (with "--with-libtiff" "libtiff")
631 (with "--with-geotiff" "libgeotiff")
632 (with "--with-libz" "zlib")
0f054356 633 (with "--with-expat" "expat")
838db4fc 634 (with "--with-sqlite3" "sqlite")
996e45cb
JL
635 "--with-pcre"))
636 #:phases
637 (modify-phases %standard-phases
638 (add-before 'build 'fix-path
639 (lambda _
640 (substitute* "frmts/mrf/mrf_band.cpp"
641 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
642 (inputs
0f054356
AI
643 `(("expat" ,expat)
644 ("freexl" ,freexl)
996e45cb
JL
645 ("geos" ,geos)
646 ("giflib" ,giflib)
647 ("json-c" ,json-c)
648 ("libgeotiff" ,libgeotiff)
649 ("libjpeg-turbo" ,libjpeg-turbo)
650 ("libpng" ,libpng)
651 ("libtiff" ,libtiff)
652 ("libwebp" ,libwebp)
6cde0737 653 ("netcdf" ,netcdf)
996e45cb 654 ("pcre" ,pcre)
e72557c0 655 ("proj" ,proj)
838db4fc 656 ("sqlite" ,sqlite)
996e45cb 657 ("zlib" ,zlib)))
e7453b3c 658 (home-page "https://gdal.org/")
996e45cb
JL
659 (synopsis "Raster and vector geospatial data format library")
660 (description "GDAL is a translator library for raster and vector geospatial
661data formats. As a library, it presents a single raster abstract data model
662and single vector abstract data model to the calling application for all
663supported formats. It also comes with a variety of useful command line
664utilities for data translation and processing.")
665 (license (list
666 ;; general license
667 license:expat
668 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
669 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
670 ;; frmts/mrf/
671 license:bsd-3
672 ;; frmts/hdf4/hdf-eos/*
673 ;; similar to the expat license, but without guarantee exclusion
674 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
675 ;; frmts/grib/degrib/
676 license:public-domain ; with guarantee exclusion
677 ;; port/cpl_minizip*
678 ;; Some bsd-inspired license
679 (license:non-copyleft "file://port/LICENCE_minizip")
680 ;; alg/internal_libqhull
681 ;; Some 5-clause license
682 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
683 ;; frmts/mrf/libLERC
684 license:asl2.0))))
2b9be1a6 685
a18a27be
SB
686(define-public python-gdal
687 (package (inherit gdal)
688 (name "python-gdal")
689 (build-system python-build-system)
690 (arguments
691 '(#:tests? #f ; no tests
692 #:phases
693 (modify-phases %standard-phases
694 (add-before 'build 'chdir
695 (lambda _
696 (chdir "swig/python")
697 #t)))))
698 (native-inputs '())
699 (propagated-inputs
700 `(("python-numpy" ,python-numpy)))
701 (inputs
702 `(("gdal" ,gdal)))
703 (synopsis "GDAL (Geospatial Data Abstraction Library) python bindings")))
704
2b9be1a6
JL
705(define-public postgis
706 (package
707 (name "postgis")
75e2c054 708 (version "3.0.0")
2b9be1a6
JL
709 (source (origin
710 (method url-fetch)
711 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
712 version ".tar.gz"))
713 (sha256
714 (base32
75e2c054 715 "15557fbk0xkngihwhqsbdyz2ng49blisf5zydw81j0gabk6x4vy0"))))
2b9be1a6
JL
716 (build-system gnu-build-system)
717 (arguments
718 `(#:tests? #f
719 #:make-flags
720 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
721 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
722 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
723 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
724 #:phases
725 (modify-phases %standard-phases
726 (add-before 'build 'fix-install-path
727 (lambda* (#:key outputs #:allow-other-keys)
728 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
729 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
730 (string-append (assoc-ref outputs "out") "/bin"))))))))
731 (inputs
732 `(("gdal" ,gdal)
733 ("geos" ,geos)
75e2c054
AI
734 ("json-c" ,json-c)
735 ("libjpeg" ,libjpeg-turbo)
2b9be1a6
JL
736 ("libxml2" ,libxml2)
737 ("pcre" ,pcre)
738 ("postgresql" ,postgresql)
75e2c054 739 ("proj" ,proj)))
2b9be1a6
JL
740 (native-inputs
741 `(("perl" ,perl)
742 ("pkg-config" ,pkg-config)))
743 (home-page "https://postgis.net")
744 (synopsis "Spatial database extender for PostgreSQL")
745 (description "PostGIS is a spatial database extender for PostgreSQL
746object-relational database. It adds support for geographic objects allowing
8e3f06c9
JL
747location queries to be run in SQL. This package provides a PostgreSQL
748extension.")
2b9be1a6
JL
749 (license (list
750 ;; General license
751 license:gpl2+
752 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
753 license:expat
754 ;; loader/getopt.*
755 license:public-domain
756 ;; doc/xsl
757 license:bsd-3 ; files only say "BSD"
758 ;; doc
759 license:cc-by-sa3.0))))
be7c64ba
JL
760
761(define-public tegola
762 (package
763 (name "tegola")
764 (version "0.7.0")
765 (source (origin
766 (method url-fetch)
767 (uri (string-append
768 "https://github.com/go-spatial/tegola/archive/v"
769 version ".tar.gz"))
770 (file-name (string-append name "-" version ".tar.gz"))
771 (sha256
772 (base32
773 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
774 (build-system go-build-system)
775 (arguments
776 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
d9ef50b3 777 #:unpack-path "github.com/go-spatial/tegola"
be7c64ba
JL
778 #:phases
779 (modify-phases %standard-phases
780 (add-before 'build 'set-version
781 (lambda _
d9ef50b3 782 (with-directory-excursion "src/github.com/go-spatial/tegola"
be7c64ba
JL
783 (substitute* '("cmd/tegola/cmd/root.go"
784 "cmd/tegola_lambda/main.go")
785 (("version not set") ,version)))
be7c64ba 786 #t)))))
0d49a4bb 787 (home-page "https://tegola.io")
be7c64ba
JL
788 (synopsis "Vector tile server for maps")
789 (description "Tegola is a free vector tile server written in Go. Tegola
790takes geospatial data and slices it into vector tiles that can be efficiently
791delivered to any client.")
792 (license (list
793 license:expat
794 ;; Some packages in vendor have other licenses
795 license:asl2.0
796 license:bsd-2
797 license:bsd-3
798 license:wtfpl2))))
3bd7611e
JL
799
800(define-public imposm3
801 (package
802 (name "imposm3")
803 (version "0.6.0-alpha.4")
804 (source
805 (origin
806 (method url-fetch)
807 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
808 version ".tar.gz"))
809 (file-name (string-append name "-" version ".tar.gz"))
810 (sha256
811 (base32
812 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
813 (build-system go-build-system)
814 (arguments
815 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
bdc0c20c 816 #:unpack-path "github.com/omniscale/imposm3"
3bd7611e
JL
817 #:phases
818 (modify-phases %standard-phases
3bd7611e
JL
819 (add-before 'build 'set-version
820 (lambda _
821 (substitute* "src/github.com/omniscale/imposm3/version.go"
822 (("0.0.0-dev") ,version))
823 #t)))))
824 (inputs
825 `(("geos" ,geos)
826 ("leveldb" ,leveldb)))
827 (home-page "https://imposm.org/")
828 (synopsis "OpenStreetMap importer for PostGIS")
829 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
830files and imports the data into PostgreSQL/PostGIS databases. It is designed
831to create databases that are optimized for rendering/tile/map-services.")
832 (license (list
833 license:asl2.0
834 ;; Some dependencies in vendor have different licenses
835 license:expat
836 license:bsd-2
837 license:bsd-3))))
8fa3451c 838
889e94e3
JL
839(define-public libosmium
840 (package
841 (name "libosmium")
842 (version "2.14.2")
843 (source
f4daf250
TGR
844 (origin
845 (method git-fetch)
846 (uri (git-reference
847 (url "https://github.com/osmcode/libosmium.git")
848 (commit (string-append "v" version))))
849 (file-name (git-file-name name version))
850 (sha256
851 (base32 "123ri1l0a2b9fljgpwsl7z2w4i3kmgxz79d4ns9z4mwbp8sw0250"))))
889e94e3
JL
852 (build-system cmake-build-system)
853 (propagated-inputs
854 `(("boost" ,boost)
855 ("expat" ,expat)
856 ("gdal" ,gdal)
857 ("geos" ,geos)
858 ("proj.4" ,proj.4)
859 ("protozero" ,protozero)
860 ("sparsehash" ,sparsehash)
861 ("zlib" ,zlib)))
862 (native-inputs
863 `(("doxygen" ,doxygen)))
864 (home-page "https://osmcode.org/libosmium/")
865 (synopsis "C++ library for working with OpenStreetMap data")
866 (description "Libosmium is a fast and flexible C++ library for working with
867OpenStreetMap data.")
868 (license license:boost1.0)))
b0e2299a
JL
869
870(define-public osm2pgsql
871 (package
872 (name "osm2pgsql")
873 (version "0.96.0")
82b47fd9
TGR
874 (source
875 (origin
876 (method git-fetch)
877 (uri (git-reference
878 (url "https://github.com/openstreetmap/osm2pgsql.git")
879 (commit version)))
880 (file-name (git-file-name name version))
881 (sha256
882 (base32 "032cydh8ynaqfhdzmkvgbmqyjql668y6qln1l59l2s3ni9963bbl"))
883 (modules '((guix build utils)))
884 (snippet
885 '(begin
886 (delete-file-recursively "contrib/protozero")
887 (delete-file-recursively "contrib/libosmium")
888 #t))))
b0e2299a
JL
889 (build-system cmake-build-system)
890 (arguments
891 `(#:tests? #f; tests fail because we need to setup a database
892 #:configure-flags
893 (list (string-append "-DOSMIUM_INCLUDE_DIR="
894 (assoc-ref %build-inputs "libosmium")
895 "/include")
896 (string-append "-DPROTOZERO_INCLUDE_DIR="
897 (assoc-ref %build-inputs "protozero")
898 "/include"))))
899 (inputs
900 `(("boost" ,boost)
901 ("expat" ,expat)
902 ("libosmium" ,libosmium)
903 ("lua" ,lua)
904 ("postgresql" ,postgresql)
905 ("proj.4" ,proj.4)
906 ("protozero" ,protozero)
907 ("zlib" ,zlib)))
908 (native-inputs
909 `(("python-2" ,python-2)
910 ("python2-psycopg2" ,python2-psycopg2)))
911 (home-page "https://github.com/openstreetmap/osm2pgsql")
912 (synopsis "OSM data importer to postgresql")
913 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
914PostgreSQL / PostGIS database suitable for applications like rendering into a
915map, geocoding with Nominatim, or general analysis.")
916 (license license:gpl2+)))
6f91223f
JL
917
918(define-public tippecanoe
919 (package
920 (name "tippecanoe")
921 (version "1.31.5")
8f33d05e
TGR
922 (source
923 (origin
924 (method git-fetch)
925 (uri (git-reference
926 (url "https://github.com/mapbox/tippecanoe.git")
927 (commit version)))
928 (file-name (git-file-name name version))
929 (sha256
930 (base32 "1m0x931a945sr7axyhcvpwh798m58hx1zxh6ikgf9gsgqhdhmszz"))))
6f91223f
JL
931 (build-system gnu-build-system)
932 (arguments
933 `(#:phases
934 (modify-phases %standard-phases (delete 'configure))
935 #:test-target "test"
936 #:make-flags
937 (list "CC=gcc"
938 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
939 (inputs
940 `(("perl" ,perl)
941 ("sqlite" ,sqlite)
942 ("zlib" ,zlib)))
943 (home-page "https://github.com/mapbox/tippecanoe")
944 (synopsis "Vector tile server for maps")
945 (description "Tippecanoe creates scale-independent view of data, so that
946the texture and density of features is visible at every zoom level, instead of
947dropping features at lower levels.")
948 (license license:bsd-2)))
ed72a133
GLV
949
950(define-public osmctools
951 (package
952 (name "osmctools")
953 (version "0.9")
954 (source
955 (origin
956 (method git-fetch)
957 (uri (git-reference
958 (url "https://gitlab.com/osm-c-tools/osmctools")
959 (commit version)))
960 (file-name (git-file-name name version))
961 (sha256
962 (base32
963 "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
964 (build-system gnu-build-system)
965 (native-inputs
966 `(("autoconf" ,autoconf)
967 ("automake" ,automake)))
968 (inputs
969 `(("zlib" ,zlib)))
970 (home-page "https://gitlab.com/osm-c-tools/osmctools")
971 (synopsis "Tools to convert, filter and update OpenStreetMap data files")
972 (description "This project contains a few tools which are used in the
973OpenStreetMap project. They can be used to convert, filter and update
974OpenStreetMap data files.")
975 (license license:agpl3)))
ee34be73
GLV
976
977(define-public osm-gps-map
978 (package
979 (name "osm-gps-map")
980 (version "1.1.0")
981 (source
982 (origin
983 (method url-fetch)
984 (uri (string-append
985 "https://github.com/nzjrs/osm-gps-map/releases/download/"
986 version "/osm-gps-map-" version ".tar.gz"))
987 (sha256
988 (base32
989 "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
990 (build-system gnu-build-system)
991 (native-inputs
992 `(("gnome-common" ,gnome-common)
993 ("gtk-doc" ,gtk-doc)
994 ("pkg-config" ,pkg-config)))
995 (inputs
996 `(("cairo" ,cairo)
997 ("glib" ,glib)
998 ("gobject-introspection" ,gobject-introspection)
999 ("gtk+" ,gtk+)
1000 ("libsoup" ,libsoup)))
1001 (home-page "https://nzjrs.github.io/osm-gps-map/")
1002 (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
1003 (description
1004 "This package provides a GTK+ widget (and Python bindings) that when
1005given GPS coordinates,draws a GPS track, and points of interest on a moving
1006map display. Downloads map data from a number of websites, including
1007@url{https://www.openstreetmap.org}.")
1008 (license license:gpl2+)))
0f7b8a7f
EF
1009
1010(define-public xygrib
1011 (package
1012 (name "xygrib")
29bdabb6 1013 (version "1.2.6.1")
0f7b8a7f
EF
1014 (source (origin
1015 (method git-fetch)
1016 (uri (git-reference
1017 (url "https://github.com/opengribs/XyGrib.git")
1018 (commit (string-append "v" version))))
1019 (file-name (git-file-name name version))
1020 (sha256
1021 (base32
29bdabb6 1022 "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
0f7b8a7f
EF
1023 (modules '((guix build utils)))
1024 (snippet
1025 '(begin (delete-file-recursively "data/fonts") #t))))
1026 (build-system cmake-build-system)
1027 (arguments
1028 `(#:phases
1029 (modify-phases %standard-phases
1030 (add-after 'unpack 'patch-directories
1031 (lambda* (#:key inputs #:allow-other-keys)
1032 (let ((jpeg (assoc-ref inputs "openjpeg"))
1033 (font (assoc-ref inputs "font-liberation")))
1034 (substitute* "CMakeLists.txt"
1035 ;; Find libjpeg.
1036 (("/usr") jpeg)
1037 ;; Fix install locations.
1038 (("set\\(PREFIX_BIN.*") "set(PREFIX_BIN \"bin\")\n")
1039 (("set\\(PREFIX_PKGDATA.*") "set(PREFIX_PKGDATA \"share/${PROJECT_NAME}\")\n")
1040 ;; Skip looking for the static library.
1041 (("\"libnova.a\"") ""))
1042 ;; Don't use the bundled font-liberation.
1043 (substitute* "src/util/Font.cpp"
1044 (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
1045 (string-append "\"" font "/share/fonts/truetype/\"")))
1046 (substitute* "src/util/Util.h"
1047 (("pathData\\(\\)\\+\"data/fonts/\"")
1048 (string-append "\"" font "/share/fonts/\""))))
1049 #t)))
1050 #:tests? #f)) ; no tests
1051 (native-inputs
1052 `(("qttools" ,qttools)))
1053 (inputs
1054 `(("bzip2" ,bzip2)
1055 ("font-liberation" ,font-liberation)
1056 ("libnova" ,libnova)
1057 ("libpng" ,libpng)
1058 ("openjpeg" ,openjpeg)
1059 ("proj.4" ,proj.4)
1060 ("qtbase" ,qtbase)
1061 ("zlib" ,zlib)))
1062 (synopsis "Weather Forecast Visualization")
1063 (description
1064 "XyGrib is a Grib file reader and visualizes meteorological data providing
1065an off-line capability to analyse weather forecasts or hindcasts. It is
1066intended to be used as a capable weather work station for anyone with a serious
1067interest in examining weather. This would include members of the sailing
1068community, private and sport aviators, farmers, weather buffs and many more.
1069XyGrib is the continuation of the zyGrib software package with a new team of
1070volunteers.")
1071 (home-page "https://opengribs.org")
1072 (license license:gpl3+)))
41b4b713
1073
1074(define-public libspatialindex
1075 (package
1076 (name "libspatialindex")
1cbe7a3e 1077 (version "1.9.3")
41b4b713
1078 (source
1079 (origin
1080 (method url-fetch)
1cbe7a3e
AI
1081 (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
1082 "releases/download/" version "/spatialindex-src-"
1083 version ".tar.bz2"))
41b4b713
1084 (sha256
1085 (base32
1cbe7a3e
AI
1086 "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
1087 (build-system cmake-build-system)
41b4b713
1088 (home-page "https://libspatialindex.org")
1089 (synopsis "Spatial indexing library")
1090 (description "The purpose of this library is to provide:
1091
1092@itemize
1093 @item An extensible framework that will support robust spatial indexing
1094methods.
1095 @item Support for sophisticated spatial queries. Range, point location,
1096 nearest neighbor and k-nearest neighbor as well as parametric queries (defined
1097by spatial constraints) should be easy to deploy and run.
1098 @item Easy to use interfaces for inserting, deleting and updating information.
1099 @item Wide variety of customization capabilities. Basic index and storage
1100characteristics like the page size, node capacity, minimum fan-out, splitting
1101algorithm, etc. should be easy to customize.
1102 @item Index persistence. Internal memory and external memory structures
1103should be supported. Clustered and non-clustered indices should be easy to be
1104persisted.
1105@end itemize
1106")
1107 (license license:expat)))
6dd0e41d
JL
1108
1109(define-public java-jmapviewer
1110 (package
1111 (name "java-jmapviewer")
8c8c0c63 1112 (version "2.13")
6dd0e41d
JL
1113 (source (origin
1114 (method url-fetch)
1115 (uri (string-append "https://svn.openstreetmap.org/applications/"
1116 "viewer/jmapviewer/releases/" version
1117 "/JMapViewer-" version "-Source.zip"))
1118 (sha256
1119 (base32
8c8c0c63 1120 "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
6dd0e41d
JL
1121 (build-system ant-build-system)
1122 (native-inputs
1123 `(("unzip" ,unzip)))
1124 (arguments
1125 `(#:build-target "pack"
1126 #:tests? #f; No tests
1127 #:phases
1128 (modify-phases %standard-phases
1129 (add-before 'build 'clean
1130 (lambda* _
1131 (invoke "ant" "clean")))
1132 (replace 'install
1133 (lambda* (#:key outputs #:allow-other-keys)
1134 (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
1135 (mkdir-p dir)
1136 (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))))))))
1137 (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
1138 (synopsis "OSM map integration in Java")
1139 (description "JMapViewer is a Java component which allows to easily
1140integrate an OSM map view into your Java application. It is maintained as
1141an independent project by the JOSM team.")
1142 (license license:gpl2)))
f041db86
JL
1143
1144(define-public josm
1145 (package
1146 (name "josm")
4b759d3c 1147 (version "15937")
f041db86
JL
1148 (source (origin
1149 (method svn-fetch)
1150 (uri (svn-reference
1151 (url "https://josm.openstreetmap.de/svn/trunk")
1152 (revision (string->number version))
1153 (recursive? #f)))
1154 (sha256
1155 (base32
4b759d3c 1156 "00b8sw0wgkcf7xknmdpn5s521ax8x2660figidcrry37sgq3x946"))
f041db86
JL
1157 (file-name (string-append name "-" version "-checkout"))
1158 (modules '((guix build utils)))
1159 (snippet
1160 '(begin
1161 (for-each delete-file (find-files "." ".*.jar$"))
1162 #t))))
1163 (build-system ant-build-system)
1164 (native-inputs
1165 `(("javacc" ,javacc)))
1166 (inputs
1167 `(("java-commons-jcs" ,java-commons-jcs)
1168 ("java-commons-compress" ,java-commons-compress)
1169 ("java-jmapviewer" ,java-jmapviewer)
1170 ("java-jsonp-api" ,java-jsonp-api)
1171 ("java-jsonp-impl" ,java-jsonp-impl); runtime dependency
1172 ("java-metadata-extractor" ,java-metadata-extractor)
1173 ("java-openjfx-media" ,java-openjfx-media)
1174 ("java-signpost-core" ,java-signpost-core)
1175 ("java-svg-salamander" ,java-svg-salamander)))
1176 (arguments
1177 `(#:tests? #f
1178 #:jar-name "josm.jar"
1179 #:phases
1180 (modify-phases %standard-phases
1181 (add-after 'unpack 'rm-build.xml
1182 (lambda* _
1183 (delete-file "build.xml")
1184 #t))
1185 (add-before 'build 'fix-revision
1186 (lambda* _
1187 (with-output-to-file "REVISION.XML"
1188 (lambda _
1189 (display
1190 (string-append "<info><entry><commit revision=\"" ,version "\">"
1191 "<date>1970-01-01 00:00:00 +0000</date>"
1192 "</commit></entry></info>"))))
1193 #t))
1194 (add-before 'build 'fix-classpath
1195 (lambda* (#:key inputs #:allow-other-keys)
1196 (setenv "CLASSPATH"
1197 (string-join
1198 (filter
1199 (lambda (s)
1200 (let ((source (assoc-ref inputs "source")))
1201 (not (equal? (substring s 0 (string-length source)) source))))
1202 (string-split (getenv "CLASSPATH") #\:))
1203 ":"))
1204 #t))
1205 (add-before 'build 'generate-parser
1206 (lambda* _
1207 (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
1208 (out (string-append dir "/parsergen"))
1209 (file (string-append dir "/MapCSSParser.jj")))
1210 (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
1211 (invoke "javacc" "-DEBUG_PARSER=false"
1212 "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
1213 "-GRAMMAR_ENCODING=UTF-8"
1214 (string-append "-OUTPUT_DIRECTORY=" out)
1215 file))
1216 #t))
1217 (add-after 'build 'generate-epsg
1218 (lambda _
1219 (system* "javac" "scripts/BuildProjectionDefinitions.java"
1220 "-cp" "build/classes")
1221 (mkdir-p "data/projection")
1222 (with-output-to-file "data/projection/custom-epsg"
1223 (lambda _ (display "")))
1224 (invoke "java" "-cp" "build/classes:scripts:."
1225 "BuildProjectionDefinitions" ".")
1226 #t))
1227 (add-after 'generate-epsg 'copy-data
1228 (lambda _
1229 (mkdir-p "build/classes")
1230 (rename-file "data" "build/classes/data")
1231 #t))
1232 (add-before 'install 'regenerate-jar
1233 (lambda _
1234 ;; We need to regenerate the jar file to add data.
1235 (delete-file "build/jar/josm.jar")
1236 (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
1237 "build/classes" ".")
1238 #t))
1239 (add-before 'build 'copy-styles
1240 (lambda _
1241 (mkdir-p "build/classes")
1242 (rename-file "styles" "build/classes/styles")
1243 #t))
1244 (add-before 'build 'copy-images
1245 (lambda _
1246 (mkdir-p "build/classes")
1247 (rename-file "images" "build/classes/images")
1248 #t))
1249 (add-before 'build 'copy-revision
1250 (lambda _
1251 (mkdir-p "build/classes")
1252 (with-output-to-file "build/classes/REVISION"
1253 (lambda _
1254 (display
1255 (string-append "Revision: " ,version "\n"
1256 "Is-Local-Build: true\n"
1257 "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
1258 #t))
1259 (add-after 'install 'install-bin
1260 (lambda* (#:key outputs inputs #:allow-other-keys)
1261 (let* ((out (assoc-ref outputs "out"))
1262 (bin (string-append out "/bin")))
1263 (mkdir-p bin)
1264 (with-output-to-file (string-append bin "/josm")
1265 (lambda _
1266 (display
1267 (string-append "#!/bin/sh\n"
1268 (assoc-ref inputs "jdk") "/bin/java"
1269 " -cp " out "/share/java/josm.jar:"
1270 (getenv "CLASSPATH")
1271 " org.openstreetmap.josm.gui.MainApplication"))))
1272 (chmod (string-append bin "/josm") #o755))
1273 #t)))))
1274 (home-page "https://josm.openstreetmap.de")
1275 (synopsis "OSM editor")
1276 (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
1277supports loading GPX tracks, background imagery and OSM data from local
1278sources as well as from online sources and allows to edit the OSM data (nodes,
1279ways, and relations) and their metadata tags.")
1280 (license license:gpl2+)))
53c9b398
HG
1281
1282(define-public libmaxminddb
1283 (package
1284 (name "libmaxminddb")
1285 (version "1.4.2")
1286 (source
1287 (origin
1288 (method url-fetch)
1289 (uri (string-append "https://github.com/maxmind/libmaxminddb"
1290 "/releases/download/" version "/"
1291 "/libmaxminddb-" version ".tar.gz"))
1292 (sha256
1293 (base32 "0mnimbaxnnarlw7g1rh8lpxsyf7xnmzwcczcc3lxw8xyf6ljln6x"))))
1294 (build-system gnu-build-system)
1295 (arguments
1296 `(#:phases
1297 (modify-phases %standard-phases
1298 (add-before 'configure 'set-cc-to-gcc
1299 (lambda _
1300 (setenv "CC" "gcc"))))))
1301 (native-inputs
1302 `(("perl" ,perl)))
1303 (home-page "https://maxmind.github.io/libmaxminddb/")
1304 (synopsis "C library for the MaxMind DB file format")
1305 (description "The libmaxminddb library provides a C library for reading
1306MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
1307format is a custom, but open, binary format designed to facilitate fast
1308lookups of IP addresses while allowing flexibility in the type of data
1309associated with an address.")
1310 (license license:asl2.0)))
b1414a81
HG
1311
1312(define-public python-maxminddb
1313 (package
1314 (name "python-maxminddb")
1315 (version "1.5.1")
1316 (source
1317 (origin
1318 (method url-fetch)
1319 (uri (pypi-uri "maxminddb" version))
1320 (sha256
1321 (base32
1322 "0y9giw81k4wdmpryr4k42w50z292mf364a6vs1vxf83ksc9ig6j4"))))
1323 (build-system python-build-system)
1324 (arguments
1325 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1326 (inputs
1327 `(("libmaxminddb" ,libmaxminddb)))
13b09bfc 1328 (home-page "https://www.maxmind.com/")
b1414a81
HG
1329 (synopsis "Reader for the MaxMind DB format")
1330 (description "MaxMind DB is a binary file format that stores data indexed
1331by IP address subnets (IPv4 or IPv6). This is a Python module for reading
1332MaxMind DB files.")
1333 (license license:asl2.0)))
0a71e34e
HG
1334
1335(define-public python-geoip2
1336 (package
1337 (name "python-geoip2")
1338 (version "2.9.0")
1339 (source
1340 (origin
1341 (method url-fetch)
1342 (uri (pypi-uri "geoip2" version))
1343 (sha256
1344 (base32
1345 "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
1346 (build-system python-build-system)
1347 (arguments
1348 `(#:tests? #f)) ;; Tests require a copy of the maxmind database
1349 (inputs
1350 `(("python-maxminddb" ,python-maxminddb)
1351 ("python-requests" ,python-requests)))
13b09bfc 1352 (home-page "https://www.maxmind.com/")
0a71e34e
HG
1353 (synopsis "MaxMind GeoIP2 API")
1354 (description "Provides an API for the GeoIP2 web services and databases.
1355The API also works with MaxMind’s free GeoLite2 databases.")
1356 (license license:asl2.0)))
30fa6b16
GLV
1357
1358(define-public routino
1359 (package
1360 (name "routino")
1361 (version "3.3.2")
1362 (source
1363 (origin
1364 (method url-fetch)
1365 (uri (string-append "http://www.routino.org/download/routino-"
1366 version ".tgz"))
1367 (sha256
1368 (base32
1369 "1ccx3s99j8syxc1gqkzsaqkmyf44l7h3adildnc5iq2md7bp8wab"))))
1370 (build-system gnu-build-system)
1371 (native-inputs
1372 `(("perl" ,perl)))
1373 (inputs
1374 `(("bzip2" ,bzip2)
1375 ("xz" ,xz)
1376 ("zlib" ,zlib)))
1377 (arguments
1378 `(#:test-target "test"
1379 #:phases
1380 (modify-phases %standard-phases
1381 (replace 'configure
1382 (lambda* (#:key outputs #:allow-other-keys)
1383 (substitute* "Makefile.conf"
1384 (("prefix=/usr/local")
1385 (string-append "prefix=" (assoc-ref outputs "out")))
1386 (("LDFLAGS_LDSO=-Wl,-R\\.")
1387 "LDFLAGS_LDSO=-Wl,-R$(libdir)")
1388 (("#CFLAGS\\+=-DUSE_XZ")
1389 "CFLAGS+=-DUSE_XZ")
1390 (("#LDFLAGS\\+=-llzma")
1391 "LDFLAGS+=-llzma"))
1392 #t)))))
1393 (synopsis "Routing application for OpenStreetMap data")
1394 (description
1395 "Routino is an application for finding a route between two points
1396using the dataset of topographical information collected by
1397@url{https://www.OpenStreetMap.org}.")
1398 (home-page "https://www.routino.org/")
1399 (license license:agpl3+)))
bccbeece
GLV
1400
1401(define-public qmapshack
1402 (package
1403 (name "qmapshack")
1404 (version "1.14.0")
1405 (source
1406 (origin
1407 (method git-fetch)
1408 (uri (git-reference
1409 (url "https://github.com/Maproom/qmapshack.git")
1410 (commit (string-append "V_" version))))
1411 (file-name (git-file-name name version))
1412 (sha256
1413 (base32
1414 "07c2hrq9sn456w7l3gdr599rmjfv2k6mh159zza7p1py8r7ywksa"))))
1415 (build-system qt-build-system)
1416 (native-inputs
1417 `(("pkg-config" ,pkg-config)
1418 ("qttools" ,qttools)))
1419 (inputs
1420 `(("gdal" ,gdal)
1421 ("libjpeg-turbo" ,libjpeg-turbo)
1422 ("proj" ,proj)
1423 ("qtbase" ,qtbase)
1424 ("qtdeclarative" ,qtdeclarative)
1425 ("qtlocation" ,qtlocation)
1426 ("qtwebchannel" ,qtwebchannel)
1427 ("qtwebengine" ,qtwebengine)
1428 ("quazip" ,quazip)
1429 ("routino" ,routino)
1430 ("sqlite" ,sqlite-with-column-metadata) ; See wrap phase
1431 ("zlib" ,zlib)))
1432 (arguments
1433 `(#:tests? #f
1434 #:phases
1435 (modify-phases %standard-phases
1436 (add-after 'unpack 'fix-cmake-modules
1437 (lambda* (#:key inputs #:allow-other-keys)
1438 (substitute* "CMakeLists.txt"
1439 (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
1440 (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
1441 (substitute* "cmake/Modules/FindROUTINO.cmake"
1442 (("/usr/local")
1443 (assoc-ref inputs "routino")))
1444 ;; The following fixes are included as patches in the sources
1445 ;; of QMapShack, but they are not applied by default, for
1446 ;; some reason...
1447 (invoke "patch" "-p1" "-i" "FindPROJ4.patch")
1448 (invoke "patch" "-p1" "-i" "FindQuaZip5.patch")
1449 #t))
1450 (add-after 'install 'wrap
1451 ;; The program fails to run with the error:
1452 ;; undefined symbol: sqlite3_column_table_name16
1453 ;; Forcing the program to use sqlite-with-column-metadata instead
1454 ;; of sqlite using LD_LIBRARY_PATH solves the problem.
1455 ;;
1456 ;; The program also fails to find the QtWebEngineProcess program,
1457 ;; so we set QTWEBENGINEPROCESS_PATH to help it.
1458 (lambda* (#:key inputs outputs #:allow-other-keys)
1459 (let ((bin (string-append (assoc-ref outputs "out") "/bin"))
1460 (qtwebengineprocess (string-append
1461 (assoc-ref inputs "qtwebengine")
1462 "/lib/qt5/libexec/QtWebEngineProcess"))
1463 (sqlite-lib (string-append (assoc-ref inputs "sqlite")
1464 "/lib")))
1465 (for-each (lambda (program)
1466 (wrap-program program
1467 `("LD_LIBRARY_PATH" ":" prefix (,sqlite-lib))
1468 `("QTWEBENGINEPROCESS_PATH" =
1469 (,qtwebengineprocess))))
1470 (find-files bin ".*")))
1471 #t)))))
1472 (synopsis "GPS mapping application")
1473 (description
1474 "QMapShack can be used to plan your next outdoor trip or to visualize and
1475archive all the GPS recordings of your past trips. It is the successor of the
1476QLandkarte GT application.")
1477 (home-page "https://github.com/Maproom/qmapshack/wiki")
1478 (license license:gpl3+)))
133de9ab
GLV
1479
1480(define-public readosm
1481 (package
1482 (name "readosm")
1483 (version "1.1.0")
1484 (source
1485 (origin
1486 (method url-fetch)
1487 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1488 "readosm-" version ".tar.gz"))
1489 (sha256
1490 (base32 "1v20pnda67imjd70fn0zw30aar525xicy3d3v49md5cvqklws265"))))
1491 (build-system gnu-build-system)
1492 (inputs
1493 `(("expat" ,expat)
1494 ("zlib" ,zlib)))
1495 (synopsis "Data extractor for OpenStreetMap files")
1496 (description
1497 "ReadOSM is a library to extract valid data from within an OpenStreetMap
1498input file (in @code{.osm} or @code{.osm.pbf} format).")
1499 (home-page "https://www.gaia-gis.it/fossil/readosm/index")
1500 (license (list license:gpl2+
1501 license:lgpl2.1+
1502 license:mpl1.1))))
0ccc1385
GLV
1503
1504(define-public spatialite-tools
1505 (package
1506 (name "spatialite-tools")
1507 (version "4.3.0")
1508 (source
1509 (origin
1510 (method url-fetch)
1511 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1512 "spatialite-tools-" version ".tar.gz"))
1513 (sha256
1514 (base32 "12fggjhi8cgwvw8f6nk76f83b8lqkc07abxyj5ap6f2gq2dqafgp"))))
1515 (build-system gnu-build-system)
1516 (native-inputs
1517 `(("pkg-config" ,pkg-config)))
1518 (inputs
1519 `(("expat" ,expat)
1520 ("freexl" ,freexl)
1521 ("geos" ,geos)
1522 ("libspatialite" ,libspatialite)
1523 ("libxml2" ,libxml2)
1524 ("proj.4" ,proj.4)
1525 ("readosm" ,readosm)
1526 ("sqlite" ,sqlite)
1527 ("zlib" ,zlib)))
1528 (synopsis "Collection of command line tools for SpatiaLite")
1529 (description
1530 "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
1531tools supporting SpatiaLite.")
1532 (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
1533 (license license:gpl3+)))
ec73c90e
GLV
1534
1535(define-public virtualpg
1536 (package
1537 (name "virtualpg")
1538 (version "1.0.2")
1539 (source
1540 (origin
1541 (method url-fetch)
1542 (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
1543 "virtualpg-" version ".tar.gz"))
1544 (sha256
1545 (base32 "0kjipcd08vvn188xmwbs7sw41xcs06x47n2hbqshpjcr51mxbarp"))))
1546 (build-system gnu-build-system)
1547 (inputs
1548 `(("postgresql" ,postgresql)
1549 ("sqlite" ,sqlite)))
1550 (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
1551 (description
1552 "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
1553the VirtualPostgres driver, allowing to directly exchange data between SQLite
1554and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
1555exchanged form one Spatial DBMS and the other.")
1556 (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
1557 (license (list license:gpl2+
1558 license:lgpl2.1+
1559 license:mpl1.1))))
7b1fb40d
GLV
1560
1561(define-public opencpn
1562 (package
1563 (name "opencpn")
1564 (version "5.0.0")
1565 (source
1566 (origin
1567 (method git-fetch)
1568 (uri (git-reference
1569 (url "https://github.com/OpenCPN/OpenCPN.git")
1570 (commit (string-append "v" version))))
1571 (file-name (git-file-name name version))
1572 (sha256
1573 (base32 "1xv3h6svw9aay5ixpql231md3pf00qxvhg62z88daraf18hlkfja"))))
1574 (build-system cmake-build-system)
1575 (native-inputs
1576 `(("gettext" ,gettext-minimal)
1577 ("pkg-config" ,pkg-config)))
1578 (inputs
1579 `(("bzip2" ,bzip2)
1580 ("cairo" ,cairo)
1581 ("curl" ,curl)
1582 ("glu" ,glu)
1583 ("gtk+" ,gtk+)
1584 ("libarchive" ,libarchive)
1585 ("libelf" ,libelf)
1586 ("libexif" ,libexif)
1587 ("libsndfile" ,libsndfile)
1588 ("lz4" ,lz4)
1589 ("mesa" ,mesa)
1590 ("pango" ,pango)
1591 ("portaudio" ,portaudio)
1592 ("sqlite" ,sqlite)
1593 ("tinyxml" ,tinyxml)
1594 ("wxsvg" ,wxsvg)
1595 ("wxwidgets" ,wxwidgets)
1596 ("xz" ,xz)
1597 ("zlib" ,zlib)))
1598 (arguments
1599 `(#:configure-flags '("-DENABLE_PORTAUDIO=ON"
1600 "-DENABLE_SNDFILE=ON"
1601 "-DBUNDLE_TCDATA=ON"
1602 "-DBUNDLE_GSHHS=CRUDE")
1603 #:tests? #f ; No tests defined
1604 #:phases
1605 (modify-phases %standard-phases
1606 (add-after 'unpack 'fix-build
1607 (lambda _
1608 (substitute* "CMakeLists.txt"
1609 (("set\\(wxWidgets_CONFIG_OPTIONS.*--toolkit=gtk3" all)
1610 (string-append all " --libs all")))
1611 #t)))))
1612 (synopsis "Chart plotter and marine GPS navigation software")
1613 (description
1614 "OpenCPN is a chart plotter and marine navigation software designed to be
1615used at the helm station of your boat while underway. Chart a course and
1616track your position right from your laptop.")
1617 (home-page "https://opencpn.org/")
1618 (license (list license:asl2.0
1619 license:cc0
1620 license:bsd-2
1621 license:bsd-3
1622 license:expat
1623 license:gpl3+
1624 license:lgpl2.1+
1625 license:lgpl3+
1626 license:sgifreeb2.0
1627 license:zlib))))