How to use the topojson.utils.is_infinit 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 / topology.py View on Github external
stitch(objects)
            [x0,x1,y0,y1] = bound(objects)
        if x0 < -180 + E:
            x0 = -180
        if x1 > 180 - E:
            x1 = 180
        if y0 < -90 + E:
            y0 = -90
        if y1 > 90 - E:
            y1 = 90
    if is_infinit(x0):
        x0 = 0
    if is_infinit(x1):
        x1 = 0

    if is_infinit(y0):
        y0 = 0
    if is_infinit(y1):
        y1 = 0
    [kx,ky]=make_ks(quantization,x0,x1,y0,y1)
    if not quantization:
        quantization = x1 + 1
        x0 = y0 = 0
        
    class findEmax(Types):
        def __init__(self,obj):
            self.emax=0
            self.obj(obj)
        def point(self,point):
            x1 = point[0]
            y1 = point[1]
            x = ((x1 - x0) * kx)
github calvinmetcalf / topojson.py / topojson / topology.py View on Github external
system = systems["spherical"]
    if system.name == 'spherical':
        if oversize:
            raise Exception(u"spherical coordinates outside of [±180°, ±90°]")
        if stitchPoles:
            stitch(objects)
            [x0,x1,y0,y1] = bound(objects)
        if x0 < -180 + E:
            x0 = -180
        if x1 > 180 - E:
            x1 = 180
        if y0 < -90 + E:
            y0 = -90
        if y1 > 90 - E:
            y1 = 90
    if is_infinit(x0):
        x0 = 0
    if is_infinit(x1):
        x1 = 0

    if is_infinit(y0):
        y0 = 0
    if is_infinit(y1):
        y1 = 0
    [kx,ky]=make_ks(quantization,x0,x1,y0,y1)
    if not quantization:
        quantization = x1 + 1
        x0 = y0 = 0
        
    class findEmax(Types):
        def __init__(self,obj):
            self.emax=0
github calvinmetcalf / topojson.py / topojson / topology.py View on Github external
if x0 < -180 + E:
            x0 = -180
        if x1 > 180 - E:
            x1 = 180
        if y0 < -90 + E:
            y0 = -90
        if y1 > 90 - E:
            y1 = 90
    if is_infinit(x0):
        x0 = 0
    if is_infinit(x1):
        x1 = 0

    if is_infinit(y0):
        y0 = 0
    if is_infinit(y1):
        y1 = 0
    [kx,ky]=make_ks(quantization,x0,x1,y0,y1)
    if not quantization:
        quantization = x1 + 1
        x0 = y0 = 0
        
    class findEmax(Types):
        def __init__(self,obj):
            self.emax=0
            self.obj(obj)
        def point(self,point):
            x1 = point[0]
            y1 = point[1]
            x = ((x1 - x0) * kx)
            y =((y1 - y0) * ky)
            ee = system.distance(x1, y1, x / kx + x0, y / ky + y0)
github calvinmetcalf / topojson.py / topojson / topology.py View on Github external
if oversize:
            raise Exception(u"spherical coordinates outside of [±180°, ±90°]")
        if stitchPoles:
            stitch(objects)
            [x0,x1,y0,y1] = bound(objects)
        if x0 < -180 + E:
            x0 = -180
        if x1 > 180 - E:
            x1 = 180
        if y0 < -90 + E:
            y0 = -90
        if y1 > 90 - E:
            y1 = 90
    if is_infinit(x0):
        x0 = 0
    if is_infinit(x1):
        x1 = 0

    if is_infinit(y0):
        y0 = 0
    if is_infinit(y1):
        y1 = 0
    [kx,ky]=make_ks(quantization,x0,x1,y0,y1)
    if not quantization:
        quantization = x1 + 1
        x0 = y0 = 0
        
    class findEmax(Types):
        def __init__(self,obj):
            self.emax=0
            self.obj(obj)
        def point(self,point):