def _is_not_original(self, edge): geom = LineString(*edge) boundary = self._passableArea.get_boundary() originalBoundary = self._passableArea.get_original_boundary() #print originalBoundary.coords #print geom[0] con1 = geom[0] in boundary[0].coords con2 = geom[1] in boundary[0].coords con3 = geom.within(originalBoundary[0]) if con1 and con2 and not con3: edgeGraph = nx.Graph() edgeGraph.add_edge(*edge) return True return False
def _is_within_polygon(self, edge): geom = LineString(*edge) originalBoundary = self._passableArea.get_original_boundary() if geom.within(originalBoundary) or geom.within(originalBoundary[0]): return True return False