コード例 #1
0
def test_image_matrix(station_names):
    data = get_image_matrix()
    fc = FeatureCollection()
    for n in station_names:
        x, y = get_xy(n)
        fc.add_polygon(rbs.get_poly(x, y), dict(weight=data[x][y], name=n))

    # So that scale is from 0 to 1
    fc.add_polygon(rbs.get_poly(100, 100), dict(weight=0))
    fc.dump('tmp1.geojson')
コード例 #2
0
def test_image_matrix(station_names):
    data = get_image_matrix()
    fc = FeatureCollection()
    for n in station_names:
        x, y = get_xy(n)
        fc.add_polygon(rbs.get_poly(x, y), dict(weight=data[x][y], name=n))

    # So that scale is from 0 to 1
    fc.add_polygon(rbs.get_poly(100, 100), dict(weight=0))
    fc.dump('tmp1.geojson')
コード例 #3
0
 def get_avail(name):
     x, y = get_xy(name)
     return data[x][y]
コード例 #4
0
def draw_rates(filename):
    fc = FeatureCollection()
    rates = pickle.load(open(filename))['rates']
    for weight, station in zip(rates, sio.loadmat(MAT_FILE)['stations']):
        fc.add_polygon(rbs.get_poly(*get_xy(station)), {'weight': weight})
    fc.dump('rates.geojson')
コード例 #5
0
def draw_rates(filename):
    fc = FeatureCollection()
    rates = pickle.load(open(filename))['rates']
    for weight, station in zip(rates, sio.loadmat(MAT_FILE)['stations']):
        fc.add_polygon(rbs.get_poly(*get_xy(station)), {'weight': weight})
    fc.dump('rates.geojson')
コード例 #6
0
 def get_avail(name):
     x, y = get_xy(name)
     return data[x][y]