How to use the topojson.utils.is_point function in topojson

To help you get started, we’ve selected a few topojson examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github calvinmetcalf / topojson.py / topojson / line.py View on Github external
def map_func (self,arc):
        if len(arc)==2 and type(arc[0])==type(1):
            arc= [arc]
        i = 1
        n = len(arc)
        point = arc[0]
        x1 = point[0]
        x2= dx =y2 = dy=False
        y1 = point[1]
        points = [[int(x1), int(y1)]]
        while i < n:
            point = arc[i]
            if not is_point(point):
                i+=1
                continue
            x2 = point[0]
            y2 = point[1]
            dx = int(x2 - x1)
            dy = int(y2 - y1)
            if dx or dy:
                points.append([dx, dy])
                x1 = x2
                y1 = y2
            i+=1
        return points
    def get_arcs (self):