Skip to content

Commit

Permalink
Updated to work with matplotlib 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jandic committed Dec 10, 2013
1 parent 305896e commit ac6e24a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions agoodle/agoodle.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import numpy as np
import matplotlib.nxutils as nx
from matplotlib.path import Path
from osgeo import gdal
from osgeo import ogr, osr
import os.path as op
Expand Down Expand Up @@ -203,7 +203,8 @@ def mask_with_poly(self, verts, mask_value=0, copy=True):
iverts = np.array([self.rw2index(v[0], v[1]) for v in verts])
ys, xs = np.indices(self.shape)
xys = np.column_stack((xs.flat, ys.flat))
insiders = nx.points_inside_poly(xys, iverts)
path = Path(iverts)
insiders = path.contains_points(xys)
outsiders = xys[(insiders == 0)]

if copy:
Expand Down

0 comments on commit ac6e24a

Please sign in to comment.