gnu: protozero: Fix typo in description.
[jackhill/guix/guix.git] / gnu / packages / geo.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
3 ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com>
4 ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de>
5 ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
7 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
8 ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
9 ;;; Copyright © 2018 Julien Lepiller <julien@lepiller.eu>
10 ;;;
11 ;;; This file is part of GNU Guix.
12 ;;;
13 ;;; GNU Guix is free software; you can redistribute it and/or modify it
14 ;;; under the terms of the GNU General Public License as published by
15 ;;; the Free Software Foundation; either version 3 of the License, or (at
16 ;;; your option) any later version.
17 ;;;
18 ;;; GNU Guix is distributed in the hope that it will be useful, but
19 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 ;;; GNU General Public License for more details.
22 ;;;
23 ;;; You should have received a copy of the GNU General Public License
24 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
25
26 (define-module (gnu packages geo)
27 #:use-module (guix build-system cmake)
28 #:use-module (guix build-system glib-or-gtk)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system go)
31 #:use-module (guix build-system python)
32 #:use-module (guix build-system scons)
33 #:use-module (guix build-system r)
34 #:use-module (guix download)
35 #:use-module (guix git-download)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix packages)
38 #:use-module (guix utils)
39 #:use-module (gnu packages boost)
40 #:use-module (gnu packages check)
41 #:use-module (gnu packages compression)
42 #:use-module (gnu packages databases)
43 #:use-module (gnu packages datastructures)
44 #:use-module (gnu packages documentation)
45 #:use-module (gnu packages fontutils)
46 #:use-module (gnu packages glib)
47 #:use-module (gnu packages gnome)
48 #:use-module (gnu packages gtk)
49 #:use-module (gnu packages image)
50 #:use-module (gnu packages icu4c)
51 #:use-module (gnu packages lua)
52 #:use-module (gnu packages pcre)
53 #:use-module (gnu packages perl)
54 #:use-module (gnu packages pkg-config)
55 #:use-module (gnu packages python)
56 #:use-module (gnu packages python-xyz)
57 #:use-module (gnu packages sqlite)
58 #:use-module (gnu packages web)
59 #:use-module (gnu packages webkit)
60 #:use-module (gnu packages wxwidgets)
61 #:use-module (gnu packages xml))
62
63 (define-public geos
64 (package
65 (name "geos")
66 (version "3.7.0")
67 (source (origin
68 (method url-fetch)
69 (uri (string-append "http://download.osgeo.org/geos/geos-"
70 version
71 ".tar.bz2"))
72 (sha256
73 (base32
74 "1mrz778m6bd1x9k6sha5kld43kalhq79h2lynlx2jx7xjakl3gsg"))))
75 (build-system gnu-build-system)
76 (arguments `(#:phases
77 (modify-phases %standard-phases
78 (add-after
79 'unpack 'patch-test-shebangs
80 (lambda _
81 (substitute* '("tests/xmltester/testrunner.sh"
82 "tests/geostest/testrunner.sh")
83 (("/bin/sh") (which "sh")))
84 #t)))))
85 (inputs
86 `(("glib" ,glib)))
87 (home-page "https://geos.osgeo.org/")
88 (synopsis "Geometry Engine for Geographic Information Systems")
89 (description
90 "GEOS provides a spatial object model and fundamental geometric
91 functions. It is a C++ port of the Java Topology Suite (JTS). As such,
92 it aims to contain the complete functionality of JTS in C++. This
93 includes all the OpenGIS Simple Features for SQL spatial predicate
94 functions and spatial operators, as well as specific JTS enhanced
95 topology functions.")
96 (license (list license:lgpl2.1+ ; Main distribution.
97 license:zlib ; tests/xmltester/tinyxml/*
98 license:public-domain)))) ; include/geos/timeval.h
99
100 (define-public gnome-maps
101 (package
102 (name "gnome-maps")
103 (version "3.26.2")
104 (source (origin
105 (method url-fetch)
106 (uri (string-append "mirror://gnome/sources/" name "/"
107 (version-major+minor version) "/"
108 name "-" version ".tar.xz"))
109 (sha256
110 (base32
111 "0l40l7m9dyphvasiq1jxrn6ivavs1xwzn0bzz2x1z7x73955q783"))))
112 (build-system glib-or-gtk-build-system)
113 (arguments
114 `(#:configure-flags ;; Ensure that geoclue is referred to by output.
115 (list (string-append "LDFLAGS=-L"
116 (assoc-ref %build-inputs "geoclue") "/lib")
117 (string-append "CFLAGS=-I"
118 (assoc-ref %build-inputs "geoclue") "/include"))
119 #:phases
120 (modify-phases %standard-phases
121 (add-after 'install 'wrap
122 (lambda* (#:key inputs outputs #:allow-other-keys)
123 (let ((out (assoc-ref outputs "out"))
124 (gi-typelib-path (getenv "GI_TYPELIB_PATH"))
125 (goa-path (string-append
126 (assoc-ref inputs "gnome-online-accounts")
127 "/lib"))
128 (webkitgtk-path (string-append
129 (assoc-ref inputs "webkitgtk")
130 "/lib")))
131 (wrap-program (string-append out "/bin/gnome-maps")
132 `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))
133
134 ;; There seems to be no way to embed the path of
135 ;; libgoa-1.0.so.0, libwebkit2gtk-4.0.so.37 and
136 ;; libjavascriptcoregtk-4.0.so.18.
137 `("LD_LIBRARY_PATH" ":" prefix (,goa-path ,webkitgtk-path)))
138 #t))))))
139 (native-inputs
140 `(("gobject-introspection" ,gobject-introspection)
141 ("intltool" ,intltool)
142 ("pkg-config" ,pkg-config)))
143 (inputs
144 `(("folks" ,folks)
145 ("libchamplain" ,libchamplain)
146 ("libgee" ,libgee)
147 ("libsecret" ,libsecret)
148 ("libsoup" ,libsoup)
149 ("libgweather" ,libgweather)
150 ("libxml2" ,libxml2)
151 ("gdk-pixbuf" ,gdk-pixbuf)
152 ("glib-networking" ,glib-networking)
153 ("geoclue" ,geoclue)
154 ("geocode-glib" ,geocode-glib)
155 ("gfbgraph" ,gfbgraph)
156 ("gjs" ,gjs)
157 ("glib" ,glib)
158 ("gnome-online-accounts" ,gnome-online-accounts)
159 ("gsettings-desktop-schemas" ,gsettings-desktop-schemas)
160 ("rest" ,rest)
161 ("webkitgtk" ,webkitgtk)))
162 (propagated-inputs
163 `(("gtk+3" ,gtk+)))
164 (synopsis "Graphical map viewer and wayfinding program")
165 (description "GNOME Maps is a graphical map viewer. It uses map data from
166 the OpenStreetMap project. It can provide directions for walking, bicycling,
167 and driving.")
168 (home-page "https://wiki.gnome.org/Apps/Maps")
169 (license license:gpl2+)))
170
171 (define-public libgaiagraphics
172 (package
173 (name "libgaiagraphics")
174 (version "0.5")
175 (source
176 (origin
177 (method url-fetch)
178 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libgaiagraphics-"
179 version ".tar.gz"))
180 (sha256
181 (base32
182 "076afqv417ag3hfvnif0qc7qscmnq1dsf6y431yygwgf34rjkayc"))))
183 (build-system gnu-build-system)
184 (native-inputs
185 `(("pkg-config" ,pkg-config)))
186 (inputs
187 `(("cairo" ,cairo)
188 ("libpng" ,libpng)
189 ("libjpeg-turbo" ,libjpeg-turbo)
190 ("libtiff" ,libtiff)
191 ("libgeotiff" ,libgeotiff)
192 ("proj.4" ,proj.4)
193 ("libxml2" ,libxml2)
194 ("zlib" ,zlib)))
195 (synopsis "Gaia common graphics support")
196 (description "libgaiagraphics is a library supporting
197 common-utility raster handling methods.")
198 (home-page "https://www.gaia-gis.it/fossil/libgaiagraphics/index")
199 (license license:lgpl3+)))
200
201 (define-public libgeotiff
202 (package
203 (name "libgeotiff")
204 (version "1.4.2")
205 (source
206 (origin
207 (method url-fetch)
208 (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
209 version ".tar.gz"))
210 (sha256
211 (base32
212 "0vjy3bwfhljjx66p9w999i4mdhsf7vjshx29yc3pn5livf5091xd"))
213 (modules '((guix build utils)))
214 (snippet
215 '(begin
216 ;; Remove .csv files, distributed from EPSG under a restricted
217 ;; license. See LICENSE for full license text.
218 (for-each delete-file (find-files "." "\\.csv$"))
219 ;; Now that we have removed the csv files, we need to modify the Makefile.
220 (substitute* "Makefile.in"
221 (("^all-am: .*$")
222 "all-am: Makefile $(LTLIBRARIES) $(HEADERS) geo_config.h\n")
223 (("^install-data-am: .*$")
224 "install-data-am: install-includeHEADERS"))
225 #t))))
226 (build-system gnu-build-system)
227 (inputs
228 `(("libjpeg-turbo" ,libjpeg-turbo)
229 ("libtiff" ,libtiff)
230 ("proj.4" ,proj.4)
231 ("zlib" ,zlib)))
232 (arguments
233 `(#:configure-flags
234 (list (string-append "--with-zlib")
235 (string-append "--with-jpeg")
236 (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
237 (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
238 (description "libgeotiff is a library on top of libtiff for reading and
239 writing GeoTIFF information tags.")
240 (home-page "https://trac.osgeo.org/geotiff/")
241 ;; This is a mixture of various contributions under different licenses.
242 ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
243 ;; states, as its commercial redistribution is restricted. Hence, we have
244 ;; removed it from the package.
245 (license (list license:public-domain
246 license:x11
247 license:bsd-3
248 (license:non-copyleft "file://LICENSE"
249 "See LICENSE in the distribution.")))))
250
251 (define-public libspatialite
252 (package
253 (name "libspatialite")
254 (version "4.3.0a")
255 (source
256 (origin
257 (method url-fetch)
258 (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
259 version ".tar.gz"))
260 (sha256
261 (base32
262 "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448"))))
263 (build-system gnu-build-system)
264 (native-inputs
265 `(("pkg-config" ,pkg-config)))
266 (inputs
267 `(("freexl" ,freexl)
268 ("geos" ,geos)
269 ("libxml2" ,libxml2)
270 ("proj.4" ,proj.4)
271 ("sqlite" ,sqlite)
272 ("zlib" ,zlib)))
273 (arguments
274 `(#:phases
275 (modify-phases %standard-phases
276 ;; 3 tests are failing, ignore them:
277 (add-after 'unpack 'ignore-broken-tests
278 (lambda _
279 (substitute* '("test/Makefile.in")
280 (("\tcheck_sql_stm.*" all) "\tcheck_multithread$(EXEEXT) \\\n")
281 (("(\tch.*) check_v.*ble2.*$" all vt1) (string-append vt1 " \\\n"))
282 (("\tch.* (check_v.*ble4.*)$" all vt4) (string-append "\t" vt4)))
283 #t)))))
284 (synopsis "Extend SQLite to support Spatial SQL capabilities")
285 (description
286 "SpatiaLite is a library intended to extend the SQLite core to support
287 fully fledged Spatial SQL capabilities.")
288 (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
289 ;; For the genuine libspatialite-sources holds:
290 ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
291 ;; Files under src/control_points are from GRASS
292 ;; and are licensed under GPL2+ only.
293 ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
294 (license (list license:gpl2+
295 license:lgpl2.1+
296 license:mpl1.1
297 license:public-domain))))
298
299 (define-public proj.4
300 (package
301 (name "proj.4")
302 (version "4.9.3")
303 (source (origin
304 (method url-fetch)
305 (uri (string-append "http://download.osgeo.org/proj/proj-"
306 version ".tar.gz"))
307 (sha256
308 (base32
309 "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
310 (build-system gnu-build-system)
311 (arguments
312 `(#:phases
313 (modify-phases %standard-phases
314 (add-after 'unpack 'patch-test-paths
315 (lambda _
316 (substitute* '("nad/test27"
317 "nad/test83"
318 "nad/testvarious"
319 "nad/testdatumfile"
320 "nad/testflaky"
321 "nad/testIGNF")
322 (("/bin/rm") (which "rm")))
323 #t))
324 ;; Precision problems on i686 and other platforms. See:
325 ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
326 ;; Disable failing test.
327 (add-after 'patch-test-paths 'ignore-failing-tests
328 (lambda _
329 (substitute* '("nad/Makefile.in")
330 (("\tPROJ_LIB.*" all) (string-append "#" all)))
331 #t)))))
332 (inputs
333 `(("glib" ,glib)))
334 (home-page "http://proj4.org/")
335 (synopsis "Cartographic Projections Library")
336 (description
337 "Proj.4 is a library for converting coordinates between cartographic
338 projections.")
339 (license (list license:expat
340 ;; src/PJ_patterson.c
341 license:asl2.0
342 ;; src/geodesic.c/h
343 license:x11
344 ;; Embedded EPSG database.
345 (license:non-copyleft "http://www.epsg.org/TermsOfUse")
346 ;; cmake/*
347 license:boost1.0))))
348
349 (define-public mapnik
350 (package
351 (name "mapnik")
352 (version "3.0.18")
353 (source
354 (origin
355 (method url-fetch)
356 (uri (string-append "https://github.com/mapnik/mapnik/releases/download/v"
357 version "/mapnik-v" version ".tar.bz2"))
358 (sha256
359 (base32
360 "06frcikaj2mgz3abfk5h0z4j3hbksi0zikwjngbjv4p5f3pwxf8q"))))
361 (build-system scons-build-system)
362 (inputs
363 `(("boost" ,boost)
364 ("cairo" ,cairo)
365 ("freetype" ,freetype)
366 ("harfbuzz" ,harfbuzz)
367 ("icu4c" ,icu4c)
368 ("libjpeg-turbo" ,libjpeg-turbo)
369 ("libpng" ,libpng)
370 ("libtiff" ,libtiff)
371 ("libwebp" ,libwebp)
372 ("libxml2" ,libxml2)
373 ("proj.4" ,proj.4)
374 ("sqlite" ,sqlite)
375 ("zlib" ,zlib)))
376 (native-inputs
377 `(("pkg-config" ,pkg-config)))
378 (arguments
379 `(#:scons ,scons-python2
380 #:scons-flags
381 (list "CC=gcc"
382 (string-append "PREFIX=" %output)
383 (string-append "CUSTOM_LDFLAGS=-Wl,-rpath=" %output "/lib"))))
384 (home-page "http://mapnik.org/")
385 (synopsis "Toolkit for developing mapping applications")
386 (description "Mapnik is a toolkit for developing mapping applications. It
387 is basically a collection of geographic objects like maps, layers,
388 datasources, features, and geometries. At its core is a C++ shared library
389 providing algorithms and patterns for spatial data access and visualization.
390 The library does not rely on any specific windowing system and can be deployed
391 to any server environment. It is intended to play fair in a multi-threaded
392 environment and is aimed primarily, but not exclusively, at web-based
393 development.")
394 (license (list license:lgpl2.1+
395 ;; demo/viewer, demo/python/rundemo.py
396 license:gpl2+
397 ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
398 license:boost1.0
399 ;; deps/mapnik/sparsehash
400 license:bsd-3
401 ;; deps/agg
402 (license:non-copyleft "file://deps/agg/copying")))))
403
404 (define-public python2-mapnik
405 (package
406 (name "python2-mapnik")
407 (version "3.0.16")
408 (source
409 (origin
410 (method url-fetch)
411 (uri (string-append "https://github.com/mapnik/python-mapnik/archive/v"
412 version ".tar.gz"))
413 (file-name (string-append name "-" version ".tar.gz"))
414 (sha256
415 (base32
416 "0w7wg72gnwmbjani9sqk42p2jwqkrl9hsdkawahni5m05xsifcb4"))))
417 (build-system python-build-system)
418 (inputs
419 `(("boost" ,boost)
420 ("harfbuzz" ,harfbuzz)
421 ("icu4c" ,icu4c)
422 ("libjpeg-turbo" ,libjpeg-turbo)
423 ("libpng" ,libpng)
424 ("libtiff" ,libtiff)
425 ("libwebp" ,libwebp)
426 ("mapnik" ,mapnik)
427 ("proj.4" ,proj.4)
428 ("python2-pycairo" ,python2-pycairo)))
429 (native-inputs
430 (let ((test-data-input
431 (lambda (repository version hash)
432 (origin
433 (method url-fetch)
434 (uri (string-append "https://github.com/mapnik/" repository
435 "/archive/v" version ".tar.gz"))
436 (file-name (string-append "python-mapnik-" repository
437 "-" version ".tar.gz"))
438 (sha256 (base32 hash))))))
439 `(("python2-nose" ,python2-nose)
440 ;; Test data is released as separate tarballs
441 ("test-data"
442 ,(test-data-input "test-data" "3.0.18"
443 "10cvgn5gxn8ldrszj24zr1vzm5w76kqk4s7bl2zzp5yvkhh8lj1n"))
444 ("test-data-visual"
445 ,(test-data-input "test-data-visual" "3.0.18"
446 "1cb9ghy8sis0w5fkp0dvwxdqqx44rhs9a9w8g9r9i7md1c40r80i")))))
447 (arguments
448 `(#:python ,python-2 ; Python 3 support is incomplete, and the build fails
449 #:phases
450 (modify-phases %standard-phases
451 ;; Unpack test data into the source tree
452 (add-after 'unpack 'unpack-submodules
453 (lambda* (#:key inputs #:allow-other-keys)
454 (let ((unpack (lambda (source target)
455 (with-directory-excursion target
456 (invoke "tar" "xvf" (assoc-ref inputs source)
457 "--strip-components=1")))))
458 (unpack "test-data" "test/data")
459 (unpack "test-data-visual" "test/data-visual"))))
460 ;; Skip failing tests
461 (add-after 'unpack 'skip-tests
462 (lambda _
463 (let ((skipped-tests (list "test_vrt_referring_to_missing_files"
464 "test_unicode_regex_replace"
465 "test_proj_antimeridian_bbox"
466 "test_render_with_scale_factor")))
467 (substitute* "setup.cfg"
468 (("\\[nosetests\\]" all)
469 (string-append all "\nexclude=^("
470 (string-join skipped-tests "|") ")$")))))))))
471 (home-page "https://github.com/mapnik/python-mapnik")
472 (synopsis "Python bindings for Mapnik")
473 (description "This package provides Python bindings for Mapnik.")
474 (license license:lgpl2.1+)))
475
476 (define-public spatialite-gui
477 (package
478 (name "spatialite-gui")
479 (version "1.7.1")
480 (source
481 (origin
482 (method url-fetch)
483 (uri (string-append "https://www.gaia-gis.it/gaia-sins/spatialite_gui-"
484 version ".tar.gz"))
485 (sha256
486 (base32
487 "1r05dz9pyc8vsd2wbqxcsracpfbaamz470rcyp2myfpqwznv376b"))))
488 (build-system gnu-build-system)
489 (native-inputs
490 `(("pkg-config" ,pkg-config)))
491 (inputs
492 `(("freexl" ,freexl)
493 ("geos" ,geos)
494 ("libgaiagraphics" ,libgaiagraphics)
495 ("libspatialite" ,libspatialite)
496 ("libxml2" ,libxml2)
497 ("proj.4" ,proj.4)
498 ("sqlite" ,sqlite)
499 ("wxwidgets" ,wxwidgets-2)
500 ("zlib" ,zlib)))
501 (synopsis "Graphical user interface for SpatiaLite")
502 (description "Spatialite-gui provides a visual interface for viewing and
503 maintaining a spatialite database. You can easily see the structure of the
504 tables and data contents using point and click functions, many of which
505 construct common SQL queries, or craft your own SQL queries.")
506 (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
507 (license license:gpl3+)))
508
509 (define-public gdal
510 (package
511 (name "gdal")
512 (version "2.2.4")
513 (source (origin
514 (method url-fetch)
515 (uri (string-append
516 "http://download.osgeo.org/gdal/" version "/gdal-"
517 version ".tar.gz"))
518 (sha256
519 (base32
520 "1951f7b69x3d1vic0rmq92q8f4bj3hbxnxmj5jl0cc3zg0isgmdr"))
521 (modules '((guix build utils)))
522 (snippet
523 `(begin
524 ;; TODO: frmts contains a lot more bundled code.
525 (for-each delete-file-recursively
526 ;; bundled code
527 '("frmts/png/libpng"
528 "frmts/gif/giflib"
529 "frmts/jpeg/libjpeg"
530 "frmts/jpeg/libjpeg12"
531 "frmts/gtiff/libtiff"
532 "frmts/gtiff/libgeotiff"
533 "frmts/zlib"
534 "ogr/ogrsf_frmts/geojson/libjson"))))))
535 (build-system gnu-build-system)
536 (arguments
537 `(#:tests? #f
538 #:configure-flags
539 (let-syntax ((with (syntax-rules ()
540 ((_ option input)
541 (string-append option "="
542 (assoc-ref %build-inputs input))))))
543 (list
544 ;; TODO: --with-pcidsk, --with-pcraster
545 (with "--with-freexl" "freexl")
546 (with "--with-libjson-c" "json-c")
547 (with "--with-png" "libpng")
548 (with "--with-webp" "libwebp")
549 (with "--with-gif" "giflib")
550 (with "--with-jpeg" "libjpeg-turbo")
551 (with "--with-libtiff" "libtiff")
552 (with "--with-geotiff" "libgeotiff")
553 (with "--with-libz" "zlib")
554 "--with-pcre"))
555 #:phases
556 (modify-phases %standard-phases
557 (add-before 'build 'fix-path
558 (lambda _
559 (substitute* "frmts/mrf/mrf_band.cpp"
560 (("\"../zlib/zlib.h\"") "<zlib.h>")))))))
561 (inputs
562 `(("freexl" ,freexl)
563 ("geos" ,geos)
564 ("giflib" ,giflib)
565 ("json-c" ,json-c)
566 ("libgeotiff" ,libgeotiff)
567 ("libjpeg-turbo" ,libjpeg-turbo)
568 ("libpng" ,libpng)
569 ("libtiff" ,libtiff)
570 ("libwebp" ,libwebp)
571 ("pcre" ,pcre)
572 ("zlib" ,zlib)))
573 (home-page "http://www.gdal.org/")
574 (synopsis "Raster and vector geospatial data format library")
575 (description "GDAL is a translator library for raster and vector geospatial
576 data formats. As a library, it presents a single raster abstract data model
577 and single vector abstract data model to the calling application for all
578 supported formats. It also comes with a variety of useful command line
579 utilities for data translation and processing.")
580 (license (list
581 ;; general license
582 license:expat
583 ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
584 ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
585 ;; frmts/mrf/
586 license:bsd-3
587 ;; frmts/hdf4/hdf-eos/*
588 ;; similar to the expat license, but without guarantee exclusion
589 (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
590 ;; frmts/grib/degrib/
591 license:public-domain ; with guarantee exclusion
592 ;; port/cpl_minizip*
593 ;; Some bsd-inspired license
594 (license:non-copyleft "file://port/LICENCE_minizip")
595 ;; alg/internal_libqhull
596 ;; Some 5-clause license
597 (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
598 ;; frmts/mrf/libLERC
599 license:asl2.0))))
600
601 (define-public postgis
602 (package
603 (name "postgis")
604 (version "2.4.4")
605 (source (origin
606 (method url-fetch)
607 (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
608 version ".tar.gz"))
609 (sha256
610 (base32
611 "1hm8migjb53cymp4qvg1h20yqllmy9f7x0awv5450391i6syyqq6"))))
612 (build-system gnu-build-system)
613 (arguments
614 `(#:tests? #f
615 #:make-flags
616 (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
617 (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
618 (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
619 (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
620 #:phases
621 (modify-phases %standard-phases
622 (add-before 'build 'fix-install-path
623 (lambda* (#:key outputs #:allow-other-keys)
624 (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
625 (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
626 (string-append (assoc-ref outputs "out") "/bin"))))))))
627 (inputs
628 `(("gdal" ,gdal)
629 ("geos" ,geos)
630 ("libxml2" ,libxml2)
631 ("pcre" ,pcre)
632 ("postgresql" ,postgresql)
633 ("proj.4" ,proj.4)))
634 (native-inputs
635 `(("perl" ,perl)
636 ("pkg-config" ,pkg-config)))
637 (home-page "https://postgis.net")
638 (synopsis "Spatial database extender for PostgreSQL")
639 (description "PostGIS is a spatial database extender for PostgreSQL
640 object-relational database. It adds support for geographic objects allowing
641 location queries to be run in SQL. This package provides a PostgreSQL
642 extension.")
643 (license (list
644 ;; General license
645 license:gpl2+
646 ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
647 license:expat
648 ;; loader/getopt.*
649 license:public-domain
650 ;; doc/xsl
651 license:bsd-3 ; files only say "BSD"
652 ;; doc
653 license:cc-by-sa3.0))))
654
655 (define-public tegola
656 (package
657 (name "tegola")
658 (version "0.7.0")
659 (source (origin
660 (method url-fetch)
661 (uri (string-append
662 "https://github.com/go-spatial/tegola/archive/v"
663 version ".tar.gz"))
664 (file-name (string-append name "-" version ".tar.gz"))
665 (sha256
666 (base32
667 "09vnzxfn0r70kmd776kcdfqxhzdj11syxa0b27z4ci1k367v7viw"))))
668 (build-system go-build-system)
669 (arguments
670 `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
671 #:unpack-path "github.com/go-spatial"
672 #:phases
673 (modify-phases %standard-phases
674 (add-before 'build 'set-version
675 (lambda _
676 (with-directory-excursion
677 (string-append "src/github.com/go-spatial/tegola-" ,version)
678 (substitute* '("cmd/tegola/cmd/root.go"
679 "cmd/tegola_lambda/main.go")
680 (("version not set") ,version)))
681 #t))
682 (add-before 'build 'rename-import
683 (lambda _
684 (rename-file (string-append "src/github.com/go-spatial/tegola-" ,version)
685 "src/github.com/go-spatial/tegola")
686 #t)))))
687 (home-page "http://tegola.io")
688 (synopsis "Vector tile server for maps")
689 (description "Tegola is a free vector tile server written in Go. Tegola
690 takes geospatial data and slices it into vector tiles that can be efficiently
691 delivered to any client.")
692 (license (list
693 license:expat
694 ;; Some packages in vendor have other licenses
695 license:asl2.0
696 license:bsd-2
697 license:bsd-3
698 license:wtfpl2))))
699
700 (define-public imposm3
701 (package
702 (name "imposm3")
703 (version "0.6.0-alpha.4")
704 (source
705 (origin
706 (method url-fetch)
707 (uri (string-append "https://github.com/omniscale/imposm3/archive/v"
708 version ".tar.gz"))
709 (file-name (string-append name "-" version ".tar.gz"))
710 (sha256
711 (base32
712 "06f0kwmv52yd5m9jlckqxqmkf0cnqy3hamakrvg9lspplyqrds80"))))
713 (build-system go-build-system)
714 (arguments
715 `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
716 #:unpack-path "github.com/omniscale"
717 #:phases
718 (modify-phases %standard-phases
719 (add-before 'build 'rename-import
720 (lambda _
721 (rename-file (string-append "src/github.com/omniscale/imposm3-" ,version)
722 "src/github.com/omniscale/imposm3")
723 #t))
724 (add-before 'build 'set-version
725 (lambda _
726 (substitute* "src/github.com/omniscale/imposm3/version.go"
727 (("0.0.0-dev") ,version))
728 #t)))))
729 (inputs
730 `(("geos" ,geos)
731 ("leveldb" ,leveldb)))
732 (home-page "https://imposm.org/")
733 (synopsis "OpenStreetMap importer for PostGIS")
734 (description "Imposm is an importer for OpenStreetMap data. It reads PBF
735 files and imports the data into PostgreSQL/PostGIS databases. It is designed
736 to create databases that are optimized for rendering/tile/map-services.")
737 (license (list
738 license:asl2.0
739 ;; Some dependencies in vendor have different licenses
740 license:expat
741 license:bsd-2
742 license:bsd-3))))
743
744 (define-public protozero
745 (package
746 (name "protozero")
747 (version "1.6.5")
748 (source
749 (origin
750 (method git-fetch)
751 (uri (git-reference
752 (url "https://github.com/mapbox/protozero.git")
753 (commit (string-append "v" version))))
754 (file-name (git-file-name name version))
755 (sha256
756 (base32 "10ldzni46cplmkgx1f73yn95qcb71xh9nxpcfdmi107y3kvicv3c"))))
757 (build-system cmake-build-system)
758 (home-page "https://github.com/mapbox/protozero")
759 (synopsis "Minimalistic protocol buffer decoder and encoder in C++")
760 (description "Protozero is a minimalistic protocol buffer decoder and
761 encoder in C++. The developer using protozero has to manually translate the
762 @file{.proto} description into code.")
763 (license (list
764 license:asl2.0 ; for folly
765 license:bsd-2))))
766
767 (define-public libosmium
768 (package
769 (name "libosmium")
770 (version "2.14.2")
771 (source
772 (origin
773 (method url-fetch)
774 (uri (string-append "https://github.com/osmcode/libosmium/archive/v"
775 version ".tar.gz"))
776 (file-name (string-append name "-" version ".tar.gz"))
777 (sha256
778 (base32
779 "0d9b46qiw7zkw1h9lygjdwqxnbhm3c7v8kydzw9f9f778cyagc94"))))
780 (build-system cmake-build-system)
781 (propagated-inputs
782 `(("boost" ,boost)
783 ("expat" ,expat)
784 ("gdal" ,gdal)
785 ("geos" ,geos)
786 ("proj.4" ,proj.4)
787 ("protozero" ,protozero)
788 ("sparsehash" ,sparsehash)
789 ("zlib" ,zlib)))
790 (native-inputs
791 `(("doxygen" ,doxygen)))
792 (home-page "https://osmcode.org/libosmium/")
793 (synopsis "C++ library for working with OpenStreetMap data")
794 (description "Libosmium is a fast and flexible C++ library for working with
795 OpenStreetMap data.")
796 (license license:boost1.0)))
797
798 (define-public osm2pgsql
799 (package
800 (name "osm2pgsql")
801 (version "0.96.0")
802 (source (origin
803 (method url-fetch)
804 (uri (string-append "https://github.com/openstreetmap/osm2pgsql/archive/"
805 version ".tar.gz"))
806 (file-name (string-append name "-" version ".tar.gz"))
807 (sha256
808 (base32
809 "08y7776r4l9v9177a4q6cfdri0lpirky96m6g699hwl7v1vhw0mn"))
810 (modules '((guix build utils)))
811 (snippet
812 '(begin
813 (delete-file-recursively "contrib/protozero")
814 (delete-file-recursively "contrib/libosmium")
815 #t))))
816 (build-system cmake-build-system)
817 (arguments
818 `(#:tests? #f; tests fail because we need to setup a database
819 #:configure-flags
820 (list (string-append "-DOSMIUM_INCLUDE_DIR="
821 (assoc-ref %build-inputs "libosmium")
822 "/include")
823 (string-append "-DPROTOZERO_INCLUDE_DIR="
824 (assoc-ref %build-inputs "protozero")
825 "/include"))))
826 (inputs
827 `(("boost" ,boost)
828 ("expat" ,expat)
829 ("libosmium" ,libosmium)
830 ("lua" ,lua)
831 ("postgresql" ,postgresql)
832 ("proj.4" ,proj.4)
833 ("protozero" ,protozero)
834 ("zlib" ,zlib)))
835 (native-inputs
836 `(("python-2" ,python-2)
837 ("python2-psycopg2" ,python2-psycopg2)))
838 (home-page "https://github.com/openstreetmap/osm2pgsql")
839 (synopsis "OSM data importer to postgresql")
840 (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
841 PostgreSQL / PostGIS database suitable for applications like rendering into a
842 map, geocoding with Nominatim, or general analysis.")
843 (license license:gpl2+)))
844
845 (define-public tippecanoe
846 (package
847 (name "tippecanoe")
848 (version "1.31.5")
849 (source (origin
850 (method url-fetch)
851 (uri (string-append "https://github.com/mapbox/tippecanoe/archive/"
852 version ".tar.gz"))
853 (file-name (string-append name "-" version ".tar.gz"))
854 (sha256
855 (base32
856 "1057na1dkgjaryr7jr15lqkxpam111d3l5zdpdkqzzzpxmdjxqcf"))))
857 (build-system gnu-build-system)
858 (arguments
859 `(#:phases
860 (modify-phases %standard-phases (delete 'configure))
861 #:test-target "test"
862 #:make-flags
863 (list "CC=gcc"
864 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
865 (inputs
866 `(("perl" ,perl)
867 ("sqlite" ,sqlite)
868 ("zlib" ,zlib)))
869 (home-page "https://github.com/mapbox/tippecanoe")
870 (synopsis "Vector tile server for maps")
871 (description "Tippecanoe creates scale-independent view of data, so that
872 the texture and density of features is visible at every zoom level, instead of
873 dropping features at lower levels.")
874 (license license:bsd-2)))