Skip to content

Commit

Permalink
Fixes #105 and adds source references
Browse files Browse the repository at this point in the history
  • Loading branch information
SbastianGarzon committed Jan 5, 2021
1 parent c780641 commit 77508a2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
7 changes: 3 additions & 4 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,9 @@ def test_netcdf_extract_bbox_time():
[-90.0, 0.0, 90.0, 357.5], ['2002-07-01', '2002-07-31']]


def test_gpkg_extract_bboxs():
result = geoextent.fromFile("tests/testdata/geopackage/nc.gpkg", bbox=True)
assert result['bbox'] == pytest.approx([-84.323835, 33.882102, -75.456585, 36.589757], abs=tolerance)
assert result["crs"] == "4326"
def test_gpkg_extract_tbox():
result = geoextent.fromFile("tests/testdata/geopackage/wandelroute_maastricht.gpkg", tbox=True)
assert result['tbox'] == ['2021-01-05', '2021-01-05']


@pytest.mark.skipif("TRAVIS" in os.environ and os.environ["TRAVIS"] == "true",
Expand Down
8 changes: 8 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,14 @@ def test_gpkg_bbox(script_runner):
assert "4326" in result


def test_gpkg_tbox(script_runner):
ret = script_runner.run('geoextent', '-t', 'tests/testdata/geopackage/wandelroute_maastricht.gpkg')
result = ret.stdout
assert ret.success, "process should return success"
assert ret.stderr == '', "stderr should be empty"
assert "['2021-01-05', '2021-01-05']" in result


def test_csv_bbox(script_runner):
ret = script_runner.run('geoextent', '-b', 'tests/testdata/csv/cities_NL.csv')
assert ret.success, "process should return success"
Expand Down
3 changes: 2 additions & 1 deletion tests/testdata/data-sources.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
| [Carto BCN / martgnz] | Barcelona districts | geojson | CC-BY 4.0 |
| [Google] | abstractviews_timeprimitive_example | kml | CC-BY 4.0 |
| [Tkrajina] | gpx1.1_with_all_fields.gpx | gpx | Apache License 2.0 |

| [geoextent] | ifgi_to_denkpause.sph | shp | PDDL |
| [geoextent] | wandelroute_maastricht.gpkg | gpkg | PDDL |

[sf]: https://github.com/r-spatial/sf
[geoextent]: https://github.com/o2r-project/geoextent
Expand Down
Binary file not shown.

0 comments on commit 77508a2

Please sign in to comment.