Skip to content

Commit

Permalink
Add test for orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
magnusuMET committed Jan 8, 2025
1 parent 64ce5be commit c199262
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,15 @@ def create_grid_data():
Z = numpy.sqrt(X*X + Y*Y)
return latrange, lonrange, Z

def test_orientation_order_gh31(self):
# Flipping x should still result in CCW orientation
# of final polygon
x = numpy.linspace(0, 10, 14)[::-1]
y = numpy.linspace(10, 20, 15)
x, y = numpy.meshgrid(x, y)
z = numpy.sin(x) * numpy.cos(y)
contourf = plt.contourf(x, y, z)
mp = geojsoncontour.contourf_to_geojson(contourf, ndigits=3)

class ContourPlotConfig(object):
def __init__(self, level_lower=0.0, level_upper=100.0, colormap=plt.cm.jet, unit=''): # jet, jet_r, YlOrRd, gist_rainbow
Expand Down

0 comments on commit c199262

Please sign in to comment.