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