diff options
Diffstat (limited to 'gnu/packages/geo.scm')
-rw-r--r-- | gnu/packages/geo.scm | 263 |
1 files changed, 163 insertions, 100 deletions
diff --git a/gnu/packages/geo.scm b/gnu/packages/geo.scm index 701a3f57b7..86d22995a0 100644 --- a/gnu/packages/geo.scm +++ b/gnu/packages/geo.scm @@ -3,7 +3,7 @@ ;;; Copyright © 2016 Alex Griffin <a@ajgrf.com> ;;; Copyright © 2017, 2018 Björn Höfling <bjoern.hoefling@bjoernhoefling.de> ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2018, 2023 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2018, 2023, 2024 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2018, 2019 Arun Isaac <arunisaac@systemreboot.net> ;;; Copyright © 2018 Joshua Sierles, Nextjournal <joshua@nextjournal.com> ;;; Copyright © 2018, 2019, 2020, 2021 Julien Lepiller <julien@lepiller.eu> @@ -14,10 +14,11 @@ ;;; 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 © 2021, 2023 Vinicius Monego <monego@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) @@ -938,14 +940,14 @@ pyproj, Rtree, and Shapely.") (define-public python-geopandas (package (name "python-geopandas") - (version "0.13.2") + (version "0.14.2") (source (origin (method url-fetch) (uri (pypi-uri "geopandas" version)) (sha256 (base32 - "0s59jjk02l1zajz95n1c7fr3fyj44wzxn569q2y7f34042f6vdg5")))) + "1nycf79nzris058lz1fyg0byj874wxq33an3y74zvybnhdxxawbf")))) (build-system pyproject-build-system) (arguments (list @@ -954,6 +956,8 @@ pyproj, Rtree, and Shapely.") ;; Test files are missing "--ignore=geopandas/tests/test_overlay.py" "--ignore=geopandas/io/tests/test_file.py" + ;; Number of open figures changed during test + "-k" "not test_pandas_kind" ;; Disable tests that require internet access. "-m" "not web"))) (propagated-inputs @@ -971,56 +975,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 @@ -1269,15 +1323,7 @@ utilities for data translation and processing.") (file-name (git-file-name name version)) (sha256 (base32 "0jsraqzq82pw19wvx84x7w5cs8agr44a9b5y0jjw540wim4xa73r")))) - (build-system python-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"))))))) + (build-system pyproject-build-system) (native-inputs (list python-pytest python-pytest-runner)) (home-page "https://github.com/GeospatialPython/pyshp") @@ -1289,40 +1335,46 @@ utilities for data translation and processing.") (define-public python-cartopy (package (name "python-cartopy") - ;; This is a post-release fix that adds build_ext to setup.py. - (version "0.21.1") + (version "0.22.0") (source (origin (method url-fetch) (uri (pypi-uri "Cartopy" version)) (sha256 - (base32 "02i5rjhvrsi3vgj8kfsdx77g1xl59jh2a671qqqj4n682abn9mc9")))) - (build-system python-build-system) + (base32 "0jdv92az0b7qxdvalh29kasw3knsl570cz7q3vql67ck400zj05k")))) + (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (replace 'check - (lambda* (#:key inputs outputs tests? #:allow-other-keys) - (when tests? - (add-installed-pythonpath inputs outputs) - (invoke "python" "-m" "pytest" "--pyargs" "cartopy" - ;; These tests require online data. - "-m" "not natural_earth and not network" - "-k" - (string-append - ;; This one too but it's not marked as such. - "not test_gridliner_labels_bbox_style" - ;; Those tests fail with proj 9.2.0 - ;; https://github.com/SciTools/cartopy/issues/2145 - " and not test_epsg" - " and not test_default" - " and not test_eccentric_globe" - " and not test_ellipsoid_transform" - " and not test_eccentric_globe")))))))) + (list + #:test-flags + '(list + "--pyargs" "cartopy" + ;; These tests require online data. + "-m" "not natural_earth and not network" + "-k" + (string-append + ;; This one too but it's not marked as such. + "not test_gridliner_labels_bbox_style" + ;; Accuracy problems + " and not test_single_spole" + " and not test_single_npole" + ;; Incomplete shapefile definition + " and not test_gshhs" + " and not test_geometry" + " and not test_record" + " and not test_bounds")) + #:phases + '(modify-phases %standard-phases + ;; We don't want to create an entrypoint for + ;; tools/cartopy_feature_download.py, because that file is not + ;; installed. + (add-after 'unpack 'remove-endpoint + (lambda _ + (substitute* "pyproject.toml" + (("^feature_download = .*") ""))))))) (propagated-inputs (list python-matplotlib python-numpy - python-pykdtree + python-packaging python-pyproj python-pyshp python-scipy @@ -1330,10 +1382,12 @@ utilities for data translation and processing.") (inputs (list geos)) (native-inputs - (list python-cython - python-flufl-lock + (list python-coveralls + python-cython python-pytest - python-pytest-mpl)) + python-pytest-cov + python-pytest-mpl + python-pytest-xdist)) (home-page "https://scitools.org.uk/cartopy/docs/latest/") (synopsis "Cartographic library for visualisation") (description @@ -1484,13 +1538,13 @@ to create databases that are optimized for rendering/tile/map-services.") (define-public python-metpy (package (name "python-metpy") - (version "1.5.1") + (version "1.6.1") (source (origin (method url-fetch) (uri (pypi-uri "MetPy" version)) (sha256 (base32 - "1is6rradl97k04hf27dhzla4y4j98hibran3rbz6xh226q1r9vmb")))) + "1pzzanar797wkn6ljs47vni1fwli570d5qsiw1kpw0j1xymcmfsm")))) (build-system pyproject-build-system) (arguments ;; Too many of the tests in the files below require online data. @@ -1513,7 +1567,23 @@ to create databases that are optimized for rendering/tile/map-services.") " and not test_zoom_xarray" " and not test_parse_wpc_surface_bulletin" " and not test_add_timestamp_xarray" - " and not test_parse_wpc_surface_bulletin_highres")))) + " and not test_parse_wpc_surface_bulletin_highres")) + #:phases + '(modify-phases %standard-phases + (add-after 'unpack 'fix-version-check + (lambda _ + (substitute* "src/metpy/testing.py" + (("^( +)match = pattern.*" m indent) + (string-append indent "\ +version_spec = re.sub('[()]', '', version_spec)\n" m))))) + ;; The deprecation warning from python-future's use of imp breaks the + ;; tests. + (add-after 'unpack 'hide-imp-deprecation-warnings + (lambda _ + (substitute* "pyproject.toml" + (("\"ignore:numpy.ndarray size changed:RuntimeWarning\"," m) + (string-append m " +\"ignore:the imp module is deprecated\",")))))))) (propagated-inputs (list python-importlib-resources python-matplotlib python-numpy @@ -1524,8 +1594,8 @@ to create databases that are optimized for rendering/tile/map-services.") python-scipy python-traitlets python-xarray)) - (native-inputs (list python-cartopy python-netcdf4 python-pytest - python-pytest-mpl python-shapely)) + (native-inputs (list python-netcdf4 python-packaging python-pytest + python-pytest-mpl)) (home-page "https://github.com/Unidata/MetPy") (synopsis "Collection of tools to deal with weather data") (description "MetPy is a collection of tools in Python for reading, @@ -2481,19 +2551,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 @@ -3064,15 +3134,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 |