Esempio n. 1
0
def line_to_row_col(line, hg):
    splits = line.split(',')
    try:
        lon = float(splits[10])
        lat = float(splits[11])
        x, y = Mercator.to_web_mercator(lon, lat)
        rc = hg.xy2rc(x, y)
        return rc, 1
    except:
        return (0, 0), -1
Esempio n. 2
0
def line_to_row_col(line):
    splits = line.split(',')
    try:
        lon = float(splits[10])
        lat = float(splits[11])
        x, y = Mercator.to_web_mercator(lon, lat)
        c = int(math.floor(x / 100))
        r = int(math.floor(y / 100))
        return (r, c), 1
    except:
        return (0, 0), -1