Пример #1
0
def test_ways_in_bbox(bbox1, dataframes1):
    nodes, ways, waynodes = osm.ways_in_bbox(*bbox1)
    exp_nodes, exp_ways, exp_waynodes = dataframes1

    pdt.assert_frame_equal(nodes, exp_nodes)
    pdt.assert_frame_equal(ways, exp_ways)
    pdt.assert_frame_equal(waynodes, exp_waynodes)
Пример #2
0
def add_intersections(outputfile, bbox, network, network_type="drive", mode='a'):
    nodes, ways, waynodes = osm.ways_in_bbox(*bbox, network_type=network_type)
    waynodes = waynodes[np.in1d(waynodes["node_id"], network.node_ids)]
    intersections = x_node_intersections(waynodes, x=[1, 3, 4], last_open=True)
    intersections["node_id"] = intersections.index.values
    with pd.HDFStore(outputfile, mode=mode) as store:
        store['intersections'] = intersections
Пример #3
0
def test_ways_in_bbox_walk_network(bbox3, network_type, noset):
    nodes, ways, waynodes = osm.ways_in_bbox(*bbox3, network_type=network_type)

    for _, way in ways.iterrows():
        assert way['highway'] not in noset