summary refs log tree commit diff
path: root/gnu/packages/geo.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/geo.scm')
-rw-r--r--gnu/packages/geo.scm256
1 files changed, 167 insertions, 89 deletions
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm
index 119a9802d0..687effcace 100644
--- a/gnu/packages/geo.scm
+++ b/gnu/packages/geo.scm
@@ -13,11 +13,12 @@
 ;;; Copyright © 2019, 2020 Hartmut Goebel <h.goebel@crazy-compilers.com>
 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
-;;; Copyright © 2020, 2021, 2022, 2023 Felix Gruber <felgru@posteo.net>
-;;; Copyright © 2021, 2023 Sharlatan Hellseher <sharlatanus@gmail.com>
+;;; Copyright © 2020–2024 Felix Gruber <felgru@posteo.net>
+;;; Copyright © 2021, 2023, 2024 Sharlatan Hellseher <sharlatanus@gmail.com>
 ;;; Copyright © 2021, 2023, 2024 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2021 Clément Lassieur <clement@lassieur.org>
 ;;; Copyright © 2021, 2022 Nikolay Korotkiy <sikmir@disroot.org>
+;;; Copyright © 2022 Patrick Noll <patrick@patricknoll.com>
 ;;; Copyright © 2022 Roman Scherer <roman.scherer@burningswell.com>
 ;;; Copyright © 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2022 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
@@ -61,6 +62,7 @@
   #:use-module (gnu packages audio)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages backup)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages boost)
@@ -432,7 +434,7 @@ OpenStreetMap written in C using eXpat, Cairo and GLib.")
 (define-public geos
   (package
     (name "geos")
-    (version "3.11.2")
+    (version "3.12.1")
     (source (origin
               (method url-fetch)
               (uri (string-append "http://download.osgeo.org/geos/geos-"
@@ -440,7 +442,7 @@ OpenStreetMap written in C using eXpat, Cairo and GLib.")
                                   ".tar.bz2"))
               (sha256
                (base32
-                "1k744nwfa5sj4amzsdjxgac83wh6xfb9xi7z5bka7ic1jik7gw5i"))))
+                "00qdk9a4048pzfj2rhzkfw3lvm642znf6kr4x29i3d94494pxsnn"))))
     (build-system cmake-build-system)
     (arguments `(#:phases
                  (modify-phases %standard-phases
@@ -448,7 +450,7 @@ OpenStreetMap written in C using eXpat, Cairo and GLib.")
                     'unpack 'patch-test-shebangs
                     (lambda _
                       (substitute* '("tests/xmltester/testrunner.sh"
-                                     "tests/geostest/testrunner.sh")
+                                     "tests/xmltester/safe_to_xml.sh")
                         (("/bin/sh") (which "sh"))))))))
     (inputs
      (list glib))
@@ -546,7 +548,11 @@ and driving.")
        (method url-fetch)
        (uri (string-append "http://download.osgeo.org/geotiff/libgeotiff/libgeotiff-"
                            version ".tar.gz"))
-       (patches (search-patches "libgeotiff-fix-tests-with-proj-9.1.1.patch"))
+       (patches
+         (search-patches "libgeotiff-fix-tests-with-proj-9.1.1.patch"
+                         "libgeotiff-fix-tests-with-proj-9.3.0.patch"
+                         "libgeotiff-fix-tests-with-proj-9.3.1.patch"
+                         "libgeotiff-fix-tests-on-i386.patch"))
        (sha256
         (base32 "1mjmgv48x51ppax5dnb6lq7z600czxll53bx6jbzqwd4m93i7aq5"))
        (modules '((guix build utils)))
@@ -738,7 +744,7 @@ fully fledged Spatial SQL capabilities.")
 (define-public proj
   (package
     (name "proj")
-    (version "9.2.0")
+    (version "9.3.1")
     (source
      (origin
        (method url-fetch)
@@ -746,7 +752,7 @@ fully fledged Spatial SQL capabilities.")
                            version ".tar.gz"))
        (sha256
         (base32
-         "03nm1sgvh237my7ss6kayn6887cbnayvjxrrxsrfcakkmbsida6y"))))
+         "1g0hkpiablvhsmw0kn5frwgdir3q7avc45p6lc1zhhhzkv5ikydh"))))
     (build-system cmake-build-system)
     (native-inputs (list googletest pkg-config))
     (propagated-inputs (list curl libtiff sqlite)) ;required by proj.pc
@@ -842,31 +848,36 @@ projections.")
 (define-public python-pyproj
   (package
     (name "python-pyproj")
-    (version "3.5.0")
+    (version "3.6.1")
     (source
       (origin
         (method url-fetch)
         (uri (pypi-uri "pyproj" version))
         (sha256
           (base32
-            "1xhvr0n5gb7v6x0wd7cqmc0zrky2fag7bq2shx6l2qqq3icx2ncq"))))
+            "1gq1spm5zdq9k8kl9cb31b9m08ybyrdggfw3sjrqyz9b9iq7raj4"))))
     (build-system python-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'set-proj-path
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((proj (assoc-ref inputs "proj")))
-               (setenv "PROJ_DIR" proj)
-               (substitute* "pyproj/datadir.py"
-                 (("(internal_datadir = ).*$" all var)
-                  (string-append var "Path(\"" proj "/share/proj\")\n")))))))))
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-proj-path
+            (lambda* (#:key #:allow-other-keys)
+              (let ((proj #$(this-package-input "proj")))
+                (setenv "PROJ_DIR" proj)
+                (substitute* "pyproj/datadir.py"
+                  (("(internal_datadir = ).*$" all var)
+                   (string-append var "Path(\"" proj
+                                  "/share/proj\")\n")))))))))
     (inputs
       (list proj))
     (propagated-inputs
       (list python-certifi))
     (native-inputs
-      (list python-cython python-numpy python-pandas python-pytest
+      (list python-cython
+            python-numpy
+            python-pandas
+            python-pytest
             python-xarray))
     (home-page "https://github.com/pyproj4/pyproj")
     (synopsis
@@ -974,56 +985,106 @@ enables you to easily do operations in Python that would otherwise
 require a spatial database such as PostGIS.")
     (license license:bsd-3)))
 
+(define-public python-ogr2osm
+  (package
+    (name "python-ogr2osm")
+    (version "1.2.0")
+    (source
+     (origin
+       (method git-fetch) ; no tests data in PyPi package
+       (uri
+        (git-reference
+         (url "https://github.com/roelderickx/ogr2osm/")
+         (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "0hwqnx3cdqxmniydpj1v31kglq1xjsx41d8p10c9j4hg8kb43j80"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      ;; There are tests in git checkout but non of the examples taken from
+      ;; GitHub Actions worked for me. Disabling them to be checked later
+      ;; <https://github.com/roelderickx/ogr2osm/blob/main/.github/workflows/test.yml>.
+      #:phases
+      #~(modify-phases %standard-phases
+          (replace 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                ;; TODO: Fix provided tests.
+                ;; (invoke "cram" "test/basic_usage.t")
+                ;; (invoke "cram" "test/osm_output.t")
+                ;; (invoke "cram" "test/pbf_output.t")
+
+                ;; Run simple tests to ensure that the command is working.
+                (invoke "ogr2osm" "--help")
+                (invoke
+                 "ogr2osm" "-f" "test/shapefiles/basic_geometries.kml")))))))
+    (inputs
+     (list gdal))
+    (native-inputs
+     (list coreutils
+           diffutils
+           libxml2
+           python-cram
+           which))
+    (propagated-inputs
+     (list python-lxml
+           python-protobuf))
+    (home-page "https://github.com/roelderickx/ogr2osm")
+    (synopsis "Convert ogr-readable files like shapefiles into OSM or PDF formats")
+    (description
+     "@code{ogr2osm} is a tool for converting ogr-readable files into
+@acronym{OSM, OpenStreetMap} format.  It supports reading from OGR files like
+shapefiles or PostgresSQL database and converts data into @code{osm} or
+@code{osm.pbf} formats.  A translation file can be used to manipulate the data
+during conversion.")
+    (license license:expat)))
+
 (define-public python-osmnx
   (package
     (name "python-osmnx")
-    (version "1.1.2")
+    (version "1.8.1")
     (source
      (origin
-       ; Fetch from github as the pypi package is missing the tests dir.
+       ;; Fetch from github as the pypi package is missing the tests dir.
        (method git-fetch)
        (uri (git-reference
              (url "https://github.com/gboeing/osmnx")
              (commit (string-append "v" version))))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1n8qjn184p5a2s3j6x6iyc1i7p3l3xnbqqxm6ajwgwv6j5fw1d5a"))))
+        (base32 "0n238n07pp5jw9cg8nqw9qhpkw8plzb5imz1gxbliw2l1idqyjcl"))))
     (build-system pyproject-build-system)
     (arguments
      (list
-      #:test-flags
-      '(list "-k"
-             (string-append
-               ;; The following tests require network access.
-               "not test_geocode_to_gdf"
-               " and not test_stats"
-               " and not test_osm_xml"
-               " and not test_elevation"
-               " and not test_routing"
-               " and not test_plots"
-               " and not test_find_nearest"
-               " and not test_api_endpoints"
-               " and not test_graph_save_load"
-               " and not test_graph_from_functions"
-               " and not test_geometries"))))
-    (propagated-inputs
-      (list python-folium
-            python-geopandas
-            python-matplotlib
-            python-networkx
-            python-numpy
-            python-pandas
-            python-pyproj
-            python-requests
-            python-rtree
-            python-shapely))
-    (native-inputs
-      (list python-numpy python-pytest))
+      #:test-flags '(list "-k"
+                          (string-append
+                           ;; The following tests require network access.
+                           "not test_stats"
+                           " and not test_geocoder"
+                           " and not test_osm_xml"
+                           " and not test_elevation"
+                           " and not test_routing"
+                           " and not test_plots"
+                           " and not test_find_nearest"
+                           " and not test_api_endpoints"
+                           " and not test_graph_save_load"
+                           " and not test_graph_from_functions"
+                           " and not test_features"))))
+    (propagated-inputs (list python-folium
+                             python-geopandas
+                             python-matplotlib
+                             python-networkx
+                             python-numpy
+                             python-pandas
+                             python-requests
+                             python-shapely))
+    (native-inputs (list python-hatchling python-pytest))
     (home-page "https://github.com/gboeing/osmnx")
     (synopsis
-      "Retrieve, model, analyze, and visualize OpenStreetMap street networks")
+     "Retrieve, model, analyze, and visualize OpenStreetMap street networks")
     (description
-      "OSMnx is a Python library that lets you download geospatial data
+     "OSMnx is a Python library that lets you download geospatial data
 from OpenStreetMap and model, project, visualize, and analyze real-world
 street networks and any other geospatial geometries.  You can download
 and model walkable, drivable, or bikeable urban networks with a single
@@ -1262,7 +1323,7 @@ utilities for data translation and processing.")
 (define-public python-pyshp
   (package
     (name "python-pyshp")
-    (version "2.1.3")
+    (version "2.3.1")
     (source
      (origin
        (method git-fetch)
@@ -1271,16 +1332,13 @@ utilities for data translation and processing.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r"))))
-    (build-system python-build-system)
+        (base32 "02pbr091p8v4kfv1p6p2aa4asgm9r74dc12r35lvgmhs9y163z69"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               ;; This is the only test file.
-               (invoke "python" "-m" "pytest" "test_shapefile.py")))))))
+     (list
+      #:test-flags
+      ;; This test requires internet access.
+      '(list "--deselect" "test_shapefile.py::test_reader_url")))
     (native-inputs
      (list python-pytest python-pytest-runner))
     (home-page "https://github.com/GeospatialPython/pyshp")
@@ -1619,7 +1677,7 @@ based on the Osmium library.")
 (define-public osm2pgsql
   (package
     (name "osm2pgsql")
-    (version "1.9.2")
+    (version "1.11.0")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -1628,7 +1686,7 @@ based on the Osmium library.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "198qcgl42pb8lk1bn41ncp8hc9gcg9k2p0ny42vak019w5l6jcj7"))
+                "135vqahlcrhwa3b9hfgbiqkzbbsjd4i79fp41cd0rp4zarcpi47p"))
               (modules '((guix build utils)))
               (snippet
                ;; Remove bundled libraries.
@@ -1636,20 +1694,21 @@ based on the Osmium library.")
     (build-system cmake-build-system)
     (arguments
      (list #:tests? #f ;tests fail because we need to setup a database
-           #:configure-flags #~(list "-DUSE_PROJ_LIB=4" ;use API version 4
+           #:configure-flags #~(list "-DUSE_PROJ_LIB=6" ;use API version 6
                                      "-DWITH_LUAJIT=ON"
                                      "-DEXTERNAL_LIBOSMIUM=ON"
                                      "-DEXTERNAL_PROTOZERO=ON"
                                      "-DEXTERNAL_FMT=ON")))
     (inputs (list boost
                   bzip2
+                  cli11
                   expat
                   fmt-8
                   libosmium
                   luajit
                   nlohmann-json
                   postgresql
-                  proj-7
+                  proj
                   protozero
                   zlib))
     (native-inputs (list pandoc python python-argparse-manpage))
@@ -2508,19 +2567,19 @@ track your position right from your laptop.")
         "-DLICENSING_PROVIDER:BOOL=OFF"
         "-DMapper_MANUAL_QTHELP:BOOL=OFF")))
     (inputs
-     `(("clipper" ,clipper)
-       ("cups" ,cups)
-       ("curl" ,curl)
-       ("gdal" ,gdal)
-       ("proj" ,proj)
-       ("qtbase" ,qtbase-5)
-       ("qtimageformats" ,qtimageformats-5)
-       ("qtlocation" ,qtlocation)
-       ("qtsensors" ,qtsensors)
-       ("zlib" ,zlib)))
+     (list clipper
+           cups
+           curl
+           gdal
+           proj
+           qtbase-5
+           qtimageformats-5
+           qtlocation
+           qtsensors
+           zlib))
     (native-inputs
-     `(("doxygen" ,doxygen)
-       ("qttools-5" ,qttools-5)))
+     (list doxygen
+           qttools-5))
     (home-page "https://www.openorienteering.org/apps/mapper/")
     (synopsis "OpenOrienteering Mapper (OOM)")
     (description
@@ -2529,7 +2588,7 @@ orienteering sport.")
     (license license:gpl3+)))
 
 (define-public grass
-  (let* ((version "7.8.7")
+  (let* ((version "7.8.8")
          (majorminor (string-join (list-head (string-split version #\.) 2) ""))
          (grassxx (string-append "grass" majorminor)))
     (package
@@ -2541,7 +2600,7 @@ orienteering sport.")
          (uri (string-append "https://grass.osgeo.org/" grassxx
                              "/source/grass-" version ".tar.gz"))
          (sha256
-          (base32 "0sbz0ba9p963phvd0gmvfqq1fg4ixpipzcjbf20ys86qavjppzsg"))))
+          (base32 "1gpfbppfajc8d6b9alw9fdzgaa83w26kl6fff1395bc9gal215ms"))))
       (build-system gnu-build-system)
       (inputs
        `(("bzip2" ,bzip2)
@@ -2815,6 +2874,7 @@ growing set of geoscientific methods.")
                              "test_core_pointcloudlayerexporter"
                              "test_core_projectstorage"
                              "test_core_coordinatereferencesystem"
+                             "test_core_overlayexpression"
                              "test_gui_queryresultwidget"
                              "test_provider_copcprovider"
                              "test_provider_eptprovider"
@@ -2838,6 +2898,7 @@ growing set of geoscientific methods.")
                              "PyQgsOGRProviderGpkg"
                              "PyQgsProcessExecutablePt1"
                              "PyQgsProcessExecutablePt2"
+                             "PyQgsProjectionSelectionWidgets"
                              "PyQgsProviderConnectionGpkg"
                              "PyQgsProviderConnectionSpatialite"
                              "PyQgsOGRProvider"
@@ -3046,6 +3107,30 @@ path loss.")
      "This is a python implementation of the geodesic routines in GeographicLib.")
     (license license:expat)))
 
+(define-public python-geoip2fast
+  (package
+    (name "python-geoip2fast")
+    (version "1.2.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (pypi-uri "geoip2fast" version))
+       (sha256
+        (base32 "1cmdjlwjd4pg3qvsb8d4vghqj1im58npxb6dmrd5q90wjga4rfvm"))))
+    (build-system pyproject-build-system)
+    ;; The tests are speed tests or development tests to compare results with
+    ;; a different library.
+    (arguments (list #:tests? #false))
+    (home-page "https://github.com/rabuchaim/geoip2fast")
+    (synopsis
+     "Fast GeoIP2 country/city/asn lookup library")
+    (description
+     "@code{GeoIP2Fast} is a fast @code{GeoIP2} country/city/asn lookup
+library that supports IPv4 and IPv6.  A search takes less than 0.00003
+seconds.  It has its own data file updated twice a week with
+Maxmind-Geolite2-CSV, supports IPv4/IPv6 and is pure Python.")
+    (license license:expat)))
+
 (define-public python-geopy
   (package
     (name "python-geopy")
@@ -3091,15 +3176,8 @@ using third-party geocoders and other data sources.")
               (sha256
                (base32
                 "0inxyj5n4jzgg5xiadqx9sk83gdx5ff989l9s04smdzbd3b8c0c8"))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (native-inputs (list python-pytest python-numpy))
-    (arguments
-      (list #:phases
-            #~(modify-phases %standard-phases
-                (replace 'check
-                  (lambda* (#:key tests? inputs #:allow-other-keys)
-                    (when tests?
-                      (invoke "pytest")))))))
     (home-page "https://github.com/mapado/haversine")
     (synopsis "Calculate the distance between 2 points on Earth")
     (description "This package provides functions to calculate the