.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/network_manipulation/plot_create_from_osm.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__auto_examples_network_manipulation_plot_create_from_osm.py: .. _plot_from_osm: Create project from OpenStreetMap ================================= In this example, we show how to create an empty project and populate it with a network from OpenStreetMap. This time we will use GeoPandas to visualize the network. .. GENERATED FROM PYTHON SOURCE LINES 13-16 .. admonition:: References * :ref:`importing_from_osm` .. GENERATED FROM PYTHON SOURCE LINES 18-22 .. seealso:: Several functions, methods, classes and modules are used in this example: * :func:`aequilibrae.project.Network.create_from_osm` .. GENERATED FROM PYTHON SOURCE LINES 24-32 .. code-block:: Python # Imports from uuid import uuid4 from tempfile import gettempdir from os.path import join from aequilibrae import Project .. GENERATED FROM PYTHON SOURCE LINES 34-41 .. code-block:: Python # We create an empty project on an arbitrary folder fldr = join(gettempdir(), uuid4().hex) project = Project() project.new(fldr) .. rst-class:: sphx-glr-script-out .. code-block:: none No pre-existing parameter file exists for this project. Will use default No pre-existing parameter file exists for this project. Will use default .. GENERATED FROM PYTHON SOURCE LINES 42-44 Now we can download the network from any place in the world (as long as you have memory for all the download and data wrangling that will be done). .. GENERATED FROM PYTHON SOURCE LINES 46-48 We can create from a bounding box or a named place. For the sake of this example, we will choose the small nation of Nauru. .. GENERATED FROM PYTHON SOURCE LINES 48-50 .. code-block:: Python project.network.create_from_osm(place_name="Nauru") .. rst-class:: sphx-glr-script-out .. code-block:: none Total polygons: 1 : 0%| | 0/1 [00:00
Make this Notebook Trusted to load map: File -> Trust Notebook


.. GENERATED FROM PYTHON SOURCE LINES 65-66 .. code-block:: Python project.close() .. rst-class:: sphx-glr-script-out .. code-block:: none This project at /tmp/a77e5bc96b254fbbbab36e24c0c0b64b is already closed .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 11.545 seconds) .. _sphx_glr_download__auto_examples_network_manipulation_plot_create_from_osm.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_create_from_osm.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_create_from_osm.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_create_from_osm.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_