Example #1
0
 def subset_bounds(self, polygon):
     bounds = bounding_coords(polygon)
     xbnd = self.colbnds.value[:]
     ybnd = self.rowbnds.value[:]
     xbnd_idx1 = self._subset_(xbnd[:, 0],
                               bounds.min_x,
                               bounds.max_x,
                               ret_idx=True,
                               method='open')
     xbnd_idx2 = self._subset_(xbnd[:, 1],
                               bounds.min_x,
                               bounds.max_x,
                               ret_idx=True,
                               method='open')
     ybnd_idx1 = self._subset_(ybnd[:, 0],
                               bounds.min_y,
                               bounds.max_y,
                               ret_idx=True,
                               method='open')
     ybnd_idx2 = self._subset_(ybnd[:, 1],
                               bounds.min_y,
                               bounds.max_y,
                               ret_idx=True,
                               method='open')
     return (xbnd[xbnd_idx1 * xbnd_idx2, :], ybnd[ybnd_idx1 * ybnd_idx2, :])
Example #2
0
 def subset_bounds(self,polygon):
     bounds = bounding_coords(polygon)
     xbnd = self.colbnds.value[:]
     ybnd = self.rowbnds.value[:]
     xbnd_idx1 = self._subset_(xbnd[:,0],bounds.min_x,bounds.max_x,ret_idx=True,method='open')
     xbnd_idx2 = self._subset_(xbnd[:,1],bounds.min_x,bounds.max_x,ret_idx=True,method='open')
     ybnd_idx1 = self._subset_(ybnd[:,0],bounds.min_y,bounds.max_y,ret_idx=True,method='open')
     ybnd_idx2 = self._subset_(ybnd[:,1],bounds.min_y,bounds.max_y,ret_idx=True,method='open')
     return(xbnd[xbnd_idx1*xbnd_idx2,:],ybnd[ybnd_idx1*ybnd_idx2,:])
Example #3
0
 def subset_centroids(self,polygon):
     bounds = bounding_coords(polygon)
     y = self._subset_(self.row.value[:],bounds.min_y,bounds.max_y)
     x = self._subset_(self.col.value[:],bounds.min_x,bounds.max_x)
     return(x,y)
Example #4
0
 def subset_centroids(self, polygon):
     bounds = bounding_coords(polygon)
     y = self._subset_(self.row.value[:], bounds.min_y, bounds.max_y)
     x = self._subset_(self.col.value[:], bounds.min_x, bounds.max_x)
     return (x, y)