diff --git a/CITATION.cff b/CITATION.cff index 907e813..bc71c41 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -7,18 +7,24 @@ authors: affiliation: Opening Reproducible Research, University of Münster, Münster, Germany email: daniel.nuest@uni-muenster.de website: https://nuest.staff.ifgi.de/ + - family-names: Garzón + given-names: Sebastian + orcid: https://orcid.org/0000-0002-8335-9312 + affiliation: Opening Reproducible Research, University of Münster, Münster, Germany + email: jgarzon@uni-muenster.de + - family-names: Qamaz given-names: Yousef title: "geoextent" -version: 0.3.0 +version: 0.7.1 doi: 10.5281/zenodo.3925693 -date-released: 2020-07-01 +date-released: 2020-05-11 license: MIT url: https://o2r.info/geoextent/ -commit: baf299f304d7ad16533fbb3d74e8ffc0b63cadfa +commit: #todo abstract: "Python library for extracting geospatial extent of files and directories with multiple data formats. This project is developed as part of the DFG-funded research project Opening Reproducible Research (o2r, https://o2r.info)." repository-artifact: https://pypi.org/project/geoextent/0.3.0/ repository-code: https://github.com/o2r-project/geoextent/releases/tag/v0.3.0 identifiers: - type: "swh" - value: "swh:1:rev:6aca93956d5cd6742318fd3ab27bb176b5f8c24b" \ No newline at end of file + value: "swh:1:rev:#todo" diff --git a/README.md b/README.md index 56b8e9d..e63d634 100644 --- a/README.md +++ b/README.md @@ -66,7 +66,7 @@ See [CONTRIBUTING.md](https://github.com/o2r-project/geoextent/blob/master/CONTR ## How to cite -> Nüst, Daniel and Qamaz, Yousef. (2020, July 1). o2r-project/geoextent (Version v0.3.0). Zenodo. https://doi.org/10.5281/zenodo.3925693 +> Nüst, Daniel; Garzón, Sebastian and Qamaz, Yousef. (2021, May 11). o2r-project/geoextent (Version v0.7.1). Zenodo. https://doi.org/10.5281/zenodo.3925693 See also the `CITATION.cff` and `codemeta.json` files in this repository, which can possibly be imported in the reference manager of your choice. diff --git a/codemeta.json b/codemeta.json index 6d4a2d1..44d9ca6 100644 --- a/codemeta.json +++ b/codemeta.json @@ -6,11 +6,11 @@ "contIntegration": "https://travis-ci.org/github/o2r-project/geoextent", "dateCreated": "2019-08-16", "datePublished": "2020-03-25", - "dateModified": "2020-07-01", - "downloadUrl": "https://pypi.org/project/geoextent/0.3.0/", + "dateModified": "2020-05-11", + "downloadUrl": "https://pypi.org/project/geoextent/0.7.1/", "issueTracker": "https://github.com/o2r-project/geoextent/issues", "name": "geoextent", - "version": "0.3.0", + "version": "0.7.1", "identifier": "https://doi.org/10.5281/zenodo.3925693", "description": "Python library for extracting geospatial extent of files and directories with multiple data formats. This project is developed as part of the DFG-funded research project Opening Reproducible Research (o2r, https://o2r.info).", "applicationCategory": "Geoinformatics", @@ -47,6 +47,17 @@ "name": "Opening Reproducible Research, University of Münster, Münster, Germany" } }, + { + "@type": "Person", + "@id": "https://orcid.org/0000-0002-8335-9312", + "givenName": "Sebastian", + "familyName": "Garzón", + "email": "jgarzon@uni-muenster.de", + "affiliation": { + "@type": "Organization", + "name": "Opening Reproducible Research, University of Münster, Münster, Germany" + } + }, { "@type": "Person", "givenName": "Yousef", diff --git a/docs/source/index.rst b/docs/source/index.rst index 2332809..203b52c 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -26,7 +26,7 @@ How to cite :: - Nüst, Daniel and Qamaz, Yousef. (2020, July 1). o2r-project/geoextent (Version v0.3.0). Zenodo. https://doi.org/10.5281/zenodo.3925693 + Nüst, Daniel; Garzón, Sebastian and Qamaz, Yousef. (2021, May 11). o2r-project/geoextent (Version v0.7.1). Zenodo. https://doi.org/10.5281/zenodo.3925693 ------ diff --git a/geoextent/__init__.py b/geoextent/__init__.py index afb0d8c..9c8f417 100644 --- a/geoextent/__init__.py +++ b/geoextent/__init__.py @@ -1,3 +1,3 @@ name = "geoextent" -__version__ = '0.7.0' +__version__ = '0.7.1' diff --git a/geoextent/lib/helpfunctions.py b/geoextent/lib/helpfunctions.py index 02eea51..d150ff4 100644 --- a/geoextent/lib/helpfunctions.py +++ b/geoextent/lib/helpfunctions.py @@ -389,8 +389,8 @@ def transform_bbox(x): ring = ogr.Geometry(ogr.wkbLinearRing) ring.AddPoint(x[0], x[1]) ring.AddPoint(x[2], x[1]) - ring.AddPoint(x[0], x[3]) ring.AddPoint(x[2], x[3]) + ring.AddPoint(x[0], x[3]) ring.CloseRings() # Create polygon poly = ogr.Geometry(ogr.wkbPolygon) diff --git a/setup.py b/setup.py index 8944dd3..e7e30a1 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,12 @@ 'pygeoj', 'pyshp', 'pygdal', - 'python-dateutil' + 'python-dateutil', + 'pandas', + 'requests', + 'numpy', + 'traitlets', + 'wheel' ], entry_points={ "console_scripts": [ diff --git a/tests/test_cli.py b/tests/test_cli.py index 9a67a52..0875dde 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -3,7 +3,7 @@ import sys import pytest import tempfile - +import geoextent from help_functions_test import create_zip, parse_coordinates, tolerance from osgeo import gdal @@ -375,7 +375,7 @@ def test_zenodo_valid_but_removed_repository(script_runner): assert "does not exist" in ret.stderr -def test_zenodo_invalid_DOI_but_removed_repository(script_runner): +def test_zenodo_invalid_doi_but_removed_repository(script_runner): ret = script_runner.run('geoextent', '-b', '-t', 'https://doi.org/10.5281/zenodo.not.exist') assert not ret.success assert "Geoextent can not handle this repository identifier" in ret.stderr @@ -394,14 +394,22 @@ def test_zenodo_valid_but_not_open_access(script_runner): def test_export_relative_path(script_runner): - with tempfile.TemporaryDirectory() as tmp: - relative = "geoextent_output.gpkg" - script_runner.run('geoextent', '-b', '-t', '--output', relative, 'tests/testdata/folders/folder_two_files') - datasource = ogr.Open(relative) - layer = datasource.GetLayer(0) - ext = layer.GetExtent() - bbox = [ext[0], ext[2], ext[1], ext[3]] - os.remove(relative) + relative = "geoextent_output.gpkg" + geo_version = geoextent.__version__ + script_runner.run('geoextent', '-b', '-t', '--output', relative, 'tests/testdata/folders/folder_two_files') + datasource = ogr.Open(relative) + layer = datasource.GetLayer(0) + + for feature in layer: + if feature.GetField("handler") == "geoextent:" + geo_version: + bbox_geom = feature.geometry() + + ext = bbox_geom.GetEnvelope() + is_valid = bbox_geom.IsValid() + bbox = [ext[0], ext[2], ext[1], ext[3]] + os.remove(relative) + + assert is_valid, 'Check that the figure is valid ()' assert bbox == pytest.approx([2.052333, 41.317038, 7.647256, 51.974624], abs=tolerance) @@ -419,7 +427,7 @@ def test_zenodo_valid_doi_repository_wrong_geopackage_extension(script_runner): with pytest.warns(ResourceWarning): with tempfile.NamedTemporaryFile(suffix=".abc") as tmp: ret = script_runner.run('geoextent', '-b', '-t', '--output', tmp.name, - 'https://doi.org/10.5281/zenodo.820562' + 'https://doi.org/10.5281/zenodo.820562' ) assert ret.success, "process should return success"