Commit 1473da69 authored by Adam Paquette's avatar Adam Paquette
Browse files

updated doc string, fixed test error

parent 9f64f9c0
Loading
Loading
Loading
Loading
+4 −9
Original line number Diff line number Diff line
@@ -430,13 +430,11 @@ class Edge(dict, MutableMapping):
        """
        Acts on the edge given either the source node
        or the destination node and returns the percentage
        of overlap covered by the keypoints
        of overlap covered by the keypoints. Data for the
        overlap is gathered from the source node of the edge
        resulting in a maximum area difference of 2% when compared
        to the destination.

        Parameters
        ----------
        image : string
                Parameter to determine which node on the edge
                to look at
        Returns
        -------
        total_overlap_percentage : float
@@ -453,14 +451,11 @@ class Edge(dict, MutableMapping):
        source_coords = self.source.geodata.latlon_corners
        destination_coords = self.destination.geodata.latlon_corners

        # pixel space
        convex_hull = cg.convex_hull(source_array)

        convex_points = [self.source.geodata.pixel_to_latlon(row[0], row[1]) for row in convex_hull.points[convex_hull.vertices]]
        convex_coords = [(i, j) for i, j in convex_points]

        # Convert the convex hull pixel coordinates to latlon
        # coordinates
        source_poly = utils.array_to_poly(source_coords)
        destination_poly = utils.array_to_poly(destination_coords)
        convex_poly = utils.array_to_poly(convex_coords)
+2 −1
Original line number Diff line number Diff line
@@ -2,6 +2,7 @@ import unittest
import numpy as np
import pandas as pd

from osgeo import ogr
from .. import utils


@@ -137,5 +138,5 @@ class TestUtils(unittest.TestCase):
                           [7, 8, 9]])
        geom1 = utils.array_to_poly(array1)

        self.assertIsInstance(geom1, dict)
        self.assertIsInstance(geom1, ogr.Geometry)
        self.assertRaises(ValueError, utils.array_to_poly, array2)
 No newline at end of file