Commit ceda438b authored by jay's avatar jay
Browse files

Replaced the node / edge dicts with custom data types.

parent b1e2f2e3
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -201,6 +201,14 @@ class GeoDataset(object):

        return self._xy_extent

    @property
    def pixel_area(self):
        if not getattr(self, '_pixel_area', None):
            extent = self.xy_extent
            self._pixel_area = extent[1][0] * extent[1][1]

        return self._pixel_area

    @property
    def pixel_width(self):
        if not getattr(self, '_pixel_width', None):
+358 −196

File changed.

Preview size limit exceeded, changes collapsed.

+31 −17

File changed.

Preview size limit exceeded, changes collapsed.

+0 −0

Empty file added.

+21 −0
Original line number Diff line number Diff line
from scipy.spatial import ConvexHull

def convex_hull_ratio(points, ideal_area):
    """

    Parameters
    ----------
    points : ndarray
             (n, 2) array of point coordinates

    ideal_area : float
                 The total area that could be covered

    Returns
    -------
    ratio : float
            The ratio convex hull volume / ideal_area

    """
    hull = ConvexHull(points)
    return hull.volume / ideal_area
 No newline at end of file
Loading