Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TST: Force an orientation in the lakes shapereader test #2028

Merged
merged 1 commit into from
Apr 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/cartopy/tests/test_shapereader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import numpy as np
from numpy.testing import assert_array_almost_equal
import pytest
import shapely.geometry as sgeom

import cartopy.io.shapereader as shp

Expand All @@ -20,7 +21,6 @@ def setup_class(self):
self.reader = shp.Reader(LAKES_PATH)
names = [record.attributes['name'] for record in self.reader.records()]
# Choose a nice small lake
print([name for name in names if 'Nicaragua' in name])
self.lake_name = 'Lago de\rNicaragua'
self.lake_index = names.index(self.lake_name)
self.test_lake_geometry = \
Expand All @@ -31,7 +31,9 @@ def test_geometry(self):
lake_geometry = self.test_lake_geometry
assert lake_geometry.type == 'Polygon'

polygon = lake_geometry
# force an orientation due to potential reader differences
# with pyshp 2.2.0 forcing a specific orientation.
polygon = sgeom.polygon.orient(lake_geometry, -1)

expected = np.array([(-84.85548682324658, 11.147898667846633),
(-85.29013729525353, 11.176165676310276),
Expand Down