geo.scm 116 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114
  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–2021 Tobias Geerinckx-Rice <me@tobias.gr>
  6. ;;; Copyright © 2018 Ricardo Wurmus <rekado@elephly.net>
  7. ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net>
  8. ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com>
  9. ;;; Copyright © 2018, 2019, 2020, 2021 Julien Lepiller <julien@lepiller.eu>
  10. ;;; Copyright © 2019-2023 Guillaume Le Vaillant <glv@posteo.net>
  11. ;;; Copyright © 2019-2023 Efraim Flashner <efraim@flashner.co.il>
  12. ;;; Copyright © 2019, 2021 Wiktor Żelazny <wzelazny@vurv.cz>
  13. ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
  14. ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
  15. ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
  16. ;;; Copyright © 2020, 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
  17. ;;; Copyright © 2021, 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
  18. ;;; Copyright © 2021, 2023 Vinicius Monego <monego@posteo.net>
  19. ;;; Copyright © 2021 Clément Lassieur <clement@lassieur.org>
  20. ;;; Copyright © 2021, 2022 Nikolay Korotkiy <sikmir@disroot.org>
  21. ;;; Copyright © 2022 Roman Scherer <roman.scherer@burningswell.com>
  22. ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
  23. ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  24. ;;;
  25. ;;; This file is part of GNU Guix.
  26. ;;;
  27. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  28. ;;; under the terms of the GNU General Public License as published by
  29. ;;; the Free Software Foundation; either version 3 of the License, or (at
  30. ;;; your option) any later version.
  31. ;;;
  32. ;;; GNU Guix is distributed in the hope that it will be useful, but
  33. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  34. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  35. ;;; GNU General Public License for more details.
  36. ;;;
  37. ;;; You should have received a copy of the GNU General Public License
  38. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  39. (define-module (gnu packages geo)
  40. #:use-module ((guix licenses) #:prefix license:)
  41. #:use-module (guix build-system ant)
  42. #:use-module (guix build-system cmake)
  43. #:use-module (guix build-system glib-or-gtk)
  44. #:use-module (guix build-system gnu)
  45. #:use-module (guix build-system go)
  46. #:use-module (guix build-system meson)
  47. #:use-module (guix build-system pyproject)
  48. #:use-module (guix build-system python)
  49. #:use-module (guix build-system qt)
  50. #:use-module (guix download)
  51. #:use-module (guix gexp)
  52. #:use-module (guix git-download)
  53. #:use-module (guix packages)
  54. #:use-module (guix svn-download)
  55. #:use-module (guix utils)
  56. #:use-module (gnu packages)
  57. #:use-module (gnu packages algebra)
  58. #:use-module (gnu packages astronomy)
  59. #:use-module (gnu packages audio)
  60. #:use-module (gnu packages autotools)
  61. #:use-module (gnu packages backup)
  62. #:use-module (gnu packages bash)
  63. #:use-module (gnu packages bison)
  64. #:use-module (gnu packages boost)
  65. #:use-module (gnu packages build-tools)
  66. #:use-module (gnu packages c)
  67. #:use-module (gnu packages check)
  68. #:use-module (gnu packages cmake)
  69. #:use-module (gnu packages compression)
  70. #:use-module (gnu packages cpp)
  71. #:use-module (gnu packages cups)
  72. #:use-module (gnu packages curl)
  73. #:use-module (gnu packages databases)
  74. #:use-module (gnu packages datastructures)
  75. #:use-module (gnu packages docbook)
  76. #:use-module (gnu packages documentation)
  77. #:use-module (gnu packages elf)
  78. #:use-module (gnu packages flex)
  79. #:use-module (gnu packages fonts)
  80. #:use-module (gnu packages fontutils)
  81. #:use-module (gnu packages gcc)
  82. #:use-module (gnu packages gettext)
  83. #:use-module (gnu packages gl)
  84. #:use-module (gnu packages glib)
  85. #:use-module (gnu packages gnome)
  86. #:use-module (gnu packages gps)
  87. #:use-module (gnu packages graphics)
  88. #:use-module (gnu packages gtk)
  89. #:use-module (gnu packages haskell-apps)
  90. #:use-module (gnu packages haskell-xyz)
  91. #:use-module (gnu packages icu4c)
  92. #:use-module (gnu packages image)
  93. #:use-module (gnu packages image-processing)
  94. #:use-module (gnu packages java)
  95. #:use-module (gnu packages kde)
  96. #:use-module (gnu packages libusb)
  97. #:use-module (gnu packages linux)
  98. #:use-module (gnu packages lua)
  99. #:use-module (gnu packages maths)
  100. #:use-module (gnu packages multiprecision)
  101. #:use-module (gnu packages pcre)
  102. #:use-module (gnu packages pdf)
  103. #:use-module (gnu packages perl)
  104. #:use-module (gnu packages photo)
  105. #:use-module (gnu packages pkg-config)
  106. #:use-module (gnu packages pretty-print)
  107. #:use-module (gnu packages protobuf)
  108. #:use-module (gnu packages pulseaudio)
  109. #:use-module (gnu packages python)
  110. #:use-module (gnu packages python-build)
  111. #:use-module (gnu packages python-check)
  112. #:use-module (gnu packages python-crypto)
  113. #:use-module (gnu packages python-science)
  114. #:use-module (gnu packages python-web)
  115. #:use-module (gnu packages python-xyz)
  116. #:use-module (gnu packages qt)
  117. #:use-module (gnu packages readline)
  118. #:use-module (gnu packages sdl)
  119. #:use-module (gnu packages speech)
  120. #:use-module (gnu packages sqlite)
  121. #:use-module (gnu packages swig)
  122. #:use-module (gnu packages textutils)
  123. #:use-module (gnu packages time)
  124. #:use-module (gnu packages tls)
  125. #:use-module (gnu packages web)
  126. #:use-module (gnu packages webkit)
  127. #:use-module (gnu packages wxwidgets)
  128. #:use-module (gnu packages xml)
  129. #:use-module (gnu packages xorg))
  130. (define-public libaec
  131. (package
  132. (name "libaec")
  133. (version "1.0.6")
  134. (source
  135. (origin
  136. (method git-fetch)
  137. (uri (git-reference
  138. (url "https://gitlab.dkrz.de/k202009/libaec")
  139. (commit (string-append "v" version))))
  140. (file-name (git-file-name name version))
  141. (sha256
  142. (base32 "14myrmmiz9z6wgxqywf3a63cq514vrzsd6z4zvpwigvawlk30iip"))))
  143. (build-system cmake-build-system)
  144. (home-page "https://gitlab.dkrz.de/k202009/libaec")
  145. (synopsis "Adaptive Entropy Coding library")
  146. (description "Libaec provides fast lossless compression of 1 up to 32 bit
  147. wide signed or unsigned integers (samples). The library achieves best results
  148. for low entropy data as often encountered in space imaging instrument data or
  149. numerical model output from weather or climate simulations. While floating
  150. point representations are not directly supported, they can also be efficiently
  151. coded by grouping exponents and mantissa.")
  152. (license license:bsd-2)))
  153. (define-public eccodes
  154. (package
  155. (name "eccodes")
  156. (version "2.27.0")
  157. (source
  158. (origin
  159. (method url-fetch)
  160. (uri (string-append
  161. "https://confluence.ecmwf.int/download/attachments/45757960/"
  162. "eccodes-" version "-Source.tar.gz"))
  163. (sha256
  164. (base32 "16cw4v2d0kjq6gq04paqny0sh5jymn70w449mig7m5h3spzv7rgd"))))
  165. (build-system cmake-build-system)
  166. (arguments
  167. `(#:configure-flags '("-DENABLE_MEMFS=ON" "-DENABLE_PNG=ON")
  168. #:validate-runpath? #f))
  169. (inputs
  170. (list jasper libaec libjpeg-turbo libpng netcdf openjpeg))
  171. (native-inputs
  172. (list gfortran perl pkg-config python))
  173. (home-page "https://confluence.ecmwf.int/display/ECC")
  174. (synopsis "Library for handling the GRIB, BUFR and GTS file formats")
  175. (description "ecCodes is a package developed by @acronym{ECMWF, European
  176. Centre for Medium-Range Weather Forecasts} which provides an application
  177. programming interface and a set of tools for decoding and encoding messages in
  178. the @acronym{WMO, World Meteorological Organization} FM-92 GRIB, WMO FM-94
  179. BUFR and WMO GTS abbreviated header formats.")
  180. (license license:asl2.0)))
  181. (define-public cdo
  182. (package
  183. (name "cdo")
  184. (version "2.1.0")
  185. (source
  186. (origin
  187. (method url-fetch)
  188. (uri (string-append
  189. "https://code.mpimet.mpg.de/attachments/download/27481/cdo-"
  190. version ".tar.gz"))
  191. (sha256
  192. (base32 "1k18llghpf3jnjn0xcnhmbg7arb1fiy854qqn9m5c1abjin38wdq"))))
  193. (build-system gnu-build-system)
  194. (arguments
  195. (list #:configure-flags
  196. #~(list (string-append "--with-curl="
  197. #$(this-package-input "curl"))
  198. (string-append "--with-eccodes="
  199. #$(this-package-input "eccodes"))
  200. (string-append "--with-fftw3="
  201. #$(this-package-input "fftw"))
  202. (string-append "--with-hdf5="
  203. #$(this-package-input "hdf5"))
  204. (string-append "--with-netcdf="
  205. #$(this-package-input "netcdf"))
  206. (string-append "--with-proj="
  207. #$(this-package-input "proj"))
  208. (string-append "--with-udunits2="
  209. #$(this-package-input "udunits"))
  210. (string-append "--with-libxml2="
  211. #$(this-package-input "libxml2")))
  212. ;; Some tests can fail on machines with many threads.
  213. #:parallel-tests? #f))
  214. (inputs
  215. (list curl eccodes fftw hdf5 libxml2 netcdf proj udunits))
  216. (native-inputs
  217. (list pkg-config))
  218. (home-page "https://code.mpimet.mpg.de/projects/cdo")
  219. (synopsis "Climate data operators")
  220. (description "@acronym{CDO, Climate Data Operators} is a collection of command-line
  221. operators to manipulate and analyse climate and NWP model data. Supported
  222. data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG. There are more
  223. than 600 operators available.")
  224. (license license:bsd-3)))
  225. (define-public h3
  226. (package
  227. (name "h3")
  228. (version "4.1.0")
  229. (source
  230. (origin
  231. (method git-fetch)
  232. (uri (git-reference
  233. (url "https://github.com/uber/h3")
  234. (commit (string-append "v" version))))
  235. (file-name (git-file-name name version))
  236. (sha256
  237. (base32 "0x764xzna8ka6yhgv2y4hb158a61y3g9a6835qckqp7wfkpqvb7f"))))
  238. (build-system cmake-build-system)
  239. (arguments
  240. (list #:configure-flags #~(list "-DBUILD_SHARED_LIBS=ON")))
  241. (home-page "https://h3geo.org/")
  242. (synopsis "Hexagonal hierarchical geospatial indexing system")
  243. (description "H3 is a geospatial indexing system using a hexagonal grid
  244. that can be (approximately) subdivided into finer and finer hexagonal grids,
  245. combining the benefits of a hexagonal grid with S2's hierarchical
  246. subdivisions.")
  247. (license license:asl2.0)))
  248. ;; For python-timezonefinder, remove it when it starts supporting newer
  249. ;; version.
  250. (define-public h3-3
  251. (package
  252. (inherit h3)
  253. (name "h3")
  254. (version "3.7.2")
  255. (source
  256. (origin
  257. (method git-fetch)
  258. (uri (git-reference
  259. (url "https://github.com/uber/h3")
  260. (commit (string-append "v" version))))
  261. (file-name (git-file-name name version))
  262. (sha256
  263. (base32 "0bvsljfxmjvl23v9gxykc4aynjzh5xfy3wg02bxad7cknr1amx9j"))))))
  264. (define-public python-h3
  265. (package
  266. (name "python-h3")
  267. (version "4.0.0b2")
  268. (source
  269. (origin
  270. (method git-fetch) ; no tests data in PyPi package
  271. (uri (git-reference
  272. (url "https://github.com/uber/h3-py")
  273. (commit (string-append "v" version))))
  274. (file-name (git-file-name name version))
  275. (sha256
  276. (base32 "1k1n256hhlh05gjcj64pqh08zlaz6962jkb6nk1aazsgg8p41zs0"))
  277. (modules '((guix build utils)))
  278. ;; Remove bundeled H3 lib.
  279. (snippet #~(begin (delete-file-recursively "src/h3lib")))))
  280. (build-system pyproject-build-system)
  281. (arguments
  282. (list
  283. ;; FIXME: Check why these tests are failing.
  284. ;; test_versions - assert (4, 1) == (4, 0)
  285. ;; test_resolution - h3._cy.error_system.H3Failed
  286. #:test-flags #~(list "-k" (string-append
  287. "not test_versions"
  288. " and not test_resolution"))
  289. #:phases
  290. #~(modify-phases %standard-phases
  291. ;; Use packaged in Guix h3 source.
  292. (add-after 'unpack 'patch-cmakelists
  293. (lambda _
  294. (substitute* "CMakeLists.txt"
  295. (("add_subdirectory\\(src/h3lib\\)")
  296. (string-append
  297. "include_directories(" #$(this-package-input "h3")
  298. "/include/h3)\n"
  299. "link_directories(" #$(this-package-input "h3")
  300. "/lib)\n"))
  301. ((".*CMAKE_CURRENT_BINARY_DIR.*")
  302. (string-append #$(this-package-input "h3")
  303. "/include/h3/h3api.h\n"))))))))
  304. (native-inputs
  305. (list cmake-minimal
  306. python-cython
  307. python-numpy
  308. python-pytest
  309. python-scikit-build
  310. python-setuptools-scm))
  311. (inputs (list h3))
  312. (home-page "https://uber.github.io/h3-py")
  313. (synopsis "Python bindings for H3")
  314. (description "This package provides a Python bindings for H3, a
  315. hierarchical hexagonal geospatial indexing system")
  316. (license license:asl2.0)))
  317. ;; For python-timezonefinder, remove it when it starts supporting newer
  318. ;; version.
  319. (define-public python-h3-3
  320. (package
  321. (inherit python-h3)
  322. (name "python-h3")
  323. (version "3.7.6")
  324. (source
  325. (origin
  326. (method git-fetch)
  327. (uri (git-reference
  328. (url "https://github.com/uber/h3-py")
  329. (commit (string-append "v" version))))
  330. (file-name (git-file-name name version))
  331. (sha256
  332. (base32 "16gxa1sivghxw179rik87r918mjasars2qkzidlwq83qfa4axn20"))))
  333. (inputs
  334. (modify-inputs (package-inputs python-h3)
  335. (replace "h3" h3-3)))))
  336. (define-public memphis
  337. (package
  338. (name "memphis")
  339. (version "0.2.3")
  340. (source
  341. (origin
  342. (method git-fetch)
  343. (uri
  344. (git-reference
  345. (url "https://github.com/jiuka/memphis")
  346. (commit version)))
  347. (file-name (git-file-name name version))
  348. (sha256
  349. (base32 "068c3943pgbpfjq44pmvn5fmkh005ak5aa67vvrq3fn487c6w54q"))))
  350. (build-system glib-or-gtk-build-system)
  351. (outputs '("out" "doc"))
  352. (arguments
  353. `(#:configure-flags
  354. (list "--disable-static"
  355. "--enable-gtk-doc"
  356. "--enable-vala"
  357. (string-append "--with-html-dir=" #$output "/share/gtk-doc/html"))
  358. #:phases
  359. (modify-phases %standard-phases
  360. (add-after 'unpack 'patch-autogen
  361. (lambda _
  362. (substitute* "autogen.sh"
  363. (("\\./configure \"\\$@\"")
  364. "")))))))
  365. (native-inputs
  366. (list autoconf
  367. automake
  368. docbook-xml-4.3
  369. gobject-introspection
  370. gtk-doc/stable
  371. libtool
  372. libxml2 ;for XML_CATALOG_FILES
  373. pkg-config
  374. python-wrapper
  375. seed
  376. vala))
  377. (inputs (list expat glib))
  378. (propagated-inputs (list cairo))
  379. (synopsis "Map-rendering for OpenSteetMap")
  380. (description "Memphis is a map-rendering application and a library for
  381. OpenStreetMap written in C using eXpat, Cairo and GLib.")
  382. (home-page "http://trac.openstreetmap.ch/trac/memphis/")
  383. (license license:lgpl2.1+)))
  384. (define-public geos
  385. (package
  386. (name "geos")
  387. (version "3.11.2")
  388. (source (origin
  389. (method url-fetch)
  390. (uri (string-append "http://download.osgeo.org/geos/geos-"
  391. version
  392. ".tar.bz2"))
  393. (sha256
  394. (base32
  395. "1k744nwfa5sj4amzsdjxgac83wh6xfb9xi7z5bka7ic1jik7gw5i"))))
  396. (build-system cmake-build-system)
  397. (arguments `(#:phases
  398. (modify-phases %standard-phases
  399. (add-after
  400. 'unpack 'patch-test-shebangs
  401. (lambda _
  402. (substitute* '("tests/xmltester/testrunner.sh"
  403. "tests/geostest/testrunner.sh")
  404. (("/bin/sh") (which "sh"))))))))
  405. (inputs
  406. (list glib))
  407. (home-page "https://libgeos.org/")
  408. (synopsis "Geometry Engine for Geographic Information Systems")
  409. (description
  410. "GEOS provides a spatial object model and fundamental geometric
  411. functions. It is a C++ port of the Java Topology Suite (JTS). As such,
  412. it aims to contain the complete functionality of JTS in C++. This
  413. includes all the OpenGIS Simple Features for SQL spatial predicate
  414. functions and spatial operators, as well as specific JTS enhanced
  415. topology functions.")
  416. (license (list license:lgpl2.1+ ; Main distribution.
  417. license:zlib ; tests/xmltester/tinyxml/*
  418. license:public-domain)))) ; include/geos/timeval.h
  419. (define-public gnome-maps
  420. (package
  421. (name "gnome-maps")
  422. (version "43.0") ;for libsoup 3 support
  423. (source (origin
  424. (method url-fetch)
  425. (uri (string-append "mirror://gnome/sources/" name "/"
  426. (version-major version) "/"
  427. name "-" version ".tar.xz"))
  428. (sha256
  429. (base32
  430. "1r1l6ajs6zz316m8zac5r0l3qgdv616xh376bfn2fflcnz7wys08"))))
  431. (build-system meson-build-system)
  432. (arguments
  433. (list
  434. #:glib-or-gtk? #t
  435. #:phases
  436. #~(modify-phases %standard-phases
  437. (add-after 'unpack 'skip-cache-and-database-updates
  438. (lambda _
  439. (substitute* "meson.build"
  440. (("([a-z_]*): true" all option)
  441. (cond ; cond rather than match saves an import
  442. ((member option '("gtk_update_icon_cache"
  443. "update_desktop_database"))
  444. (string-append option ": false"))
  445. (else all))))))
  446. (add-after 'install 'wrap
  447. (lambda _
  448. (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
  449. (substitute* (string-append #$output "/share/gnome-maps/"
  450. "org.gnome.Maps")
  451. (("imports\\.package\\.init" all)
  452. (string-append "'" gi-typelib-path "'.split(':').forEach("
  453. "path => imports.gi.GIRepository.Repository."
  454. "prepend_search_path(path));\n"
  455. all)))))))))
  456. (native-inputs
  457. (list gettext-minimal
  458. `(,glib "bin")
  459. gobject-introspection
  460. pkg-config))
  461. (inputs
  462. (list folks
  463. evolution-data-server
  464. geoclue
  465. geocode-glib
  466. gfbgraph
  467. gjs
  468. glib
  469. glib-networking
  470. gnome-online-accounts
  471. gsettings-desktop-schemas
  472. gtk+
  473. libadwaita
  474. libgee
  475. libgweather4
  476. libhandy
  477. librsvg
  478. libsecret
  479. libshumate
  480. libsoup
  481. libxml2
  482. rest-next
  483. webkitgtk))
  484. (synopsis "Graphical map viewer and wayfinding program")
  485. (description "GNOME Maps is a graphical map viewer. It uses map data from
  486. the OpenStreetMap project. It can provide directions for walking, bicycling,
  487. and driving.")
  488. (home-page "https://wiki.gnome.org/Apps/Maps")
  489. (license license:gpl2+)))
  490. (define-public libgeotiff
  491. (package
  492. (name "libgeotiff")
  493. (version "1.7.1")
  494. (source
  495. (origin
  496. (method url-fetch)
  497. (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
  498. version ".tar.gz"))
  499. (patches (search-patches "libgeotiff-fix-tests-with-proj-9.1.1.patch"))
  500. (sha256
  501. (base32 "1mjmgv48x51ppax5dnb6lq7z600czxll53bx6jbzqwd4m93i7aq5"))
  502. (modules '((guix build utils)))
  503. (snippet
  504. '(begin
  505. ;; Remove .csv files, distributed from EPSG under a restricted
  506. ;; license. See LICENSE for full license text.
  507. (for-each delete-file (find-files "." "\\.csv$"))
  508. #t))))
  509. (build-system gnu-build-system)
  510. (inputs
  511. (list libjpeg-turbo libtiff zlib))
  512. (propagated-inputs
  513. (list ;; libgeotiff headers include proj headers, so ensure those are available.
  514. proj))
  515. (arguments
  516. `(#:configure-flags
  517. (list "--disable-static"
  518. "--with-zlib" "--with-jpeg"
  519. (string-append "--with-libtiff=" (assoc-ref %build-inputs "libtiff")))))
  520. (synopsis "Library for handling GeoTIFF (geographic enabled TIFF)")
  521. (description "libgeotiff is a library on top of libtiff for reading and
  522. writing GeoTIFF information tags.")
  523. (home-page "https://trac.osgeo.org/geotiff/")
  524. ;; This is a mixture of various contributions under different licenses.
  525. ;; Note that the EPSG database is NOT "free to use" as the LICENSE file
  526. ;; states, as its commercial redistribution is restricted. Hence, we have
  527. ;; removed it from the package.
  528. (license (list license:public-domain
  529. license:x11
  530. license:bsd-3
  531. (license:non-copyleft "file://LICENSE"
  532. "See LICENSE in the distribution.")))))
  533. (define-public librasterlite2
  534. (package
  535. (name "librasterlite2")
  536. (version "1.1.0-beta1")
  537. (source
  538. (origin
  539. (method url-fetch)
  540. (uri (string-append
  541. "https://www.gaia-gis.it/gaia-sins/librasterlite2-sources/"
  542. "librasterlite2-" version ".tar.gz"))
  543. (sha256
  544. (base32
  545. "1x24gqp4hsq97c31ncwxblab0x0863q8v1z42jil7lvsq3glqa7p"))))
  546. (build-system gnu-build-system)
  547. (native-inputs
  548. (list pkg-config))
  549. (inputs
  550. (list cairo
  551. curl
  552. freetype
  553. freexl
  554. giflib
  555. libgeotiff
  556. libjpeg-turbo
  557. libpng
  558. librttopo
  559. libspatialite
  560. libtiff
  561. libwebp
  562. libxml2
  563. lz4
  564. minizip
  565. openjpeg
  566. proj
  567. sqlite
  568. `(,zstd "lib")))
  569. (synopsis "Library to work with huge raster coverages using a SpatiaLite")
  570. (description
  571. "librasterlite2 is a library that stores and retrieves huge raster
  572. coverages using a SpatiaLite DBMS.")
  573. (home-page "https://www.gaia-gis.it/fossil/librasterlite2/index")
  574. ;; For the genuine librasterlite-sources holds:
  575. ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
  576. ;; Files under src/control_points are from GRASS
  577. ;; and are licensed under GPL2+ only.
  578. ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
  579. ;; The tools supporting the library (both rl2tool and wmslite) are
  580. ;; licensed under the GPL v3 (or any subsequent version) terms.
  581. ;; The test/*.svg files are placed in the public domain, except for
  582. ;; test/Car_Yellow.svg which is licensed under the Free Art License 1.3.
  583. (license (list license:gpl2+
  584. license:gpl3+
  585. license:lal1.3
  586. license:lgpl2.1+
  587. license:mpl1.1
  588. license:public-domain))))
  589. (define-public librttopo
  590. (package
  591. (name "librttopo")
  592. (version "1.1.0")
  593. (source
  594. (origin
  595. (method git-fetch)
  596. (uri (git-reference
  597. (url "https://git.osgeo.org/gitea/rttopo/librttopo")
  598. (commit (string-append "librttopo-" version))))
  599. (file-name (git-file-name name version))
  600. (sha256
  601. (base32 "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p"))))
  602. (build-system gnu-build-system)
  603. (arguments
  604. `(#:phases
  605. (modify-phases %standard-phases
  606. (add-after 'unpack 'patch-autogen
  607. (lambda _
  608. (let ((autoconf (which "autoconf"))
  609. (autoheader (which "autoheader"))
  610. (aclocal (which "aclocal"))
  611. (automake (which "automake"))
  612. (libtoolize (which "libtoolize")))
  613. (substitute* "autogen.sh"
  614. (("`which autoconf 2>/dev/null`") autoconf)
  615. (("`which autoheader 2>/dev/null`") autoheader)
  616. (("ACLOCAL=.*$")
  617. (string-append "ACLOCAL=" aclocal "\n"))
  618. (("AUTOMAKE=.*$")
  619. (string-append "AUTOMAKE=" automake "\n"))
  620. (("LIBTOOLIZE=.*$")
  621. (string-append "LIBTOOLIZE=" libtoolize "\n"))))
  622. #t)))))
  623. (native-inputs
  624. (list autoconf automake libtool pkg-config))
  625. (inputs
  626. (list geos))
  627. (synopsis "Library to handle SQL/MM topologies")
  628. (description
  629. "The RT Topology Library exposes an API to create and manage standard
  630. (ISO 13249 aka SQL/MM) topologies using user-provided data stores.")
  631. (home-page "https://git.osgeo.org/gitea/rttopo/librttopo")
  632. (license license:gpl2+)))
  633. (define-public libspatialite
  634. (package
  635. (name "libspatialite")
  636. (version "5.0.1")
  637. (source
  638. (origin
  639. (method url-fetch)
  640. (uri (string-append "https://www.gaia-gis.it/gaia-sins/libspatialite-"
  641. version ".tar.gz"))
  642. (sha256
  643. (base32
  644. "164y82rw2lrp5glfc0rkn7n6xvx5dvlgmh7bb7815067251wkjzf"))))
  645. (build-system gnu-build-system)
  646. (native-inputs
  647. (list pkg-config))
  648. (inputs
  649. (list freexl
  650. geos
  651. librttopo
  652. libxml2
  653. minizip
  654. proj
  655. sqlite))
  656. (arguments
  657. `(#:configure-flags
  658. '("--enable-rttopo=yes")
  659. ;; FIXME: Several tests fail with Proj 9.
  660. #:tests? #f
  661. #:phases
  662. (modify-phases %standard-phases
  663. ;; 1 test is failing, ignore it:
  664. (add-after 'unpack 'ignore-broken-tests
  665. (lambda _
  666. (substitute* '("test/Makefile.in")
  667. (("check_wms\\$\\(EXEEXT\\) check_drop_rename\\$\\(EXEEXT\\) ")
  668. "check_wms$(EXEEXT) ")))))))
  669. (synopsis "Extend SQLite to support Spatial SQL capabilities")
  670. (description
  671. "SpatiaLite is a library intended to extend the SQLite core to support
  672. fully fledged Spatial SQL capabilities.")
  673. (home-page "https://www.gaia-gis.it/fossil/libspatialite/index")
  674. ;; For the genuine libspatialite-sources holds:
  675. ;; Any of the licenses MPL1.1, GPL2+ or LGPL2.1+ may be picked.
  676. ;; Files under src/control_points are from GRASS
  677. ;; and are licensed under GPL2+ only.
  678. ;; src/md5.[ch]: Placed into the public domain by Alexander Peslyak.
  679. (license (list license:gpl2+
  680. license:lgpl2.1+
  681. license:mpl1.1
  682. license:public-domain))))
  683. (define-public proj
  684. (package
  685. (name "proj")
  686. (version "9.2.0")
  687. (source
  688. (origin
  689. (method url-fetch)
  690. (uri (string-append "http://download.osgeo.org/proj/proj-"
  691. version ".tar.gz"))
  692. (sha256
  693. (base32
  694. "03nm1sgvh237my7ss6kayn6887cbnayvjxrrxsrfcakkmbsida6y"))))
  695. (build-system cmake-build-system)
  696. (native-inputs (list googletest pkg-config))
  697. (propagated-inputs (list curl libtiff sqlite)) ;required by proj.pc
  698. (home-page "https://proj.org/")
  699. (synopsis "Coordinate transformation software")
  700. (description
  701. "Proj is a generic coordinate transformation software that transforms
  702. geospatial coordinates from one @acronym{CRS, coordinate reference system}
  703. to another. This includes cartographic projections as well as geodetic
  704. transformations. Proj includes command line applications for easy
  705. conversion of coordinates from text files or directly from user input.
  706. In addition, Proj also exposes an application programming interface that
  707. lets developers use the functionality of Proj in their own software.")
  708. (license (list license:expat
  709. ;; src/projections/patterson.cpp
  710. license:asl2.0
  711. ;; src/geodesic.*, src/tests/geodtest.cpp
  712. license:x11))))
  713. ; This is the last version of proj that provides the old proj.4 API.
  714. (define-public proj-7
  715. (package (inherit proj)
  716. (version "7.2.1")
  717. (source
  718. (origin
  719. (method url-fetch)
  720. (uri (string-append "http://download.osgeo.org/proj/proj-"
  721. version ".tar.gz"))
  722. (sha256
  723. (base32
  724. "050apzdn0isxpsblys1shrl9ccli5vd32kgswlgx1imrbwpg915k"))))
  725. (arguments
  726. `(#:configure-flags '("-DUSE_EXTERNAL_GTEST=ON")
  727. #:phases
  728. (modify-phases %standard-phases
  729. (add-after 'unpack 'fix-version
  730. (lambda _
  731. (substitute* "CMakeLists.txt"
  732. (("MAJOR 7 MINOR 2 PATCH 0") "MAJOR 7 MINOR 2 PATCH 1")))))))))
  733. (define-public proj.4
  734. (package
  735. (name "proj.4")
  736. (version "4.9.3")
  737. (source (origin
  738. (method url-fetch)
  739. (uri (string-append "http://download.osgeo.org/proj/proj-"
  740. version ".tar.gz"))
  741. (sha256
  742. (base32
  743. "1xw5f427xk9p2nbsj04j6m5zyjlyd66sbvl2bkg8hd1kx8pm9139"))))
  744. (build-system gnu-build-system)
  745. (arguments
  746. `(#:phases
  747. (modify-phases %standard-phases
  748. (add-after 'unpack 'patch-test-paths
  749. (lambda _
  750. (substitute* '("nad/test27"
  751. "nad/test83"
  752. "nad/testvarious"
  753. "nad/testdatumfile"
  754. "nad/testflaky"
  755. "nad/testIGNF")
  756. (("/bin/rm") (which "rm")))
  757. #t))
  758. ;; Precision problems on i686 and other platforms. See:
  759. ;; https://web.archive.org/web/20151006134301/http://trac.osgeo.org/proj/ticket/255
  760. ;; Disable failing test.
  761. (add-after 'patch-test-paths 'ignore-failing-tests
  762. (lambda _
  763. (substitute* '("nad/Makefile.in")
  764. (("\tPROJ_LIB.*" all) (string-append "#" all)))
  765. #t)))))
  766. (inputs
  767. (list glib))
  768. (home-page "https://proj.org/")
  769. (synopsis "Cartographic Projections Library")
  770. (description
  771. "Proj.4 is a library for converting coordinates between cartographic
  772. projections.")
  773. (license (list license:expat
  774. ;; src/PJ_patterson.c
  775. license:asl2.0
  776. ;; src/geodesic.c/h
  777. license:x11
  778. ;; Embedded EPSG database.
  779. (license:non-copyleft "http://www.epsg.org/TermsOfUse")
  780. ;; cmake/*
  781. license:boost1.0))))
  782. (define-public python-pyproj
  783. (package
  784. (name "python-pyproj")
  785. (version "3.5.0")
  786. (source
  787. (origin
  788. (method url-fetch)
  789. (uri (pypi-uri "pyproj" version))
  790. (sha256
  791. (base32
  792. "1xhvr0n5gb7v6x0wd7cqmc0zrky2fag7bq2shx6l2qqq3icx2ncq"))))
  793. (build-system python-build-system)
  794. (arguments
  795. `(#:phases
  796. (modify-phases %standard-phases
  797. (add-after 'unpack 'set-proj-path
  798. (lambda* (#:key inputs #:allow-other-keys)
  799. (let ((proj (assoc-ref inputs "proj")))
  800. (setenv "PROJ_DIR" proj)
  801. (substitute* "pyproj/datadir.py"
  802. (("(internal_datadir = ).*$" all var)
  803. (string-append var "Path(\"" proj "/share/proj\")\n")))))))))
  804. (inputs
  805. (list proj))
  806. (propagated-inputs
  807. (list python-certifi))
  808. (native-inputs
  809. (list python-cython python-numpy python-pandas python-pytest
  810. python-xarray))
  811. (home-page "https://github.com/pyproj4/pyproj")
  812. (synopsis
  813. "Python interface to PROJ")
  814. (description
  815. "This package provides a Python interface to PROJ, a cartographic
  816. projections and coordinate transformations library.")
  817. (license license:expat)))
  818. (define-public python-fiona
  819. (package
  820. (name "python-fiona")
  821. (version "1.8.20")
  822. (source
  823. (origin
  824. (method url-fetch)
  825. (uri (pypi-uri "Fiona" version))
  826. (sha256
  827. (base32
  828. "0fql7i7dg1xpbadmk8d26dwp91v7faixxc4wq14zg0kvhp9041d7"))))
  829. (build-system python-build-system)
  830. (arguments
  831. `(#:phases
  832. (modify-phases %standard-phases
  833. (add-before 'check 'remove-local-fiona
  834. (lambda _
  835. ; This would otherwise interfere with finding the installed
  836. ; fiona when running tests.
  837. (delete-file-recursively "fiona")))
  838. (replace 'check
  839. (lambda* (#:key tests? inputs outputs #:allow-other-keys)
  840. (add-installed-pythonpath inputs outputs)
  841. (setenv "GDAL_ENABLE_DEPRECATED_DRIVER_GTM" "YES")
  842. (when tests?
  843. (invoke "pytest"
  844. "-m" "not network and not wheel"
  845. ;; FIXME: Find why the
  846. ;; test_no_append_driver_cannot_append[PCIDSK]
  847. ;; test is failing.
  848. "-k" "not test_no_append_driver_cannot_append")))))))
  849. (inputs
  850. (list gdal))
  851. (propagated-inputs
  852. (list python-attrs
  853. python-certifi
  854. python-click
  855. python-click-plugins
  856. python-cligj
  857. python-munch
  858. python-setuptools
  859. python-six
  860. python-pytz))
  861. (native-inputs
  862. (list gdal ; for gdal-config
  863. python-boto3
  864. python-cython
  865. python-pytest
  866. python-pytest-cov))
  867. (home-page "https://github.com/Toblerity/Fiona")
  868. (synopsis
  869. "Fiona reads and writes spatial data files")
  870. (description
  871. "Fiona is GDAL’s neat and nimble vector API for Python programmers.
  872. Fiona is designed to be simple and dependable. It focuses on reading
  873. and writing data in standard Python IO style and relies upon familiar
  874. Python types and protocols such as files, dictionaries, mappings, and
  875. iterators instead of classes specific to OGR. Fiona can read and write
  876. real-world data using multi-layered GIS formats and zipped virtual file
  877. systems and integrates readily with other Python GIS packages such as
  878. pyproj, Rtree, and Shapely.")
  879. (license license:bsd-3)))
  880. (define-public python-geopandas
  881. (package
  882. (name "python-geopandas")
  883. (version "0.10.2")
  884. (source
  885. (origin
  886. (method url-fetch)
  887. (uri (pypi-uri "geopandas" version))
  888. (sha256
  889. (base32
  890. "1nvim2i47ap1zdwy6kxydskf1cir5g4ij8124wvmrqij0zklggzg"))))
  891. (build-system python-build-system)
  892. (arguments
  893. '(#:phases
  894. (modify-phases %standard-phases
  895. (replace 'check
  896. (lambda* (#:key tests? #:allow-other-keys)
  897. (when tests?
  898. (invoke "pytest"
  899. ; Disable tests that fail due to incompatibilities
  900. ; with our pandas version.
  901. "-k"
  902. (string-append
  903. "not test_getitem_invalid"
  904. " and not test_value_counts"
  905. " and not test_setitem_invalid"
  906. " and not test_insert_invalid")
  907. ; Disable tests that require internet access.
  908. "-m" "not web")))))))
  909. (propagated-inputs
  910. (list python-fiona python-pandas python-pyproj python-shapely))
  911. (native-inputs
  912. (list python-pytest))
  913. (home-page "https://geopandas.org")
  914. (synopsis "Geographic pandas extensions")
  915. (description "The goal of GeoPandas is to make working with
  916. geospatial data in Python easier. It combines the capabilities of
  917. Pandas and Shapely, providing geospatial operations in Pandas and a
  918. high-level interface to multiple geometries to Shapely. GeoPandas
  919. enables you to easily do operations in Python that would otherwise
  920. require a spatial database such as PostGIS.")
  921. (license license:bsd-3)))
  922. (define-public python-osmnx
  923. (package
  924. (name "python-osmnx")
  925. (version "1.1.2")
  926. (source
  927. (origin
  928. ; Fetch from github as the pypi package is missing the tests dir.
  929. (method git-fetch)
  930. (uri (git-reference
  931. (url "https://github.com/gboeing/osmnx")
  932. (commit (string-append "v" version))))
  933. (file-name (git-file-name name version))
  934. (sha256
  935. (base32 "1n8qjn184p5a2s3j6x6iyc1i7p3l3xnbqqxm6ajwgwv6j5fw1d5a"))))
  936. (build-system pyproject-build-system)
  937. (arguments
  938. (list
  939. #:test-flags
  940. '(list "-k"
  941. (string-append
  942. ;; The following tests require network access.
  943. "not test_geocode_to_gdf"
  944. " and not test_stats"
  945. " and not test_osm_xml"
  946. " and not test_elevation"
  947. " and not test_routing"
  948. " and not test_plots"
  949. " and not test_find_nearest"
  950. " and not test_api_endpoints"
  951. " and not test_graph_save_load"
  952. " and not test_graph_from_functions"
  953. " and not test_geometries"))))
  954. (propagated-inputs
  955. (list python-folium
  956. python-geopandas
  957. python-matplotlib
  958. python-networkx
  959. python-numpy
  960. python-pandas
  961. python-pyproj
  962. python-requests
  963. python-rtree
  964. python-shapely))
  965. (native-inputs
  966. (list python-numpy python-pytest))
  967. (home-page "https://github.com/gboeing/osmnx")
  968. (synopsis
  969. "Retrieve, model, analyze, and visualize OpenStreetMap street networks")
  970. (description
  971. "OSMnx is a Python library that lets you download geospatial data
  972. from OpenStreetMap and model, project, visualize, and analyze real-world
  973. street networks and any other geospatial geometries. You can download
  974. and model walkable, drivable, or bikeable urban networks with a single
  975. line of Python code then easily analyze and visualize them. You can
  976. just as easily download and work with other infrastructure types,
  977. amenities/points of interest, building footprints, elevation data,
  978. street bearings/orientations, and speed/travel time.")
  979. (license license:expat)))
  980. (define-public mapnik
  981. ;; There hasn't been a release since early 2021, and it fails to build with
  982. ;; Boost 1.77+.
  983. (let ((commit "81103491b467e17218140f50bc0bb9dc8c1f0317")
  984. (revision "0"))
  985. (package
  986. (name "mapnik")
  987. (version (git-version "3.1.0" revision commit))
  988. (source
  989. (origin
  990. (method git-fetch)
  991. (uri (git-reference
  992. (url "https://github.com/mapnik/mapnik")
  993. (commit commit)
  994. ;; TODO: Un-bundle mapbox dependencies (not yet packaged).
  995. (recursive? #t))) ;for mapbox dependencies and test data
  996. (file-name (git-file-name name version))
  997. (sha256
  998. (base32 "094nam57bdd5nak88qy33z2p3kjahk3vk2nk56m5jkcr5d3hlnx2"))))
  999. (build-system qt-build-system)
  1000. (arguments
  1001. (list
  1002. #:cmake cmake ;for FIND_PACKAGE_ARGS
  1003. #:configure-flags
  1004. #~(list (string-append "-DCMAKE_CXX_FLAGS=-I"
  1005. #$(this-package-native-input "catch2")
  1006. "/include/catch2"))
  1007. #:phases
  1008. #~(modify-phases %standard-phases
  1009. (add-after 'unpack 'use-system-catch2
  1010. (lambda _
  1011. (substitute* "test/CMakeLists.txt"
  1012. (("GIT_TAG.*v2.13.7" all)
  1013. (string-append all "\n"
  1014. " FIND_PACKAGE_ARGS NAMES Catch2"))
  1015. (("^include.*Catch2_SOURCE_DIR.*contrib/Catch.cmake.*")
  1016. "include(Catch)\n"))))
  1017. (add-after 'unpack 'disable-problematic-tests
  1018. (lambda _
  1019. ;; The 'ogr' test fails for unknown reasons. Mark it as
  1020. ;; expected to fail (see:
  1021. ;; https://github.com/mapnik/mapnik/issues/4329).
  1022. (substitute* "test/unit/datasource/ogr.cpp"
  1023. (("TEST_CASE\\(\"ogr\"" all)
  1024. (string-append all ", \"[!shouldfail]\""))))))))
  1025. (native-inputs
  1026. (list catch2
  1027. pkg-config
  1028. postgresql))
  1029. (inputs
  1030. (list boost
  1031. cairo
  1032. freetype
  1033. gdal
  1034. harfbuzz
  1035. icu4c
  1036. libjpeg-turbo
  1037. libpng
  1038. libtiff
  1039. libwebp
  1040. libxml2
  1041. proj
  1042. sqlite
  1043. zlib))
  1044. (home-page "https://mapnik.org/")
  1045. (synopsis "Toolkit for developing mapping applications")
  1046. (description "Mapnik is a toolkit for developing mapping applications. It
  1047. is basically a collection of geographic objects like maps, layers,
  1048. datasources, features, and geometries. At its core is a C++ shared library
  1049. providing algorithms and patterns for spatial data access and visualization.
  1050. The library does not rely on any specific windowing system and can be deployed
  1051. to any server environment. It is intended to play fair in a multi-threaded
  1052. environment and is aimed primarily, but not exclusively, at web-based
  1053. development.")
  1054. (license (list license:lgpl2.1+
  1055. ;; demo/viewer, demo/python/rundemo.py
  1056. license:gpl2+
  1057. ;; deps/boost, deps/mapbox, deps/agg/include/agg_conv_offset.h
  1058. license:boost1.0
  1059. ;; deps/mapnik/sparsehash
  1060. license:bsd-3
  1061. ;; deps/agg
  1062. (license:non-copyleft "file://deps/agg/copying"))))))
  1063. (define-public spatialite-gui
  1064. (package
  1065. (name "spatialite-gui")
  1066. (version "2.1.0-beta1")
  1067. (source
  1068. (origin
  1069. (method url-fetch)
  1070. (uri (string-append
  1071. "https://www.gaia-gis.it/gaia-sins/spatialite-gui-sources/"
  1072. "spatialite_gui-" version ".tar.gz"))
  1073. (sha256
  1074. (base32 "0cyv4cycl073p9lnnnglcb72qn71g8h9g5zn4gzw7swcy5nxjj5s"))))
  1075. (build-system gnu-build-system)
  1076. (native-inputs
  1077. (list pkg-config))
  1078. (inputs
  1079. (list curl
  1080. freexl
  1081. geos
  1082. giflib
  1083. libjpeg-turbo
  1084. librasterlite2
  1085. librttopo
  1086. libspatialite
  1087. libwebp
  1088. libxlsxwriter
  1089. libxml2
  1090. lz4
  1091. minizip
  1092. openjpeg
  1093. postgresql
  1094. proj
  1095. sqlite
  1096. virtualpg
  1097. wxwidgets
  1098. `(,zstd "lib")))
  1099. (arguments
  1100. `(#:phases (modify-phases %standard-phases
  1101. (add-after 'unpack 'fix-gui
  1102. (lambda _
  1103. ;; Fix for the GUI not showing up.
  1104. (substitute* "Main.cpp"
  1105. (("Hide\\(\\);") ""))
  1106. #t)))))
  1107. (synopsis "Graphical user interface for SpatiaLite")
  1108. (description "Spatialite-gui provides a visual interface for viewing and
  1109. maintaining a spatialite database. You can easily see the structure of the
  1110. tables and data contents using point and click functions, many of which
  1111. construct common SQL queries, or craft your own SQL queries.")
  1112. (home-page "https://www.gaia-gis.it/fossil/spatialite_gui/index")
  1113. (license license:gpl3+)))
  1114. (define-public gdal
  1115. (package
  1116. (name "gdal")
  1117. (version "3.6.1")
  1118. (source (origin
  1119. (method url-fetch)
  1120. (uri (string-append
  1121. "http://download.osgeo.org/gdal/" version "/gdal-"
  1122. version ".tar.gz"))
  1123. (sha256
  1124. (base32
  1125. "1qckwnygszxkkq40bf87s3m1sab6jj9jyakdvskh0qf7dq8zjarf"))
  1126. (modules '((guix build utils)))
  1127. (snippet
  1128. `(begin
  1129. ;; TODO: frmts contains a lot more bundled code.
  1130. (for-each delete-file-recursively
  1131. ;; bundled code
  1132. '("frmts/png/libpng"
  1133. "frmts/gif/giflib"
  1134. "frmts/jpeg/libjpeg"
  1135. "frmts/jpeg/libjpeg12"
  1136. "frmts/gtiff/libtiff"
  1137. "frmts/gtiff/libgeotiff"
  1138. "frmts/zlib"
  1139. "ogr/ogrsf_frmts/geojson/libjson"))))))
  1140. (build-system cmake-build-system)
  1141. (arguments
  1142. `(#:tests? #f
  1143. #:configure-flags
  1144. (list "-DGDAL_USE_INTERNAL_LIBS=WHEN_NO_EXTERNAL"
  1145. "-DGDAL_USE_JPEG12_INTERNAL=OFF")))
  1146. (inputs
  1147. (list curl
  1148. expat
  1149. freexl
  1150. geos
  1151. giflib
  1152. json-c
  1153. libgeotiff
  1154. libjpeg-turbo
  1155. libjxl
  1156. libpng
  1157. libtiff
  1158. libwebp
  1159. lz4
  1160. netcdf
  1161. openssl
  1162. openjpeg
  1163. pcre2
  1164. postgresql ; libpq
  1165. proj
  1166. qhull
  1167. sqlite
  1168. swig
  1169. zlib
  1170. zstd))
  1171. (native-inputs
  1172. (list pkg-config
  1173. python))
  1174. (propagated-inputs
  1175. (list python-numpy))
  1176. (home-page "https://gdal.org/")
  1177. (synopsis "Raster and vector geospatial data format library")
  1178. (description "GDAL is a translator library for raster and vector geospatial
  1179. data formats. As a library, it presents a single raster abstract data model
  1180. and single vector abstract data model to the calling application for all
  1181. supported formats. It also comes with a variety of useful command line
  1182. utilities for data translation and processing.")
  1183. (license (list
  1184. ;; general license
  1185. license:expat
  1186. ;; frmts/gtiff/tif_float.c, frmts/pcraster/libcsf,
  1187. ;; ogr/ogrsf_frmts/dxf/intronurbs.cpp, frmts/pdf/pdfdataset.cpp
  1188. ;; frmts/mrf/
  1189. license:bsd-3
  1190. ;; frmts/hdf4/hdf-eos/*
  1191. ;; similar to the expat license, but without guarantee exclusion
  1192. (license:non-copyleft "file://frmts/hdf4/hdf-eos/README")
  1193. ;; frmts/grib/degrib/
  1194. license:public-domain ; with guarantee exclusion
  1195. ;; port/cpl_minizip*
  1196. ;; Some bsd-inspired license
  1197. (license:non-copyleft "file://port/LICENCE_minizip")
  1198. ;; alg/internal_libqhull
  1199. ;; Some 5-clause license
  1200. (license:non-copyleft "file://alg/internal_libqhull/COPYING.txt")
  1201. ;; frmts/mrf/libLERC
  1202. license:asl2.0))))
  1203. (define-public python-pyshp
  1204. (package
  1205. (name "python-pyshp")
  1206. (version "2.1.3")
  1207. (source
  1208. (origin
  1209. (method git-fetch)
  1210. (uri (git-reference
  1211. (url "https://github.com/GeospatialPython/pyshp")
  1212. (commit version)))
  1213. (file-name (git-file-name name version))
  1214. (sha256
  1215. (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
  1216. (build-system python-build-system)
  1217. (arguments
  1218. `(#:phases
  1219. (modify-phases %standard-phases
  1220. (replace 'check
  1221. (lambda* (#:key tests? #:allow-other-keys)
  1222. (when tests?
  1223. ;; This is the only test file.
  1224. (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
  1225. (native-inputs
  1226. (list python-pytest python-pytest-runner))
  1227. (home-page "https://github.com/GeospatialPython/pyshp")
  1228. (synopsis "Read/write support for ESRI Shapefile format")
  1229. (description
  1230. "The Python Shapefile Library (PyShp) reads and writes ESRI Shapefiles.")
  1231. (license license:expat)))
  1232. (define-public python-cartopy
  1233. (package
  1234. (name "python-cartopy")
  1235. ;; This is a post-release fix that adds build_ext to setup.py.
  1236. (version "0.21.1")
  1237. (source
  1238. (origin
  1239. (method url-fetch)
  1240. (uri (pypi-uri "Cartopy" version))
  1241. (sha256
  1242. (base32 "02i5rjhvrsi3vgj8kfsdx77g1xl59jh2a671qqqj4n682abn9mc9"))))
  1243. (build-system python-build-system)
  1244. (arguments
  1245. `(#:phases
  1246. (modify-phases %standard-phases
  1247. (replace 'check
  1248. (lambda* (#:key inputs outputs tests? #:allow-other-keys)
  1249. (when tests?
  1250. (add-installed-pythonpath inputs outputs)
  1251. (invoke "python" "-m" "pytest" "--pyargs" "cartopy"
  1252. ;; These tests require online data.
  1253. "-m" "not natural_earth and not network"
  1254. "-k"
  1255. (string-append
  1256. ;; This one too but it's not marked as such.
  1257. "not test_gridliner_labels_bbox_style"
  1258. ;; Those tests fail with proj 9.2.0
  1259. ;; https://github.com/SciTools/cartopy/issues/2145
  1260. " and not test_epsg"
  1261. " and not test_default"
  1262. " and not test_eccentric_globe"
  1263. " and not test_ellipsoid_transform"
  1264. " and not test_eccentric_globe"))))))))
  1265. (propagated-inputs
  1266. (list python-matplotlib
  1267. python-numpy
  1268. python-pykdtree
  1269. python-pyproj
  1270. python-pyshp
  1271. python-scipy
  1272. python-shapely))
  1273. (inputs
  1274. (list geos))
  1275. (native-inputs
  1276. (list python-cython
  1277. python-flufl-lock
  1278. python-pytest
  1279. python-pytest-mpl))
  1280. (home-page "https://scitools.org.uk/cartopy/docs/latest/")
  1281. (synopsis "Cartographic library for visualisation")
  1282. (description
  1283. "Cartopy is a Python package designed to make drawing maps for data
  1284. analysis and visualisation easy.
  1285. It features:
  1286. @itemize
  1287. @item object oriented projection definitions
  1288. @item point, line, polygon and image transformations between projections
  1289. @item integration to expose advanced mapping in Matplotlib with a simple and
  1290. intuitive interface
  1291. @item powerful vector data handling by integrating shapefile reading with
  1292. Shapely capabilities
  1293. @end itemize")
  1294. (license license:lgpl3+)))
  1295. (define-public postgis
  1296. (package
  1297. (name "postgis")
  1298. (version "3.2.1")
  1299. (source (origin
  1300. (method url-fetch)
  1301. (uri (string-append "https://download.osgeo.org/postgis/source/postgis-"
  1302. version ".tar.gz"))
  1303. (sha256
  1304. (base32
  1305. "0gl9d6xy2an82ldb9sixz5blyngjryq8m3509fr38ffawvfniazv"))))
  1306. (build-system gnu-build-system)
  1307. (arguments
  1308. `(#:tests? #f
  1309. #:make-flags
  1310. (list (string-append "datadir=" (assoc-ref %outputs "out") "/share")
  1311. (string-append "docdir="(assoc-ref %outputs "out") "/share/doc")
  1312. (string-append "pkglibdir="(assoc-ref %outputs "out") "/lib")
  1313. (string-append "bindir=" (assoc-ref %outputs "out") "/bin"))
  1314. #:phases
  1315. (modify-phases %standard-phases
  1316. (add-before 'build 'fix-install-path
  1317. (lambda* (#:key outputs #:allow-other-keys)
  1318. (substitute* '("raster/loader/Makefile" "raster/scripts/python/Makefile")
  1319. (("\\$\\(DESTDIR\\)\\$\\(PGSQL_BINDIR\\)")
  1320. (string-append (assoc-ref outputs "out") "/bin"))))))))
  1321. (inputs
  1322. (list gdal
  1323. geos
  1324. giflib
  1325. json-c
  1326. libjpeg-turbo
  1327. libxml2
  1328. openssl
  1329. pcre
  1330. postgresql
  1331. protobuf-c
  1332. proj))
  1333. (native-inputs
  1334. (list perl pkg-config))
  1335. (home-page "https://postgis.net")
  1336. (synopsis "Spatial database extender for PostgreSQL")
  1337. (description "PostGIS is a spatial database extender for PostgreSQL
  1338. object-relational database. It adds support for geographic objects allowing
  1339. location queries to be run in SQL. This package provides a PostgreSQL
  1340. extension.")
  1341. (license (list
  1342. ;; General license
  1343. license:gpl2+
  1344. ;; loader/dbfopen, safileio.*, shapefil.h, shpopen.c
  1345. license:expat
  1346. ;; loader/getopt.*
  1347. license:public-domain
  1348. ;; doc/xsl
  1349. license:bsd-3 ; files only say "BSD"
  1350. ;; doc
  1351. license:cc-by-sa3.0))))
  1352. (define-public tegola
  1353. (package
  1354. (name "tegola")
  1355. (version "0.16.0")
  1356. (source (origin
  1357. (method git-fetch)
  1358. (uri (git-reference
  1359. (url "https://github.com/go-spatial/tegola")
  1360. (commit (string-append "v" version))))
  1361. (file-name (git-file-name name version))
  1362. (sha256
  1363. (base32
  1364. "1mjfn0izf1lj402845mx0cv9fald8s5443q35y16d9crqf3i6mav"))))
  1365. (build-system go-build-system)
  1366. (arguments
  1367. `(#:import-path "github.com/go-spatial/tegola/cmd/tegola"
  1368. #:unpack-path "github.com/go-spatial/tegola"
  1369. #:build-flags '(,(string-append "-ldflags=-X github.com/go-spatial/tegola/internal/build.Version=" version))
  1370. #:install-source? #f))
  1371. (home-page "https://tegola.io")
  1372. (synopsis "Vector tile server for maps")
  1373. (description "Tegola is a free vector tile server written in Go. Tegola
  1374. takes geospatial data and slices it into vector tiles that can be efficiently
  1375. delivered to any client.")
  1376. (license (list
  1377. license:expat
  1378. ;; Some packages in vendor have other licenses
  1379. license:asl2.0
  1380. license:bsd-2
  1381. license:bsd-3
  1382. license:wtfpl2))))
  1383. (define-public imposm3
  1384. (package
  1385. (name "imposm3")
  1386. (version "0.11.1")
  1387. (source
  1388. (origin
  1389. (method git-fetch)
  1390. (uri (git-reference
  1391. (url "https://github.com/omniscale/imposm3")
  1392. (commit (string-append "v" version))))
  1393. (file-name (git-file-name name version))
  1394. (sha256
  1395. (base32
  1396. "1ifniw57l3s0sl7nb3zwxxm86i46451yrhfqnnkxr46cnpbzmwxr"))))
  1397. (build-system go-build-system)
  1398. (arguments
  1399. `(#:import-path "github.com/omniscale/imposm3/cmd/imposm"
  1400. #:unpack-path "github.com/omniscale/imposm3"
  1401. #:phases
  1402. (modify-phases %standard-phases
  1403. (add-before 'build 'set-version
  1404. (lambda _
  1405. (substitute* "src/github.com/omniscale/imposm3/version.go"
  1406. (("0.0.0-dev") ,version))
  1407. #t)))))
  1408. (inputs
  1409. (list geos leveldb))
  1410. (home-page "https://imposm.org/")
  1411. (synopsis "OpenStreetMap importer for PostGIS")
  1412. (description "Imposm is an importer for OpenStreetMap data. It reads PBF
  1413. files and imports the data into PostgreSQL/PostGIS databases. It is designed
  1414. to create databases that are optimized for rendering/tile/map-services.")
  1415. (license (list
  1416. license:asl2.0
  1417. ;; Some dependencies in vendor have different licenses
  1418. license:expat
  1419. license:bsd-2
  1420. license:bsd-3))))
  1421. (define-public libosmium
  1422. (package
  1423. (name "libosmium")
  1424. (version "2.18.0")
  1425. (source
  1426. (origin
  1427. (method git-fetch)
  1428. (uri (git-reference
  1429. (url "https://github.com/osmcode/libosmium")
  1430. (commit (string-append "v" version))))
  1431. (file-name (git-file-name name version))
  1432. (sha256
  1433. (base32 "0fh57mpii1ksacwfx5rz213j896aklib53jbybld2i517q2mmxr0"))))
  1434. (build-system cmake-build-system)
  1435. (propagated-inputs
  1436. (list boost
  1437. bzip2
  1438. expat
  1439. gdal
  1440. geos
  1441. lz4
  1442. proj
  1443. protozero
  1444. sparsehash
  1445. utfcpp
  1446. zlib))
  1447. (native-inputs
  1448. (list doxygen))
  1449. (home-page "https://osmcode.org/libosmium/")
  1450. (synopsis "C++ library for working with OpenStreetMap data")
  1451. (description "Libosmium is a fast and flexible C++ library for working with
  1452. OpenStreetMap data.")
  1453. (license license:boost1.0)))
  1454. (define-public osmium-tool
  1455. (package
  1456. (name "osmium-tool")
  1457. (version "1.14.0")
  1458. (source
  1459. (origin
  1460. (method git-fetch)
  1461. (uri (git-reference
  1462. (url "https://github.com/osmcode/osmium-tool")
  1463. (commit (string-append "v" version))))
  1464. (file-name (git-file-name name version))
  1465. (sha256
  1466. (base32 "0zgyqyrs89vch0qnkh9m5xq079sr2wmydy5zz4l8xbysbjf6xry5"))
  1467. (modules '((guix build utils)))
  1468. (snippet
  1469. ;; Remove bundled libraries.
  1470. '(delete-file-recursively "include/rapidjson"))))
  1471. (build-system cmake-build-system)
  1472. (inputs
  1473. (list libosmium
  1474. rapidjson))
  1475. (native-inputs
  1476. (list pandoc))
  1477. (home-page "https://osmcode.org/osmium-tool/")
  1478. (synopsis "Osmium command-line tool")
  1479. (description "Command line tool for working with OpenStreetMap data
  1480. based on the Osmium library.")
  1481. (license license:gpl3+)))
  1482. (define-public osm2pgsql
  1483. (package
  1484. (name "osm2pgsql")
  1485. (version "1.8.0")
  1486. (source
  1487. (origin
  1488. (method git-fetch)
  1489. (uri (git-reference
  1490. (url "https://github.com/openstreetmap/osm2pgsql")
  1491. (commit version)))
  1492. (file-name (git-file-name name version))
  1493. (sha256
  1494. (base32 "0ssz7ny4wx8dzl3027p37xc5h7m1aj6bzxzdc6g8fbp7q57ykvxz"))
  1495. (modules '((guix build utils)))
  1496. (snippet
  1497. ;; Remove bundled libraries.
  1498. '(delete-file-recursively "contrib"))))
  1499. (build-system cmake-build-system)
  1500. (arguments
  1501. `(#:tests? #f; tests fail because we need to setup a database
  1502. #:configure-flags
  1503. (list "-DEXTERNAL_LIBOSMIUM=ON"
  1504. "-DEXTERNAL_PROTOZERO=ON"
  1505. "-DEXTERNAL_FMT=ON")))
  1506. (inputs
  1507. (list boost
  1508. bzip2
  1509. expat
  1510. fmt-8
  1511. libosmium
  1512. lua
  1513. postgresql
  1514. proj
  1515. protozero
  1516. zlib))
  1517. (native-inputs
  1518. (list python python-psycopg2))
  1519. (home-page "https://github.com/openstreetmap/osm2pgsql")
  1520. (synopsis "OSM data importer to postgresql")
  1521. (description "Osm2pgsql is a tool for loading OpenStreetMap data into a
  1522. PostgreSQL / PostGIS database suitable for applications like rendering into a
  1523. map, geocoding with Nominatim, or general analysis.")
  1524. (license license:gpl2+)))
  1525. (define-public tippecanoe
  1526. (package
  1527. (name "tippecanoe")
  1528. (version "2.17.0")
  1529. (source
  1530. (origin
  1531. (method git-fetch)
  1532. (uri (git-reference
  1533. (url "https://github.com/felt/tippecanoe")
  1534. (commit version)))
  1535. (file-name (git-file-name name version))
  1536. (sha256
  1537. (base32 "1q2snvsbs10l9pjydid3zxkidlha5hav8gvb0p731m2pwg3xw0qr"))))
  1538. (build-system gnu-build-system)
  1539. (arguments
  1540. `(#:phases
  1541. (modify-phases %standard-phases (delete 'configure))
  1542. #:test-target "test"
  1543. #:make-flags
  1544. (list (string-append "CC=" ,(cc-for-target))
  1545. (string-append "PREFIX=" (assoc-ref %outputs "out")))))
  1546. (inputs
  1547. (list perl sqlite zlib))
  1548. (home-page "https://github.com/mapbox/tippecanoe")
  1549. (synopsis "Vector tile server for maps")
  1550. (description "Tippecanoe creates scale-independent view of data, so that
  1551. the texture and density of features is visible at every zoom level, instead of
  1552. dropping features at lower levels.")
  1553. (license license:bsd-2)))
  1554. (define-public osmctools
  1555. (package
  1556. (name "osmctools")
  1557. (version "0.9")
  1558. (source
  1559. (origin
  1560. (method git-fetch)
  1561. (uri (git-reference
  1562. (url "https://gitlab.com/osm-c-tools/osmctools")
  1563. (commit version)))
  1564. (file-name (git-file-name name version))
  1565. (sha256
  1566. (base32
  1567. "1m8d3r1q1v05pkr8k9czrmb4xjszw6hvgsf3kn9pf0v14gpn4r8f"))))
  1568. (build-system gnu-build-system)
  1569. (native-inputs
  1570. (list autoconf automake))
  1571. (inputs
  1572. (list zlib))
  1573. (home-page "https://gitlab.com/osm-c-tools/osmctools")
  1574. (synopsis "Tools to convert, filter and update OpenStreetMap data files")
  1575. (description "This project contains a few tools which are used in the
  1576. OpenStreetMap project. They can be used to convert, filter and update
  1577. OpenStreetMap data files.")
  1578. (license license:agpl3)))
  1579. (define-public osm-gps-map
  1580. (package
  1581. (name "osm-gps-map")
  1582. (version "1.1.0")
  1583. (source
  1584. (origin
  1585. (method url-fetch)
  1586. (uri (string-append
  1587. "https://github.com/nzjrs/osm-gps-map/releases/download/"
  1588. version "/osm-gps-map-" version ".tar.gz"))
  1589. (sha256
  1590. (base32
  1591. "11imsf4cz1dpxdjh178k2s29axmq86rkfg1pqmn7incyxmjzhbwg"))))
  1592. (build-system gnu-build-system)
  1593. (native-inputs
  1594. (list gnome-common gtk-doc/stable pkg-config))
  1595. (inputs
  1596. (list cairo glib gobject-introspection gtk+ libsoup-minimal-2))
  1597. (home-page "https://nzjrs.github.io/osm-gps-map/")
  1598. (synopsis "GTK+ widget for displaying OpenStreetMap tiles")
  1599. (description
  1600. "This package provides a GTK+ widget (and Python bindings) that when
  1601. given GPS coordinates,draws a GPS track, and points of interest on a moving
  1602. map display. Downloads map data from a number of websites, including
  1603. @url{https://www.openstreetmap.org}.")
  1604. (license license:gpl2+)))
  1605. (define-public xygrib
  1606. (package
  1607. (name "xygrib")
  1608. (version "1.2.6.1")
  1609. (source (origin
  1610. (method git-fetch)
  1611. (uri (git-reference
  1612. (url "https://github.com/opengribs/XyGrib")
  1613. (commit (string-append "v" version))))
  1614. (file-name (git-file-name name version))
  1615. (sha256
  1616. (base32
  1617. "0xzsm8pr0zjk3f8j880fg5n82jyxn8xf1330qmmq1fqv7rsrg9ia"))
  1618. (patches (search-patches "xygrib-fix-finding-data.patch"
  1619. "xygrib-newer-proj.patch"))
  1620. (modules '((guix build utils)))
  1621. (snippet
  1622. '(begin
  1623. (delete-file-recursively "data/fonts")
  1624. ;; Fixes compilation, can be removed with the next release.
  1625. ;; Upstream link: https://github.com/opengribs/XyGrib/pull/255
  1626. (substitute* "src/SkewT.h"
  1627. (("QMessageBox>") "QMessageBox>\n#include <QPainterPath>"))
  1628. ;; Accept newer versions of openjpeg
  1629. ;; https://github.com/opengribs/XyGrib/pull/298
  1630. (substitute* "CMakeLists.txt"
  1631. (("openjpeg-2.4") "openjpeg-2.5 openjpeg-2.4"))))))
  1632. (build-system cmake-build-system)
  1633. (arguments
  1634. `(#:configure-flags (list "-DGNU_PACKAGE=ON")
  1635. #:phases
  1636. (modify-phases %standard-phases
  1637. (add-after 'unpack 'patch-directories
  1638. (lambda* (#:key inputs #:allow-other-keys)
  1639. (let ((jpeg (assoc-ref inputs "openjpeg"))
  1640. (font (assoc-ref inputs "font-liberation")))
  1641. (substitute* "CMakeLists.txt"
  1642. ;; Skip looking for the static library.
  1643. (("\"libnova.a\"") ""))
  1644. ;; Don't use the bundled font-liberation.
  1645. (substitute* "src/util/Font.cpp"
  1646. (("Util::pathFonts\\(\\)\\+\"liberation-fonts/\"")
  1647. (string-append "\"" font "/share/fonts/truetype/\"")))
  1648. (substitute* "src/util/Util.h"
  1649. (("pathData\\(\\)\\+\"data/fonts/\"")
  1650. (string-append "\"" font "/share/fonts/\"")))))))
  1651. #:tests? #f)) ; no tests
  1652. (native-inputs
  1653. (list qttools-5))
  1654. (inputs
  1655. (list bzip2
  1656. font-liberation
  1657. libnova
  1658. libpng
  1659. openjpeg
  1660. proj
  1661. qtbase-5
  1662. zlib))
  1663. (native-search-paths
  1664. (list (search-path-specification
  1665. (variable "XDG_DATA_DIRS")
  1666. (files '("share")))))
  1667. (synopsis "Weather Forecast Visualization")
  1668. (description
  1669. "XyGrib is a Grib file reader and visualizes meteorological data providing
  1670. an off-line capability to analyse weather forecasts or hindcasts. It is
  1671. intended to be used as a capable weather work station for anyone with a serious
  1672. interest in examining weather. This would include members of the sailing
  1673. community, private and sport aviators, farmers, weather buffs and many more.
  1674. XyGrib is the continuation of the zyGrib software package with a new team of
  1675. volunteers.")
  1676. (home-page "https://opengribs.org")
  1677. (license license:gpl3+)))
  1678. (define-public libspatialindex
  1679. (package
  1680. (name "libspatialindex")
  1681. (version "1.9.3")
  1682. (source
  1683. (origin
  1684. (method url-fetch)
  1685. (uri (string-append "https://github.com/libspatialindex/libspatialindex/"
  1686. "releases/download/" version "/spatialindex-src-"
  1687. version ".tar.bz2"))
  1688. (sha256
  1689. (base32
  1690. "02n5vjcyk04w0djidyp21hfbxfpbbara8ifd9nml6158rwqr8lja"))))
  1691. (build-system cmake-build-system)
  1692. (home-page "https://libspatialindex.org")
  1693. (synopsis "Spatial indexing library")
  1694. (description "The purpose of this library is to provide:
  1695. @itemize
  1696. @item An extensible framework that will support robust spatial indexing
  1697. methods.
  1698. @item Support for sophisticated spatial queries. Range, point location,
  1699. nearest neighbor and k-nearest neighbor as well as parametric queries (defined
  1700. by spatial constraints) should be easy to deploy and run.
  1701. @item Easy to use interfaces for inserting, deleting and updating information.
  1702. @item Wide variety of customization capabilities. Basic index and storage
  1703. characteristics like the page size, node capacity, minimum fan-out, splitting
  1704. algorithm, etc. should be easy to customize.
  1705. @item Index persistence. Internal memory and external memory structures
  1706. should be supported. Clustered and non-clustered indices should be easy to be
  1707. persisted.
  1708. @end itemize
  1709. ")
  1710. (license license:expat)))
  1711. (define-public python-rtree
  1712. (package
  1713. (name "python-rtree")
  1714. (version "1.0.1")
  1715. (source
  1716. (origin
  1717. (method url-fetch)
  1718. (uri (pypi-uri "Rtree" version))
  1719. (sha256
  1720. (base32 "0aalh07fyf6vpr0a6zswnqvvrjhyic1zg6w4bl368fihkilj2892"))))
  1721. (build-system pyproject-build-system)
  1722. (arguments
  1723. `(#:phases
  1724. (modify-phases %standard-phases
  1725. (add-after 'unpack 'find-libspatialindex
  1726. (lambda* (#:key inputs #:allow-other-keys)
  1727. (let ((libspatialindex (assoc-ref inputs "libspatialindex")))
  1728. (substitute* "rtree/finder.py"
  1729. (("find_library\\(\"spatialindex_c\"\\)")
  1730. (string-append "\"" libspatialindex
  1731. "/lib/libspatialindex_c.so\"")))))))))
  1732. (native-inputs
  1733. (list python-numpy python-pytest python-wheel))
  1734. (inputs
  1735. (list libspatialindex))
  1736. (home-page "https://github.com/Toblerity/rtree")
  1737. (synopsis "R-Tree spatial index for Python GIS")
  1738. (description
  1739. "RTree is a Python package with bindings for @code{libspatialindex}.")
  1740. (license license:expat)))
  1741. (define-public java-jmapviewer
  1742. (package
  1743. (name "java-jmapviewer")
  1744. (version "2.13")
  1745. (source (origin
  1746. (method url-fetch)
  1747. (uri (string-append "https://svn.openstreetmap.org/applications/"
  1748. "viewer/jmapviewer/releases/" version
  1749. "/JMapViewer-" version "-Source.zip"))
  1750. (sha256
  1751. (base32
  1752. "0sy6r5fkbb9bclw0is6gwnbzz627m7pjfnsqydxz58pbndakkhrv"))))
  1753. (build-system ant-build-system)
  1754. (native-inputs
  1755. (list unzip))
  1756. (arguments
  1757. `(#:build-target "pack"
  1758. #:tests? #f; No tests
  1759. #:phases
  1760. (modify-phases %standard-phases
  1761. (add-before 'build 'clean
  1762. (lambda* _
  1763. (invoke "ant" "clean")))
  1764. (replace 'install
  1765. (lambda* (#:key outputs #:allow-other-keys)
  1766. (let ((dir (string-append (assoc-ref outputs "out") "/share/java/")))
  1767. (mkdir-p dir)
  1768. (copy-file "JMapViewer.jar" (string-append dir "JMapViewer.jar"))
  1769. #t))))))
  1770. (home-page "https://wiki.openstreetmap.org/wiki/JMapViewer")
  1771. (synopsis "OSM map integration in Java")
  1772. (description "JMapViewer is a Java component which easily
  1773. integrates an OSM map view into your Java application. It is maintained as
  1774. an independent project by the JOSM team.")
  1775. (license license:gpl2)))
  1776. (define-public java-opening-hours-parser
  1777. (package
  1778. (name "java-opening-hours-parser")
  1779. (version "0.27.0")
  1780. (source (origin
  1781. (method git-fetch)
  1782. (uri (git-reference
  1783. (url "https://github.com/simonpoole/OpeningHoursParser")
  1784. (commit version)))
  1785. (file-name (git-file-name name version))
  1786. (sha256
  1787. (base32
  1788. "1sw5ccxqw4ly5hzxnnljjqx4876gyvagi10sg8r9w25n211lq0x4"))))
  1789. (build-system ant-build-system)
  1790. (arguments
  1791. `(#:jar-name "java-opening-hours-parser.jar"
  1792. #:source-dir "src/main/java"
  1793. #:test-exclude (list "**/IndividualTest.java")
  1794. #:phases
  1795. (modify-phases %standard-phases
  1796. (add-before 'build 'copy-resources
  1797. (lambda _
  1798. (copy-recursively "src/main/resources" "build/classes")
  1799. #t))
  1800. (add-before 'build 'generate-parser
  1801. (lambda* _
  1802. (let* ((dir "src/main/java/ch/poole/openinghoursparser")
  1803. (file (string-append dir "/OpeningHoursParser.jj")))
  1804. (invoke "javacc" "-DEBUG_PARSER=false"
  1805. "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
  1806. "-GRAMMAR_ENCODING=UTF-8"
  1807. (string-append "-OUTPUT_DIRECTORY=" dir)
  1808. file)))))))
  1809. (inputs
  1810. (list java-jetbrains-annotations))
  1811. (native-inputs
  1812. (list javacc java-junit java-hamcrest-core))
  1813. (home-page "https://github.com/simonpoole/OpeningHoursParser")
  1814. (synopsis "Java parser for the OpenStreetMap opening hour format")
  1815. (description "This is a very simplistic parser for string values according
  1816. to the OSM opening hours specification.")
  1817. (license license:expat)))
  1818. (define-public josm
  1819. (package
  1820. (name "josm")
  1821. (version "18646")
  1822. (source (origin
  1823. (method svn-fetch)
  1824. (uri (svn-reference
  1825. (url "https://josm.openstreetmap.de/svn/trunk")
  1826. (revision (string->number version))
  1827. (recursive? #f)))
  1828. (sha256
  1829. (base32
  1830. "0zr3p1i39wi0f29lgb3xrnv6lijrq5ia8jxn4wnq1yz0xdlbg98i"))
  1831. (file-name (string-append name "-" version "-checkout"))
  1832. (modules '((guix build utils)))
  1833. (snippet
  1834. '(begin
  1835. (for-each delete-file (find-files "." ".*.jar$"))
  1836. #t))))
  1837. (build-system ant-build-system)
  1838. (native-inputs
  1839. (list javacc))
  1840. (inputs
  1841. (list java-commons-jcs
  1842. java-commons-compress
  1843. java-jmapviewer
  1844. java-jsonp-api
  1845. java-jsonp-impl ; runtime dependency
  1846. java-jsr305
  1847. java-metadata-extractor
  1848. java-opening-hours-parser
  1849. java-openjfx-media
  1850. java-signpost-core
  1851. java-svg-salamander))
  1852. (arguments
  1853. `(#:tests? #f
  1854. #:jar-name "josm.jar"
  1855. #:phases
  1856. (modify-phases %standard-phases
  1857. (add-after 'unpack 'rm-build.xml
  1858. (lambda* _
  1859. (delete-file "build.xml")
  1860. #t))
  1861. (add-before 'build 'fix-revision
  1862. (lambda* _
  1863. (with-output-to-file "REVISION.XML"
  1864. (lambda _
  1865. (display
  1866. (string-append "<info><entry><commit revision=\"" ,version "\">"
  1867. "<date>1970-01-01 00:00:00 +0000</date>"
  1868. "</commit></entry></info>"))))
  1869. #t))
  1870. (add-before 'build 'fix-classpath
  1871. (lambda* (#:key inputs #:allow-other-keys)
  1872. (setenv "CLASSPATH"
  1873. (string-join
  1874. (filter
  1875. (lambda (s)
  1876. (let ((source (assoc-ref inputs "source")))
  1877. (not (equal? (substring s 0 (string-length source))
  1878. source))))
  1879. (string-split (getenv "CLASSPATH") #\:))
  1880. ":"))
  1881. #t))
  1882. (add-before 'build 'generate-parser
  1883. (lambda* _
  1884. (let* ((dir "src/org/openstreetmap/josm/gui/mappaint/mapcss")
  1885. (out (string-append dir "/parsergen"))
  1886. (file (string-append dir "/MapCSSParser.jj")))
  1887. (mkdir-p "src/org/openstreetmap/josm/gui/mappaint/mapcss/parsergen")
  1888. (invoke "javacc" "-DEBUG_PARSER=false"
  1889. "-DEBUG_TOKEN_MANAGER=false" "-JDK_VERSION=1.8"
  1890. "-GRAMMAR_ENCODING=UTF-8"
  1891. (string-append "-OUTPUT_DIRECTORY=" out)
  1892. file))
  1893. #t))
  1894. (add-after 'build 'generate-epsg
  1895. (lambda _
  1896. (system* "javac" "scripts/BuildProjectionDefinitions.java"
  1897. "-cp" "build/classes")
  1898. (mkdir-p "data/projection")
  1899. (with-output-to-file "data/projection/custom-epsg"
  1900. (lambda _ (display "")))
  1901. (invoke "java" "-cp" "build/classes:scripts:."
  1902. "BuildProjectionDefinitions" ".")
  1903. #t))
  1904. (add-after 'generate-epsg 'copy-resources
  1905. (lambda _
  1906. (copy-recursively "resources" "build/classes")
  1907. #t))
  1908. (add-before 'install 'regenerate-jar
  1909. (lambda _
  1910. ;; We need to regenerate the jar file to add data.
  1911. (delete-file "build/jar/josm.jar")
  1912. (invoke "jar" "-cf" "build/jar/josm.jar" "-C"
  1913. "build/classes" ".")
  1914. #t))
  1915. (add-before 'build 'copy-revision
  1916. (lambda _
  1917. (mkdir-p "build/classes")
  1918. (with-output-to-file "build/classes/REVISION"
  1919. (lambda _
  1920. (display
  1921. (string-append "Revision: " ,version "\n"
  1922. "Is-Local-Build: true\n"
  1923. "Build-Date: 1970-01-01 00:00:00 +0000\n"))))
  1924. #t))
  1925. (add-after 'install 'install-share-directories
  1926. (lambda* (#:key outputs #:allow-other-keys)
  1927. (let ((out (assoc-ref outputs "out"))
  1928. (share-directories '("applications" "icons" "man" "menu"
  1929. "metainfo" "mime" "pixmaps"))
  1930. (desktop "org.openstreetmap.josm.desktop"))
  1931. (for-each (lambda (directory)
  1932. (copy-recursively (string-append
  1933. "native/linux/tested/usr/share/"
  1934. directory)
  1935. (string-append
  1936. out "/share/" directory)))
  1937. share-directories)
  1938. (substitute* (string-append out "/share/applications/" desktop)
  1939. (("josm-MainApplication") "josm-gui-MainApplication")))
  1940. #t))
  1941. (add-after 'install 'install-bin
  1942. (lambda* (#:key outputs inputs #:allow-other-keys)
  1943. (let* ((out (assoc-ref outputs "out"))
  1944. (bin (string-append out "/bin")))
  1945. (mkdir-p bin)
  1946. (with-output-to-file (string-append bin "/josm")
  1947. (lambda _
  1948. (display
  1949. (string-append "#!/bin/sh\n"
  1950. (assoc-ref inputs "jdk") "/bin/java"
  1951. " -cp " out "/share/java/josm.jar:"
  1952. (getenv "CLASSPATH")
  1953. " org.openstreetmap.josm.gui.MainApplication"))))
  1954. (chmod (string-append bin "/josm") #o755))
  1955. #t)))))
  1956. (home-page "https://josm.openstreetmap.de")
  1957. (synopsis "OSM editor")
  1958. (description "JOSM is an extensible editor for OpenStreetMap (OSM). It
  1959. supports loading GPX tracks, background imagery and OSM data from local
  1960. sources as well as from online sources and allows editing the OSM data (nodes,
  1961. ways, and relations) and their metadata tags.")
  1962. (license license:gpl2+)))
  1963. (define-public libmaxminddb
  1964. (package
  1965. (name "libmaxminddb")
  1966. (version "1.6.0")
  1967. (source
  1968. (origin
  1969. (method url-fetch)
  1970. (uri (string-append "https://github.com/maxmind/libmaxminddb"
  1971. "/releases/download/" version "/"
  1972. "/libmaxminddb-" version ".tar.gz"))
  1973. (sha256
  1974. (base32 "0rw2z7rx8jzgdcgqlmc4wqrsjmiwd8vm5wvvrldy472rghcaq83n"))))
  1975. (build-system gnu-build-system)
  1976. (arguments
  1977. `(#:make-flags
  1978. (list ,(string-append "CC=" (cc-for-target)))))
  1979. (native-inputs
  1980. (list perl))
  1981. (home-page "https://maxmind.github.io/libmaxminddb/")
  1982. (synopsis "C library for the MaxMind DB file format")
  1983. (description "The libmaxminddb library provides a C library for reading
  1984. MaxMind DB files, including the GeoIP2 databases from MaxMind. The MaxMind DB
  1985. format is a custom, but open, binary format designed to facilitate fast
  1986. lookups of IP addresses while allowing flexibility in the type of data
  1987. associated with an address.")
  1988. (license license:asl2.0)))
  1989. (define-public python-maxminddb
  1990. (package
  1991. (name "python-maxminddb")
  1992. (version "2.2.0")
  1993. (source
  1994. (origin
  1995. (method url-fetch)
  1996. (uri (pypi-uri "maxminddb" version))
  1997. (sha256
  1998. (base32
  1999. "1rc4a403r3b4vhmhb03gidd0fmsbvfpbf3qfcw25h4db9zn0fxz3"))))
  2000. (build-system python-build-system)
  2001. (arguments
  2002. `(#:tests? #f)) ;; Tests require a copy of the maxmind database
  2003. (inputs
  2004. (list libmaxminddb))
  2005. (home-page "https://www.maxmind.com/")
  2006. (synopsis "Reader for the MaxMind DB format")
  2007. (description "MaxMind DB is a binary file format that stores data indexed
  2008. by IP address subnets (IPv4 or IPv6). This is a Python module for reading
  2009. MaxMind DB files.")
  2010. (license license:asl2.0)))
  2011. (define-public python-geoip2
  2012. (package
  2013. (name "python-geoip2")
  2014. (version "2.9.0")
  2015. (source
  2016. (origin
  2017. (method url-fetch)
  2018. (uri (pypi-uri "geoip2" version))
  2019. (sha256
  2020. (base32
  2021. "1w7cay5q6zawjzivqbwz5cqx1qbdjw6kbriccb7l46p7b39fkzzp"))))
  2022. (build-system python-build-system)
  2023. (arguments
  2024. `(#:tests? #f)) ;; Tests require a copy of the maxmind database
  2025. (inputs
  2026. (list python-maxminddb python-requests))
  2027. (home-page "https://www.maxmind.com/")
  2028. (synopsis "MaxMind GeoIP2 API")
  2029. (description "Provides an API for the GeoIP2 web services and databases.
  2030. The API also works with MaxMind’s free GeoLite2 databases.")
  2031. (license license:asl2.0)))
  2032. (define-public routino
  2033. (package
  2034. (name "routino")
  2035. (version "3.3.3")
  2036. (source
  2037. (origin
  2038. (method url-fetch)
  2039. (uri (string-append "http://www.routino.org/download/routino-"
  2040. version ".tgz"))
  2041. (sha256
  2042. (base32 "1xa7l2bjn832nk6bc7b481nv8hd2gj41jwhg0d2qy10lqdvjpn5b"))))
  2043. (build-system gnu-build-system)
  2044. (native-inputs
  2045. (list perl))
  2046. (inputs
  2047. (list bzip2 xz zlib))
  2048. (arguments
  2049. `(#:test-target "test"
  2050. #:phases
  2051. (modify-phases %standard-phases
  2052. (replace 'configure
  2053. (lambda* (#:key outputs #:allow-other-keys)
  2054. (substitute* "Makefile.conf"
  2055. (("prefix=/usr/local")
  2056. (string-append "prefix=" (assoc-ref outputs "out")))
  2057. (("LDFLAGS_LDSO=-Wl,-R\\.")
  2058. "LDFLAGS_LDSO=-Wl,-R$(libdir)")
  2059. (("#CFLAGS\\+=-DUSE_XZ")
  2060. "CFLAGS+=-DUSE_XZ")
  2061. (("#LDFLAGS\\+=-llzma")
  2062. "LDFLAGS+=-llzma"))
  2063. #t)))))
  2064. (synopsis "Routing application for OpenStreetMap data")
  2065. (description
  2066. "Routino is an application for finding a route between two points
  2067. using the dataset of topographical information collected by
  2068. @url{https://www.OpenStreetMap.org}.")
  2069. (home-page "https://www.routino.org/")
  2070. (license license:agpl3+)))
  2071. (define-public qmapshack
  2072. (package
  2073. (name "qmapshack")
  2074. (version "1.16.1")
  2075. (source
  2076. (origin
  2077. (method git-fetch)
  2078. (uri (git-reference
  2079. (url "https://github.com/Maproom/qmapshack")
  2080. (commit (string-append "V_" version))))
  2081. (file-name (git-file-name name version))
  2082. (sha256
  2083. (base32 "184fqmsfzr3b333ssizjk6gvv7mncmygq8dj5r7rsvs5md26z2ys"))))
  2084. (build-system qt-build-system)
  2085. (native-inputs
  2086. (list pkg-config qttools-5))
  2087. (inputs
  2088. (list curl
  2089. gdal
  2090. libjpeg-turbo
  2091. proj
  2092. qtbase-5
  2093. qtdeclarative-5
  2094. qtlocation
  2095. qtwebchannel-5
  2096. qtwebengine-5
  2097. quazip
  2098. routino
  2099. sqlite ; See wrap phase
  2100. zlib))
  2101. (arguments
  2102. `(#:tests? #f
  2103. #:phases
  2104. (modify-phases %standard-phases
  2105. (add-after 'unpack 'fix-cmake-modules
  2106. (lambda* (#:key inputs #:allow-other-keys)
  2107. (substitute* "CMakeLists.txt"
  2108. (("find_package\\(Qt5PrintSupport REQUIRED\\)" all)
  2109. (string-append all "\nfind_package(Qt5Positioning REQUIRED)")))
  2110. (substitute* "cmake/Modules/FindROUTINO.cmake"
  2111. (("/usr/local")
  2112. (assoc-ref inputs "routino"))))))))
  2113. (synopsis "GPS mapping application")
  2114. (description
  2115. "QMapShack can be used to plan your next outdoor trip or to visualize and
  2116. archive all the GPS recordings of your past trips. It is the successor of the
  2117. QLandkarte GT application.")
  2118. (home-page "https://github.com/Maproom/qmapshack/wiki")
  2119. (license license:gpl3+)))
  2120. (define-public readosm
  2121. (package
  2122. (name "readosm")
  2123. (version "1.1.0a")
  2124. (source
  2125. (origin
  2126. (method url-fetch)
  2127. (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
  2128. "readosm-" version ".tar.gz"))
  2129. (sha256
  2130. (base32 "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v"))))
  2131. (build-system gnu-build-system)
  2132. (inputs
  2133. (list expat zlib))
  2134. (synopsis "Data extractor for OpenStreetMap files")
  2135. (description
  2136. "ReadOSM is a library to extract valid data from within an OpenStreetMap
  2137. input file (in @code{.osm} or @code{.osm.pbf} format).")
  2138. (home-page "https://www.gaia-gis.it/fossil/readosm/index")
  2139. (license (list license:gpl2+
  2140. license:lgpl2.1+
  2141. license:mpl1.1))))
  2142. (define-public shapelib
  2143. (package
  2144. (name "shapelib")
  2145. (version "1.5.0")
  2146. (source
  2147. (origin
  2148. (method git-fetch)
  2149. (uri (git-reference
  2150. (url "https://github.com/OSGeo/shapelib")
  2151. (commit (string-append "v" version))))
  2152. (file-name (git-file-name name version))
  2153. (sha256
  2154. (base32 "1lzch0jf6yqhw391phhafzw4ghmiz98zkf698h4fmq109fa2vhqd"))))
  2155. (build-system gnu-build-system)
  2156. (native-inputs
  2157. (list autoconf automake libtool))
  2158. (home-page "http://shapelib.maptools.org/")
  2159. (synopsis "Provides C library to write and update ESRI Shapefiles")
  2160. (description
  2161. "The Shapefile C Library provides the ability to write simple C programs
  2162. for reading, writing and updating (to a limited extent) ESRI Shapefiles, and the
  2163. associated attribute file (@file{.dbf}).")
  2164. (license license:gpl2+)))
  2165. (define-public spatialite-tools
  2166. (package
  2167. (name "spatialite-tools")
  2168. (version "5.0.1")
  2169. (source
  2170. (origin
  2171. (method url-fetch)
  2172. (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
  2173. "spatialite-tools-" version ".tar.gz"))
  2174. (sha256
  2175. (base32 "070p6pg541wvwb28wkn7k0z1qdyirik2qc2jpj4pf0vzx02w414n"))))
  2176. (build-system gnu-build-system)
  2177. (native-inputs
  2178. (list pkg-config))
  2179. (inputs
  2180. (list expat
  2181. freexl
  2182. geos
  2183. librttopo
  2184. libspatialite
  2185. libxml2
  2186. minizip
  2187. proj
  2188. readosm
  2189. sqlite))
  2190. (synopsis "Collection of command line tools for SpatiaLite")
  2191. (description
  2192. "@code{spatialite-tools} is a collection of Command Line Interface (CLI)
  2193. tools supporting SpatiaLite.")
  2194. (home-page "https://www.gaia-gis.it/fossil/spatialite-tools/index")
  2195. (license license:gpl3+)))
  2196. (define-public virtualpg
  2197. (package
  2198. (name "virtualpg")
  2199. (version "2.0.1")
  2200. (source
  2201. (origin
  2202. (method url-fetch)
  2203. (uri (string-append "https://www.gaia-gis.it/gaia-sins/"
  2204. "virtualpg-" version ".tar.gz"))
  2205. (sha256
  2206. (base32 "12z0l7368r4116ljzg7nljy5hf425r11vxc540w79wlzikmynamy"))))
  2207. (build-system gnu-build-system)
  2208. (inputs
  2209. (list postgresql sqlite))
  2210. (synopsis "Allow SQLite/SpatiaLite to access PostgreSQL/PostGIS tables")
  2211. (description
  2212. "VirtualPG is a dynamic extension for the SQLite DBMS. It implements
  2213. the VirtualPostgres driver, allowing to directly exchange data between SQLite
  2214. and PostgreSQL; if SpatiaLite is available even PostGIS geometries can be
  2215. exchanged form one Spatial DBMS and the other.")
  2216. (home-page "https://www.gaia-gis.it/fossil/virtualpg/index")
  2217. (license (list license:gpl2+
  2218. license:lgpl2.1+
  2219. license:mpl1.1))))
  2220. (define-public opencpn
  2221. (package
  2222. (name "opencpn")
  2223. (version "5.6.2")
  2224. (source
  2225. (origin
  2226. (method git-fetch)
  2227. (uri (git-reference
  2228. (url "https://github.com/OpenCPN/OpenCPN")
  2229. (commit (string-append "Release_" version))))
  2230. (file-name (git-file-name name version))
  2231. (sha256
  2232. (base32 "16hb0ycp0kbx2h8fx08rqkgrlz48kaym0d6wqvpjrcfa2r4myss8"))))
  2233. (build-system cmake-build-system)
  2234. (native-inputs
  2235. (list gettext-minimal pkg-config))
  2236. (inputs
  2237. (list alsa-utils
  2238. bzip2
  2239. cairo
  2240. curl
  2241. eudev
  2242. glu
  2243. gtk+
  2244. jasper
  2245. libarchive
  2246. libelf
  2247. libexif
  2248. libjpeg-turbo
  2249. libsndfile
  2250. libusb
  2251. lz4
  2252. mesa
  2253. pango
  2254. portaudio
  2255. sqlite
  2256. tinyxml
  2257. wxsvg
  2258. wxwidgets-3.0
  2259. xz
  2260. zlib))
  2261. (arguments
  2262. `(#:configure-flags '("-DOCPN_USE_BUNDLED_LIBS=OFF"
  2263. "-DOCPN_ENABLE_PORTAUDIO=ON"
  2264. "-DOCPN_ENABLE_SNDFILE=ON"
  2265. "-DOCPN_BUNDLE_TCDATA=ON"
  2266. "-DOCPN_BUNDLE_GSHHS=ON")
  2267. #:tests? #f ; No tests defined
  2268. #:phases
  2269. (modify-phases %standard-phases
  2270. (add-after 'unpack 'fix-build
  2271. (lambda* (#:key inputs #:allow-other-keys)
  2272. (substitute* "CMakeLists.txt"
  2273. (("wx-32.c; cc")
  2274. "wx-32.c; gcc")
  2275. (("\"/bin/sh\" \"-c\"")
  2276. (string-append "\"" (which "bash") "\" \"-c\""))
  2277. (("include\\(TargetSetup\\)")
  2278. "set(PKG_TARGET \"guix\")\nset(PKG_TARGET_VERSION 1)")))))))
  2279. (synopsis "Chart plotter and marine GPS navigation software")
  2280. (description
  2281. "OpenCPN is a chart plotter and marine navigation software designed to be
  2282. used at the helm station of your boat while underway. Chart a course and
  2283. track your position right from your laptop.")
  2284. (home-page "https://opencpn.org/")
  2285. (license (list license:asl2.0
  2286. license:cc0
  2287. license:bsd-2
  2288. license:bsd-3
  2289. license:expat
  2290. license:gpl3+
  2291. license:lgpl2.1+
  2292. license:lgpl3+
  2293. license:sgifreeb2.0
  2294. license:zlib))))
  2295. (define-public openorienteering-mapper
  2296. (package
  2297. (name "openorienteering-mapper")
  2298. (version "0.9.5")
  2299. (source (origin
  2300. (method git-fetch)
  2301. (uri (git-reference
  2302. (url "https://github.com/OpenOrienteering/mapper")
  2303. (commit (string-append "v" version))))
  2304. (file-name (git-file-name name version))
  2305. (sha256
  2306. (base32
  2307. "11b578h8f3q9yvphbjhqmy2w1cfc9skslzawypqmc3k44v24aj0s"))))
  2308. (build-system cmake-build-system)
  2309. (arguments
  2310. `(#:tests? #f
  2311. #:configure-flags
  2312. (list
  2313. "-DLICENSING_PROVIDER:BOOL=OFF"
  2314. "-DMapper_MANUAL_QTHELP:BOOL=OFF")))
  2315. (inputs
  2316. `(("clipper" ,clipper)
  2317. ("cups" ,cups)
  2318. ("curl" ,curl)
  2319. ("gdal" ,gdal)
  2320. ("proj" ,proj)
  2321. ("qtbase" ,qtbase-5)
  2322. ("qtimageformats" ,qtimageformats)
  2323. ("qtlocation" ,qtlocation)
  2324. ("qtsensors" ,qtsensors)
  2325. ("zlib" ,zlib)))
  2326. (native-inputs
  2327. `(("doxygen" ,doxygen)
  2328. ("qttools-5" ,qttools-5)))
  2329. (home-page "https://www.openorienteering.org/apps/mapper/")
  2330. (synopsis "OpenOrienteering Mapper (OOM)")
  2331. (description
  2332. "OpenOrienteering Mapper is a software for creating maps for the
  2333. orienteering sport.")
  2334. (license license:gpl3+)))
  2335. (define-public grass
  2336. (let* ((version "7.8.7")
  2337. (majorminor (string-join (list-head (string-split version #\.) 2) ""))
  2338. (grassxx (string-append "grass" majorminor)))
  2339. (package
  2340. (name "grass")
  2341. (version version)
  2342. (source
  2343. (origin
  2344. (method url-fetch)
  2345. (uri (string-append "https://grass.osgeo.org/" grassxx
  2346. "/source/grass-" version ".tar.gz"))
  2347. (sha256
  2348. (base32 "0sbz0ba9p963phvd0gmvfqq1fg4ixpipzcjbf20ys86qavjppzsg"))))
  2349. (build-system gnu-build-system)
  2350. (inputs
  2351. `(("bzip2" ,bzip2)
  2352. ("cairo" ,cairo)
  2353. ("fftw" ,fftw)
  2354. ("freetype" ,freetype)
  2355. ("gdal" ,gdal)
  2356. ("geos" ,geos)
  2357. ("glu" ,glu)
  2358. ("lapack" ,lapack)
  2359. ("libpng" ,libpng)
  2360. ("libtiff" ,libtiff)
  2361. ("mesa" ,mesa)
  2362. ("mariadb-dev" ,mariadb "dev")
  2363. ("mariadb-lib" ,mariadb "lib")
  2364. ("netcdf" ,netcdf)
  2365. ("openblas" ,openblas)
  2366. ("perl" ,perl)
  2367. ("postgresql" ,postgresql)
  2368. ("proj" ,proj)
  2369. ("python" ,python)
  2370. ("python-dateutil" ,python-dateutil)
  2371. ("python-numpy" ,python-numpy)
  2372. ("python-wxpython" ,python-wxpython)
  2373. ("readline" ,readline)
  2374. ("sqlite" ,sqlite)
  2375. ("wxwidgets" ,wxwidgets)
  2376. ("zlib" ,zlib)
  2377. ("zstd" ,zstd "lib")))
  2378. (native-inputs
  2379. `(("bash" ,bash-minimal)
  2380. ("bison" ,bison)
  2381. ("flex" ,flex)
  2382. ("pkg-config" ,pkg-config)))
  2383. (arguments
  2384. `(#:tests? #f ; No tests
  2385. #:modules ((guix build gnu-build-system)
  2386. ((guix build python-build-system) #:prefix python:)
  2387. (guix build utils))
  2388. #:imported-modules (,@%gnu-build-system-modules
  2389. (guix build python-build-system))
  2390. #:phases
  2391. (modify-phases %standard-phases
  2392. (replace 'configure
  2393. (lambda* (#:key inputs outputs #:allow-other-keys)
  2394. (let ((shell (search-input-file inputs "/bin/bash")))
  2395. (setenv "SHELL" shell)
  2396. (setenv "CONFIG_SHELL" shell)
  2397. (setenv "LDFLAGS" (string-append "-Wl,-rpath -Wl,"
  2398. (assoc-ref outputs "out")
  2399. "/" ,grassxx "/lib")))
  2400. (invoke "./configure"
  2401. (string-append "--prefix="
  2402. (assoc-ref outputs "out"))
  2403. "--with-blas"
  2404. "--with-bzlib"
  2405. (string-append "--with-freetype-includes="
  2406. (assoc-ref inputs "freetype")
  2407. "/include/freetype2")
  2408. (string-append "--with-freetype-libs="
  2409. (assoc-ref inputs "freetype")
  2410. "/lib")
  2411. "--with-geos"
  2412. "--with-lapack"
  2413. "--with-mysql"
  2414. (string-append "--with-mysql-includes="
  2415. (assoc-ref inputs "mariadb-dev")
  2416. "/include/mysql")
  2417. (string-append "--with-mysql-libs="
  2418. (assoc-ref inputs "mariadb-lib")
  2419. "/lib")
  2420. "--with-netcdf"
  2421. "--with-postgres"
  2422. (string-append "--with-proj-share="
  2423. (assoc-ref inputs "proj")
  2424. "/share/proj")
  2425. "--with-pthread"
  2426. "--with-readline"
  2427. "--with-sqlite"
  2428. "--with-wxwidgets")))
  2429. (add-after 'install 'install-links
  2430. (lambda* (#:key outputs #:allow-other-keys)
  2431. ;; Put links for includes and libraries in the standard places.
  2432. (let* ((out (assoc-ref outputs "out"))
  2433. (dir (string-append out "/" ,grassxx)))
  2434. (symlink (string-append dir "/include")
  2435. (string-append out "/include"))
  2436. (symlink (string-append dir "/lib")
  2437. (string-append out "/lib")))
  2438. #t))
  2439. (add-after 'install-links 'python:wrap
  2440. (assoc-ref python:%standard-phases 'wrap))
  2441. (add-after 'python:wrap 'wrap-with-python-interpreter
  2442. (lambda* (#:key outputs #:allow-other-keys)
  2443. (let ((out (assoc-ref outputs "out")))
  2444. (wrap-program (string-append out "/bin/" ,grassxx)
  2445. `("GRASS_PYTHON" = (,(which "python3"))))
  2446. #t))))))
  2447. (synopsis "GRASS Geographic Information System")
  2448. (description
  2449. "GRASS (Geographic Resources Analysis Support System), is a Geographic
  2450. Information System (GIS) software suite used for geospatial data management and
  2451. analysis, image processing, graphics and maps production, spatial modeling, and
  2452. visualization.")
  2453. (home-page "https://grass.osgeo.org/")
  2454. (license license:gpl2+))))
  2455. (define-public saga
  2456. (package
  2457. (name "saga")
  2458. (version "8.2.1")
  2459. (source
  2460. (origin
  2461. (method url-fetch)
  2462. (uri (string-append "mirror://sourceforge/saga-gis/SAGA%20-%20"
  2463. (version-major version) "/SAGA%20-%20" version
  2464. "/saga-" version ".tar.gz"))
  2465. (sha256
  2466. (base32 "008izjs6gvj09abxf16ssl1xy0ay3ljq4jswbggp6wiiq459minv"))
  2467. (modules '((guix build utils)))
  2468. (snippet
  2469. '(substitute* "saga-gis/src/tools/docs/docs_pdf/doc_pdf.cpp"
  2470. (("^#include <hpdf\\.h>\n" all)
  2471. (string-append all "#include <hpdf_version.h>\n"))
  2472. (("\\bHPDF_PROJECTING_SCUARE_END\\b")
  2473. "HPDF_PROJECTING_SQUARE_END")))))
  2474. (build-system cmake-build-system)
  2475. (native-inputs
  2476. (list pkg-config swig))
  2477. (inputs
  2478. (list curl
  2479. fftw
  2480. gdal
  2481. hdf5
  2482. jasper
  2483. libharu
  2484. libtiff
  2485. opencv
  2486. postgresql
  2487. proj
  2488. python
  2489. qhull
  2490. unixodbc
  2491. vigra
  2492. wxwidgets))
  2493. (arguments
  2494. '(#:tests? #f
  2495. #:phases
  2496. (modify-phases %standard-phases
  2497. (add-before 'configure 'cd-to-source-dir
  2498. (lambda _
  2499. (chdir "saga-gis"))))))
  2500. (synopsis "System for Automated Geoscientific Analyses")
  2501. (description
  2502. "SAGA (System for Automated Geoscientific Analyses) is a Geographic
  2503. Information System (GIS) software. It has been designed for an easy and
  2504. effective implementation of spatial algorithms and it offers a comprehensive,
  2505. growing set of geoscientific methods.")
  2506. (home-page "https://www.saga-gis.org")
  2507. (license (list license:gpl2+ license:lgpl2.1+))))
  2508. (define-public qgis
  2509. (package
  2510. (name "qgis")
  2511. (version "3.30.1")
  2512. (source
  2513. (origin
  2514. (method url-fetch)
  2515. (uri (string-append "https://qgis.org/downloads/qgis-"
  2516. version ".tar.bz2"))
  2517. (sha256
  2518. (base32 "0mdgqyqr3nswp5qfpjrpr35lxizcrz73a1gs3ddxsd1xr9amzb5s"))))
  2519. (build-system cmake-build-system)
  2520. (arguments
  2521. `(#:modules ((guix build cmake-build-system)
  2522. ((guix build python-build-system) #:prefix python:)
  2523. (guix build qt-utils)
  2524. (guix build utils))
  2525. #:imported-modules (,@%cmake-build-system-modules
  2526. (guix build python-build-system)
  2527. (guix build qt-utils))
  2528. #:configure-flags
  2529. '("-DWITH_QTWEBKIT=NO")
  2530. #:phases
  2531. (modify-phases %standard-phases
  2532. ;; Configure correct path to PyQt5 SIP directory
  2533. (add-after 'unpack 'configure-pyqt5-sip-path
  2534. (lambda* (#:key inputs #:allow-other-keys)
  2535. (let ((sip-dir (string-append
  2536. (assoc-ref inputs "python-pyqt+qscintilla")
  2537. "/lib/python"
  2538. (python:python-version (assoc-ref inputs "python"))
  2539. "/site-packages/PyQt5/bindings")))
  2540. (substitute* "cmake/FindPyQt5.py"
  2541. (("sip_dir = cfg.default_sip_dir")
  2542. (string-append "sip_dir = \"" sip-dir "\"")))
  2543. (substitute* "cmake/FindPyQt5.cmake"
  2544. (("SET\\(PYQT5_SIP_DIR \"\\$\\{Python_SITEARCH\\}/PyQt5/bindings\"\\)")
  2545. (string-append "SET(PYQT5_SIP_DIR \"" sip-dir "\")"))))
  2546. (substitute* (list "tests/code_layout/test_qt_imports.sh"
  2547. "tests/code_layout/test_qgsscrollarea.sh")
  2548. (("\\$\\(git rev-parse --show-toplevel\\)")
  2549. (getcwd)))))
  2550. (replace 'check
  2551. (lambda* (#:key inputs outputs tests? parallel-tests?
  2552. #:allow-other-keys)
  2553. (when tests?
  2554. (setenv "HOME" "/tmp")
  2555. (system "Xvfb :1 &")
  2556. (setenv "DISPLAY" ":1")
  2557. (setenv "TRAVIS" "true")
  2558. (setenv "CTEST_OUTPUT_ON_FAILURE" "1")
  2559. (let* ((out (assoc-ref outputs "out"))
  2560. (grass-version ,(package-version grass))
  2561. (grass-majorminor (string-join
  2562. (list-head
  2563. (string-split grass-version #\.) 2)
  2564. ""))
  2565. (grass (string-append (assoc-ref inputs "grass")
  2566. "/grass" grass-majorminor)))
  2567. (setenv "GISBASE" grass))
  2568. (invoke "ctest"
  2569. "-j" (if parallel-tests?
  2570. (number->string (parallel-job-count))
  2571. "1")
  2572. "-E" (string-join
  2573. '(;; Disable tests that require network access
  2574. "PyQgsExternalStorageAwsS3"
  2575. "PyQgsExternalStorageWebDav"
  2576. "qgis_filedownloader"
  2577. "test_core_networkaccessmanager"
  2578. "test_core_tiledownloadmanager"
  2579. "test_gui_filedownloader"
  2580. "test_provider_wcsprovider"
  2581. ;; Disable tests that need OGR built with
  2582. ;; libspatialite support
  2583. "PyQgsAttributeTableModel"
  2584. "PyQgsOGRProviderSqlite"
  2585. "PyQgsWFSProvider"
  2586. "PyQgsOapifProvider"
  2587. ;; Disable tests that need Python compiled
  2588. ;; with loadable SQLite extensions.
  2589. "PyQgsFieldFormattersTest"
  2590. "PyQgsSpatialiteProvider"
  2591. "PyQgsLayerDependencies"
  2592. "PyQgsDBManagerGpkg"
  2593. "PyQgsDBManagerSpatialite"
  2594. ;; Disable tests that need poppler (with Cairo)
  2595. "PyQgsLayoutExporter"
  2596. "PyQgsPalLabelingLayout"
  2597. ;; Disable tests that need Orfeo ToolBox
  2598. "ProcessingOtbAlgorithmsTest"
  2599. ;; TODO: Find why the following tests fail
  2600. "ProcessingQgisAlgorithmsTestPt1"
  2601. "ProcessingQgisAlgorithmsTestPt3"
  2602. "ProcessingQgisAlgorithmsTestPt4"
  2603. "ProcessingGdalAlgorithmsRasterTest"
  2604. "ProcessingGdalAlgorithmsVectorTest"
  2605. "ProcessingGrass7AlgorithmsImageryTest"
  2606. "ProcessingGrass7AlgorithmsRasterTestPt1"
  2607. "ProcessingGrass7AlgorithmsRasterTestPt2"
  2608. "ProcessingGrass7AlgorithmsVectorTest"
  2609. "test_core_authmanager"
  2610. "test_core_compositionconverter"
  2611. "test_core_expression"
  2612. "test_core_gdalutils"
  2613. "test_core_labelingengine"
  2614. "test_core_layoutpicture"
  2615. "test_core_layouttable"
  2616. "test_core_pointcloudlayerexporter"
  2617. "test_core_projectstorage"
  2618. "test_core_coordinatereferencesystem"
  2619. "test_gui_queryresultwidget"
  2620. "test_provider_copcprovider"
  2621. "test_provider_eptprovider"
  2622. "test_analysis_processingalgspt1"
  2623. "test_analysis_processingalgspt2"
  2624. "test_analysis_processing"
  2625. "test_app_gpsintegration"
  2626. "PyQgsAnnotation"
  2627. "PyQgsAuthenticationSystem"
  2628. "PyQgsConnectionRegistry"
  2629. "PyQgsDatumTransform"
  2630. "PyQgsFileUtils"
  2631. "PyQgsGeometryTest"
  2632. "PyQgsGoogleMapsGeocoder"
  2633. "PyQgsGroupLayer"
  2634. "PyQgsHashLineSymbolLayer"
  2635. "PyQgsLayerMetadataProviderPython"
  2636. "PyQgsLayoutHtml"
  2637. "PyQgsLineSymbolLayers"
  2638. "PyQgsMapLayer"
  2639. "PyQgsOGRProviderGpkg"
  2640. "PyQgsProcessExecutablePt1"
  2641. "PyQgsProcessExecutablePt2"
  2642. "PyQgsProviderConnectionGpkg"
  2643. "PyQgsProviderConnectionSpatialite"
  2644. "PyQgsOGRProvider"
  2645. "PyQgsSettingsTreeNode"
  2646. "PyQgsTextRenderer"
  2647. "PyQgsVectorFileWriter"
  2648. "PyQgsVectorLayerEditBuffer"
  2649. "PyQgsVirtualLayerProvider"
  2650. "PyQgsAuxiliaryStorage"
  2651. "PyQgsSelectiveMasking"
  2652. "qgis_sipify"
  2653. "qgis_sip_include"
  2654. "qgis_sip_uptodate")
  2655. "|")))))
  2656. (add-after 'install 'wrap-python
  2657. (assoc-ref python:%standard-phases 'wrap))
  2658. (add-after 'wrap-python 'wrap-qt
  2659. (lambda* (#:key outputs inputs #:allow-other-keys)
  2660. (let ((out (assoc-ref outputs "out")))
  2661. (wrap-qt-program "qgis" #:output out #:inputs inputs))))
  2662. (add-after 'wrap-qt 'wrap-gis
  2663. (lambda* (#:key inputs outputs #:allow-other-keys)
  2664. ;; TODO: Find if there is a way to get SAGA to work.
  2665. ;; Currently QGIS says "version of SAGA not supported".
  2666. ;; Disable it for now.
  2667. (let* ((out (assoc-ref outputs "out"))
  2668. ;;(saga (string-append (assoc-ref inputs "saga") "/bin"))
  2669. (grass-version ,(package-version grass))
  2670. (grass-majorminor (string-join
  2671. (list-head
  2672. (string-split grass-version #\.) 2)
  2673. ""))
  2674. (grass (string-append (assoc-ref inputs "grass")
  2675. "/grass" grass-majorminor)))
  2676. (wrap-program (string-append out "/bin/qgis")
  2677. ;;`("PATH" ":" prefix (,saga))
  2678. `("QGIS_PREFIX_PATH" = (,out))
  2679. `("GISBASE" = (,grass)))))))))
  2680. (inputs
  2681. (list bash-minimal
  2682. exiv2
  2683. expat
  2684. gdal
  2685. geos
  2686. gpsbabel
  2687. grass
  2688. gsl
  2689. hdf5
  2690. libspatialindex
  2691. libspatialite
  2692. libxml2
  2693. libzip
  2694. netcdf
  2695. postgresql
  2696. proj
  2697. protobuf
  2698. python
  2699. python-chardet
  2700. python-dateutil
  2701. python-future
  2702. python-jinja2
  2703. python-numpy
  2704. python-owslib
  2705. python-psycopg2
  2706. python-pygments
  2707. python-pyqt+qscintilla
  2708. python-pytz
  2709. python-pyyaml
  2710. python-requests
  2711. python-sip
  2712. python-six
  2713. python-urllib3
  2714. qca
  2715. qscintilla
  2716. qtbase-5
  2717. qtdeclarative-5
  2718. qtkeychain
  2719. qtlocation
  2720. qtmultimedia-5
  2721. qtserialport
  2722. qtsvg-5
  2723. qwt
  2724. ;; saga
  2725. sqlite
  2726. (list zstd "lib")))
  2727. (native-inputs
  2728. (list bison
  2729. flex
  2730. perl
  2731. perl-yaml-tiny
  2732. pkg-config
  2733. python-mock
  2734. python-nose2
  2735. python-pyqt-builder
  2736. qttools-5
  2737. shellcheck
  2738. xorg-server-for-tests))
  2739. (home-page "https://qgis.org")
  2740. (synopsis "Geographical information system")
  2741. (description "QGIS is an easy to use Geographical Information
  2742. System (GIS). It is a GIS data viewer and editor. QGIS supports a number of
  2743. raster and vector data formats, with new support easily added using the plugin
  2744. architecture.")
  2745. (license
  2746. (list
  2747. license:asl1.1
  2748. license:asl2.0
  2749. license:bsd-2
  2750. license:bsd-3
  2751. license:boost1.0
  2752. license:cc-by3.0
  2753. license:cc-by4.0
  2754. license:cc-by-sa3.0
  2755. license:cc-by-sa4.0
  2756. (license:fsdg-compatible "https://www.deviantart.com/elvensword")
  2757. (license:fsf-free "file://debian/copyright" "Go Squared")
  2758. license:expat
  2759. license:fdl1.2+
  2760. (license:fsf-free
  2761. "https://www.deviantart.com/webgoddess/art/Reddish-Inspired-Gradients-42208824")
  2762. (license:fsf-free
  2763. "file://debian/copyright"
  2764. "QT-Commercial or LGPL-2.1 with Digia Qt LGPL Exception 1.1 or GPL-3")
  2765. license:gpl2
  2766. license:gpl2+
  2767. license:gpl3
  2768. license:gpl3+
  2769. license:isc
  2770. license:lgpl2.0+
  2771. license:lgpl2.1
  2772. license:lgpl2.1+
  2773. license:lgpl3
  2774. (license:non-copyleft "file://debian/copyright" "BSD-like-gist")
  2775. (license:non-copyleft "file://debian/copyright" "Jim Mossman Attribution")
  2776. (license:non-copyleft
  2777. "https://www.ncl.ucar.edu/Download/NCL_source_license.shtml"
  2778. "NCL Source Code License")
  2779. license:ogl-psi1.0
  2780. license:opl1.0+
  2781. license:public-domain
  2782. license:qwt1.0))))
  2783. (define-public splat
  2784. (package
  2785. (name "splat")
  2786. (version "1.5.0b3")
  2787. (source
  2788. (origin
  2789. (method git-fetch)
  2790. (uri (git-reference
  2791. (url "https://github.com/hoche/splat")
  2792. (commit (string-append "v" version))))
  2793. (file-name (git-file-name name version))
  2794. (sha256
  2795. (base32 "10djwjwb1pvznr0fjwnxdm5d961f3yngispb4zj9hyzdgq1xh217"))
  2796. (modules '((guix build utils)))
  2797. (snippet
  2798. '(begin
  2799. ;; Delete pre-compiled libraries.
  2800. (delete-file-recursively "vstudio")))))
  2801. (build-system gnu-build-system)
  2802. (inputs
  2803. (list bzip2 libjpeg-turbo libpng zlib))
  2804. (arguments
  2805. (list #:tests? #f ; No test suite.
  2806. #:phases
  2807. #~(modify-phases %standard-phases
  2808. (add-after 'unpack 'fix-installation-scripts
  2809. (lambda _
  2810. (substitute* (list "install" "utils/install")
  2811. (("/usr/local")
  2812. #$output)
  2813. (("whoami=`whoami`")
  2814. "whoami=root"))))
  2815. (delete 'configure)
  2816. (add-before 'install 'create-bin-directory
  2817. (lambda _
  2818. (mkdir-p (string-append #$output "/bin")))))))
  2819. (synopsis "Signal propagation and coverage analysis tool")
  2820. (description
  2821. "The SPLAT (Signal Propagation, Loss, And Terrain) program can use the
  2822. Longley-Rice path loss and coverage prediction using the Irregular Terrain
  2823. Model to predict the behaviour and reliability of radio links, and to predict
  2824. path loss.")
  2825. (home-page "https://www.qsl.net/kd2bd/splat.html")
  2826. (license license:gpl2+)))
  2827. (define-public python-geographiclib
  2828. (package
  2829. (name "python-geographiclib")
  2830. (version "1.50")
  2831. (source
  2832. (origin
  2833. (method url-fetch)
  2834. (uri (pypi-uri "geographiclib" version))
  2835. (sha256
  2836. (base32
  2837. "0cn6ap5fkh3mkfa57l5b44z3gvz7j6lpmc9rl4g2jny2gvp4dg8j"))))
  2838. (build-system python-build-system)
  2839. (home-page "https://geographiclib.sourceforge.io/1.50/python/")
  2840. (synopsis "Python geodesic routines from GeographicLib")
  2841. (description
  2842. "This is a python implementation of the geodesic routines in GeographicLib.")
  2843. (license license:expat)))
  2844. (define-public python-geopy
  2845. (package
  2846. (name "python-geopy")
  2847. (version "2.0.0")
  2848. (source
  2849. (origin
  2850. (method url-fetch)
  2851. (uri (pypi-uri "geopy" version))
  2852. (sha256
  2853. (base32
  2854. "0fx0cv0kgbvynpmjgsvq2fpsyngd5idiscdn8pd5201f1ngii3mq"))))
  2855. (build-system python-build-system)
  2856. (propagated-inputs
  2857. (list python-geographiclib))
  2858. (native-inputs
  2859. (list python-async-generator
  2860. python-coverage
  2861. python-flake8
  2862. python-isort
  2863. python-pytest
  2864. python-pytest-aiohttp
  2865. python-readme-renderer
  2866. python-pytz))
  2867. (home-page "https://github.com/geopy/geopy")
  2868. (synopsis "Geocoding library for Python")
  2869. (description "@code{geopy} is a Python client for several popular geocoding
  2870. web services. @code{geopy} makes it easy for Python developers to locate the
  2871. coordinates of addresses, cities, countries, and landmarks across the globe
  2872. using third-party geocoders and other data sources.")
  2873. (license license:expat)))
  2874. (define-public python-haversine
  2875. (package
  2876. (name "python-haversine")
  2877. (version "2.7.0")
  2878. (source (origin
  2879. (method git-fetch)
  2880. (uri (git-reference
  2881. ;; There are no tests in the PyPi archive.
  2882. (url "https://github.com/mapado/haversine")
  2883. (commit (string-append "v" version))))
  2884. (file-name (git-file-name name version))
  2885. (sha256
  2886. (base32
  2887. "0inxyj5n4jzgg5xiadqx9sk83gdx5ff989l9s04smdzbd3b8c0c8"))))
  2888. (build-system python-build-system)
  2889. (native-inputs (list python-pytest python-numpy))
  2890. (arguments
  2891. (list #:phases
  2892. #~(modify-phases %standard-phases
  2893. (replace 'check
  2894. (lambda* (#:key tests? inputs #:allow-other-keys)
  2895. (when tests?
  2896. (invoke "pytest")))))))
  2897. (home-page "https://github.com/mapado/haversine")
  2898. (synopsis "Calculate the distance between 2 points on Earth")
  2899. (description "This package provides functions to calculate the
  2900. distance in various units between two points on Earth using their
  2901. latitude and longitude.")
  2902. (license license:expat)))
  2903. (define-public gplates
  2904. (package
  2905. (name "gplates")
  2906. ;; Note: use a pre-release to cope with newer Boost, ref
  2907. ;; https://discourse.gplates.org/t/compilation-error-with-boost-1-77/452/3
  2908. (version "2.3.01-beta.3")
  2909. (source (origin
  2910. (method url-fetch)
  2911. (uri "https://cloudstor.aarnet.edu.au/plus/s\
  2912. /ojsYNOyUYE3evNp/download?path=%2F&files=gplates_2.3.1-beta.3_src.zip")
  2913. (file-name (string-append name "-" version ".zip"))
  2914. (sha256
  2915. (base32
  2916. "06i87dfab0cq9gdi5mh6sf9wigawpp0d05zbyslv910443i26gwv"))))
  2917. (build-system cmake-build-system)
  2918. (arguments
  2919. `(#:configure-flags (list "-DBoost_NO_BOOST_CMAKE=ON")
  2920. #:tests? #f)) ;no test target
  2921. (native-inputs
  2922. (list unzip)) ;for the beta
  2923. (inputs
  2924. (list boost
  2925. cgal
  2926. curl
  2927. gdal
  2928. glew
  2929. glu
  2930. gmp
  2931. mesa
  2932. mpfr
  2933. proj
  2934. python-3
  2935. python-numpy
  2936. qtbase-5
  2937. qtsvg-5
  2938. qtxmlpatterns
  2939. qwt
  2940. zlib))
  2941. (home-page "https://www.gplates.org")
  2942. (synopsis "Plate tectonics simulation program")
  2943. (description "GPlates is a plate tectonics program. Manipulate
  2944. reconstructions of geological and paleogeographic features through geological
  2945. time. Interactively visualize vector, raster and volume data.")
  2946. (license license:gpl2+)))
  2947. (define-public navit
  2948. (package
  2949. (name "navit")
  2950. (version "0.5.6")
  2951. (source (origin
  2952. (method git-fetch)
  2953. (uri (git-reference
  2954. (url "https://github.com/navit-gps/navit")
  2955. (commit (string-append "v" version))))
  2956. (sha256
  2957. (base32
  2958. "1jhlif0sc5m8wqb5j985g1xba2ki7b7mm14pkvzdghjd0q0gf15s"))
  2959. (file-name (git-file-name name version))))
  2960. (build-system cmake-build-system)
  2961. (arguments
  2962. (list
  2963. ;; There are no tests
  2964. #:tests? #f
  2965. ;; With -DSAMPLE_MAP=TRUE (the default), it tries to download a
  2966. ;; map during the build process.
  2967. #:configure-flags #~(list "-DSAMPLE_MAP=FALSE")
  2968. #:phases
  2969. #~(modify-phases %standard-phases
  2970. (add-after
  2971. 'unpack 'patch-navit-config
  2972. (lambda _
  2973. ;; For now this package only supports SDL, so if we keep
  2974. ;; the configuration as-is, Navit doesn't start.
  2975. (substitute*
  2976. "navit/navit_shipped.xml"
  2977. (("<graphics type=\"gtk_drawing_area\"/>")
  2978. "<graphics type=\"sdl\"/>"))
  2979. ;; Users are expected to be able to add XML files inside
  2980. ;; $NAVIT_SHAREDIR, however that directory is in the store.
  2981. (substitute*
  2982. "navit/navit_shipped.xml"
  2983. (("<xi:include href=\"\\$NAVIT_SHAREDIR/maps/\\*\\.xml\"/>")
  2984. "<xi:include href=\"$NAVIT_USER_DATADIR/maps/*.xml\"/>"))
  2985. ;; Navit also works without GPS but in that case there is
  2986. ;; no automatic zooming, so we need zoom buttons to be able
  2987. ;; to manually zoom in or out.
  2988. (substitute*
  2989. "navit/navit_shipped.xml"
  2990. (((string-append
  2991. "<osd enabled=\"no\" type=\"button\" x=\"-96\" y=\"-96\" "
  2992. "command=\"zoom_in()"))
  2993. (string-append
  2994. "<osd enabled=\"yes\" type=\"button\" x=\"-96\" y=\"-96\" "
  2995. "command=\"zoom_in()"))
  2996. (((string-append
  2997. "<osd enabled=\"no\" type=\"button\" x=\"0\" y=\"-96\" "
  2998. "command=\"zoom_out()"))
  2999. (string-append
  3000. "<osd enabled=\"yes\" type=\"button\" x=\"0\" y=\"-96\" "
  3001. "command=\"zoom_out()\" src=\"zoom_out.png\"/>")))))
  3002. (add-before
  3003. 'build 'set-cache
  3004. ;; During the build, svg icons are converted in different
  3005. ;; formats, and this needs XDG_CACHE_HOME to work.
  3006. (lambda _
  3007. (setenv "XDG_CACHE_HOME" "/tmp/xdg-cache"))))))
  3008. (inputs (list dbus-glib
  3009. espeak
  3010. freeglut
  3011. freeimage
  3012. freetype
  3013. glib
  3014. gettext-minimal
  3015. gpsd
  3016. gdk-pixbuf
  3017. imlib2
  3018. python
  3019. sdl
  3020. sdl-image))
  3021. (native-inputs (list fontconfig
  3022. (librsvg-for-system)
  3023. pkg-config))
  3024. (home-page "https://www.navit-project.org")
  3025. (synopsis "Car navigation system with routing engine that uses vector maps data")
  3026. (description "Navit is a car navigation system with a routing engine.
  3027. It is meant to work with touchscreen devices, but it also works
  3028. without a touchscreen. It also supports text to speech.
  3029. It can be configured extensively through its own configuration file
  3030. format. For instance we can configure the graphical interface, and
  3031. which map data is to be displayed at which zoom level.
  3032. It supports different routing profiles: bike, car, car_avoid_toll,
  3033. car_pedantic, car_shortest, horse, pedestrian, truck.
  3034. It can use gpsd or NMEA GPS directly to get position data. It also
  3035. works without GPS: in this case users can also enter position data
  3036. directly.
  3037. It can also be used to log GPS data to files using the GPX or NMEA
  3038. formats, or to replay NMEA data.
  3039. For maps, it can uses its own \"binfile\" map format, or Garmin map
  3040. file format, and data from OpenStreetMap, Garmin maps, Marco Polo
  3041. Grosser Reiseplaner, Routeplaner Europa 2007, Map + Route.")
  3042. (license license:gpl2)))