Skip to content

Commit

Permalink
refactor(test_helper): reuse shapely object
Browse files Browse the repository at this point in the history
  • Loading branch information
SlowMo24 committed Jul 3, 2024
1 parent 2b2049e commit 2b8a782
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions ohsome/test/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,16 +250,14 @@ def test_format_bpolys():
polygon = Polygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)))
assert format_bpolys(polygon) == geojson

polygon = gpd.GeoSeries(
[Polygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)))],
series = gpd.GeoSeries(
data=[polygon],
crs="EPSG:4326",
)
assert format_bpolys(polygon) == geojson
assert format_bpolys(series) == geojson

polygon = gpd.GeoDataFrame(
geometry=[
Polygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0), (0.0, 0.0)))
],
df = gpd.GeoDataFrame(
geometry=[polygon],
crs="EPSG:4326",
)
assert format_bpolys(polygon) == geojson
assert format_bpolys(df) == geojson

0 comments on commit 2b8a782

Please sign in to comment.