<jupyter_start><jupyter_text>Street network figure-ground diagrams, a la <NAME>' *Great Streets*<jupyter_code>import osmnx as ox, matplotlib.pyplot as plt
%matplotlib inline
ox.config(log_file=True, log_console=True, use_cache=True)
dist = 805 # 1 mile in meters
places = [['sf', (37.793897, -122.402189), 'drive_service'],
          ['portland', (45.517309, -122.682138), 'drive_service'],
          ['irvine', (33.694981, -117.841375), 'drive_service'],
          ['rome', (41.901336, 12.471831), 'all']]
edges = []
for name, point, nt in places:
    print(name, point)
    G = ox.graph_from_point(point, distance=dist, distance_type='bbox', network_type=nt, truncate_by_edge=True)
    G = ox.project_graph(G)
    
    # create the bounding box in UTM zone units to limit the plot to the bounding box requested
    # this is only necessary when truncate_by_edge=True to prevent display of nodes/edges that extend beyond bounding box
    bbox_proj = ox.bbox_from_point(point, dist, project_utm=True, utm_crs=G.graph['crs'])
    
    ew = []
    for u, v, key, data in G.edges(keys=True, data=True):
        if data['highway'] in ['footway', 'steps', 'pedestrian', 'service', 'footway', 'path', 'track']:
            width = 1.5
        elif data['highway'] in ['motorway']:
            width = 6
        else:
            width = 4
        ew.append(width)
        
    fig, ax = ox.plot_graph(G, bbox=bbox_proj, fig_height=8, margin=0, node_size=0, edge_linewidth=ew,
                               edge_color='w', bgcolor='#333333', show=True, save=True, filename='gs_'+name)
    
    edges.extend(G.edges(keys=True, data=True))
hwys = [data['highway'] for u, v, key, data in edges]
tags = list(set([hwy[0] if isinstance(hwy, list) else hwy for hwy in hwys]))
tags<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14301613800779076, 'fraction_numerical': 0.04730105731775181, 'mean_word_length': 3.483790523690773, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '501699', 'license': 'MIT', 'n_tokens_mistral': 688, 'n_tokens_neox': 622, 'n_words': 165, 'path': 'figure-ground.ipynb', 'repo_name': 'gboeing/street-network-analysis', 'size': '1803'}