title: Which query reproduces city street network orientation plots using OSMnx?
body: <p>We are interested in reproducing the street network orientation plots from <a href="https://geoffboeing.com/2019/09/urban-street-network-orientation/" rel="nofollow noreferrer">this blog post</a> using OSMnx. However, using the modified <a href="https://github.com/gboeing/osmnx-examples/blob/main/notebooks/17-street-network-orientations.ipynb" rel="nofollow noreferrer">example notebook code</a></p>
  <pre><code>import matplotlib.pyplot as plt
  import numpy as np
  import osmnx as ox
  
  ox.config(log_console=True)
  weight_by_length = False
  
  ox.__version__
  
  # define the study sites as label : query
  places = {
      &quot;Berlin&quot;: &quot;Berlin, Germany&quot;,
      &quot;Munich&quot;: &quot;München, Germany&quot;,
      &quot;Minneapolis&quot;: &quot;Minneapolis, MN, USA&quot;,
  }
  
  # verify OSMnx geocodes each query to what you expect (i.e., a [multi]polygon geometry)
  gdf = ox.geocode_to_gdf(list(places.values()))
  gdf
  
  # create figure and axes
  n = len(places)
  ncols = int(np.ceil(np.sqrt(n)))
  nrows = int(np.ceil(n / ncols))
  figsize = (ncols * 5, nrows * 5)
  fig, axes = plt.subplots(nrows, ncols, figsize=figsize, subplot_kw={&quot;projection&quot;: &quot;polar&quot;})
  
  # plot each city's polar histogram
  for ax, place in zip(axes.flat, sorted(places.keys())):
      print(ox.utils.ts(), place)
  
      # get undirected graphs with edge bearing attributes
      G = ox.graph_from_place(place, network_type=&quot;drive&quot;)
      Gu = ox.add_edge_bearings(ox.get_undirected(G))
      fig, ax = ox.bearing.plot_orientation(Gu, ax=ax, title=place, area=True)
  </code></pre>
  <p>our results differ from those in the blog post:
  <a href="https://i.stack.imgur.com/RtEr2.png" rel="nofollow noreferrer">our Berlin</a> <a href="https://i.stack.imgur.com/Hv6Mj.png" rel="nofollow noreferrer">Geoff's Berlin</a> <a href="https://i.stack.imgur.com/38sNa.png" rel="nofollow noreferrer">our Minneapolis</a> <a href="https://i.stack.imgur.com/PAzEB.png" rel="nofollow noreferrer">Geoff's Minneapolis</a> (sorry, I'm not allowed to embed images)</p>
  <p>As Geoff mentions in his blog post, that &quot;cities proper (municipalities), not wider metro areas or urban agglomerations&quot; are used, we speculated that choosing the appropriate admin-level in the query might help. However using, e.g.,</p>
  <pre><code>gdf = ox.geometries.geometries_from_place('Minneapolis, MN, USA', {'boundary':'administrative','admin_level':'8'})
  </code></pre>
  <p>returns a multitude of polygons, where it is unclear to us how to select from them. The unary union</p>
  <pre><code>gdf_unified = gdf[gdf.admin_level=='8'].unary_union
  </code></pre>
  <p>does not seem to do the trick:
  <a href="https://i.stack.imgur.com/FNDU0.png" rel="nofollow noreferrer">Minneapolis, unary union, admin-level 8</a></p>
  <p>Can anyone advise which query to use to successfully reproduce the plots?</p>