(self, polygon)
return -distance
Signed distance from Cell centroid to polygon outline. The returned
        value is negative if the point is outside of the polygon exterior
        boundary.
Signed distance from Cell centroid to polygon outline. The returned
        value is negative if the point is outside of the polygon exterior
        boundary.
Signed distance from Cell centroid to polygon outline . The returned value is negative if the point is outside of the polygon exterior boundary .
def _dist(self, polygon):
        """Signed distance from Cell centroid to polygon outline. The returned
        value is negative if the point is outside of the polygon exterior
        boundary.
        """
        inside = polygon.contains(self.centroid)
        distance = self.centroid.distance(LineString(polygon.exterior.coords))
        if inside:
            return distance
        return -distance
def _dist ( self , polygon ) : inside = polygon . contains ( self . centroid ) distance = self . centroid . distance ( LineString ( polygon . exterior . coords ) ) if inside : return distance return - distance