title: Load a Graph from .osm file using Osmnx/Python
body: <p>I want to load a graph from XML, i.e. .osm file, using <strong>Osmnx</strong> Python library.<br>
  The .osm file contains roads not connected each other, for example only highway=primary and highway=primary_link of a country's region.</p>
  <p>I use the parameter <em>retain_all</em> to avoid discarding all the roads, since</p>
  <blockquote>
  <p>retain_all: if True, return the entire graph even if it is not connected. otherwise, retain only the largest weakly connected component.</p>
  </blockquote>
  <p>I use this instruction:</p>
  <pre><code>graph = ox.graph_from_xml('temp.osm', retain_all=True)
  </code></pre>
  <p>But I get the following error</p>
  <pre><code>AttributeError: 'float' object has no attribute 'deg2rad'
  
  The above exception was the direct cause of the following exception:
  
  Traceback (most recent call last):
  File &quot;D:\code.py&quot;, line 37, in &lt;module&gt;
  graph = ox.graph_from_xml('temp.osm', retain_all=True)
  File &quot;D:\Python\lib\site-packages\osmnx\graph.py&quot;, line 518, in graph_from_xml
  G = _create_graph(response_jsons, bidirectional=bidirectional, retain_all=retain_all)
  File &quot;D:\Python\lib\site-packages\osmnx\graph.py&quot;, line 587, in _create_graph
  G = distance.add_edge_lengths(G)
  File &quot;D:\Python\lib\site-packages\osmnx\distance.py&quot;, line 154, in add_edge_lengths
  dists = great_circle_vec(c[:, 0], c[:, 1], c[:, 2], c[:, 3]).round(precision)
  File &quot;D:\Python\lib\site-packages\osmnx\distance.py&quot;, line 60, in great_circle_vec
  y1 = np.deg2rad(lat1)
  
  TypeError: loop of ufunc does not support argument 0 of type float which has no callable deg2rad method
  </code></pre>
  <p>If I remove <em>retain_all</em> parameter, of course, the error does not occurr but the graph will contain only one primary road.<br>
  How can I keep all the roads even if not connected in the map?</p>