.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_auto_examples/creating_models/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_creating_models_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 12-15 .. admonition:: References * :ref:`importing_from_osm` .. GENERATED FROM PYTHON SOURCE LINES 17-21 .. seealso:: Several functions, methods, classes and modules are used in this example: * :func:`aequilibrae.project.Network.create_from_osm` .. GENERATED FROM PYTHON SOURCE LINES 23-31 .. code-block:: Python # Imports from uuid import uuid4 from tempfile import gettempdir from os.path import join from aequilibrae import Project import folium .. GENERATED FROM PYTHON SOURCE LINES 33-40 .. 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 41-43 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 45-47 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 47-49 .. code-block:: Python project.network.create_from_osm(place_name="Nauru") .. rst-class:: sphx-glr-script-out .. code-block:: none Total polygons: 2 : 0%| | 0/2 [00:00
Make this Notebook Trusted to load map: File -> Trust Notebook


.. GENERATED FROM PYTHON SOURCE LINES 66-67 .. code-block:: Python project.close() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 16.382 seconds) .. _sphx_glr_download__auto_examples_creating_models_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 `_