Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates for v1.9.3 #87

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.5.0"
rev: "v4.6.0"
hooks:
- id: check-added-large-files
args: [--maxkb=50]
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 20162024 Geoff Boeing https://geoffboeing.com/
Copyright (c) 2016-2024 Geoff Boeing https://geoffboeing.com/

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
# OSMnx Examples Gallery

[![GitHub tag](https://img.shields.io/github/v/tag/gboeing/osmnx-examples?label=Uses+OSMnx)](https://github.com/gboeing/osmnx)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/gboeing/osmnx-examples/main?urlpath=lab)
[![Build Status](https://github.com/gboeing/osmnx-examples/workflows/tests/badge.svg?branch=main)](https://github.com/gboeing/osmnx-examples/actions?query=workflow%3Atests)

# OSMnx Examples Gallery

OSMnx 2.0 is coming soon: read the [migration guide](https://github.com/gboeing/osmnx/issues/1123).
OSMnx 2.0 is in beta: read the [migration guide](https://github.com/gboeing/osmnx/issues/1123).

[OSMnx](https://github.com/gboeing/osmnx) is a Python package to download, model, analyze, and visualize street networks and other geospatial features from [OpenStreetMap](https://www.openstreetmap.org/copyright/). You can download and model walking, driving, or biking networks with a single line of code then easily analyze and visualize them. You can just as easily work with urban amenities/points of interest, building footprints, transit stops, elevation data, street orientations, speed/travel time, and routing.
[OSMnx](https://github.com/gboeing/osmnx) is a Python package to easily download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap. You can download and model walking, driving, or biking networks with a single line of code then analyze and visualize them. You can just as easily work with urban amenities/points of interest, building footprints, transit stops, elevation data, street orientations, speed/travel time, and routing.

This gallery contains step-by-step usage tutorials and feature demonstrations as Jupyter notebooks. You can run these notebooks interactively online with [Binder](https://mybinder.org/v2/gh/gboeing/osmnx-examples/main?urlpath=lab) or locally with the official OSMnx [Docker image](https://hub.docker.com/r/gboeing/osmnx). All of the examples are in this repo's [notebooks](notebooks) folder. Note that this repo's main branch generally tracks the functionality of the OSMnx repo's main branch. For examples corresponding to previously released versions of OSMnx, use this repo's tags to browse by release.

### More info:

- [Overview of OSMnx](https://geoffboeing.com/2016/11/osmnx-python-street-networks/)
- [OSMnx repo](https://github.com/gboeing/osmnx)
- [Documentation](https://osmnx.readthedocs.io/)
- [Journal article and citation info](https://geoffboeing.com/publications/osmnx-complex-street-networks/)
- [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)
- [Code repository](https://github.com/gboeing/osmnx)
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ channels:
- conda-forge
dependencies:
- jupyterlab
- osmnx=1.9.2
- osmnx=1.9.3
- pillow
- pre-commit
- python=3.11.*
Expand Down
13 changes: 6 additions & 7 deletions notebooks/00-osmnx-features-demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
"Get street networks and other spatial data anywhere in the world from OpenStreetMap then analyze and visualize them.\n",
"Model street networks and other geospatial features anywhere in the world from OpenStreetMap then analyze and visualize them.\n",
"\n",
"More info:\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [Documentation and install instructions](https://osmnx.readthedocs.io)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Journal article and citation info](http://geoffboeing.com/publications/osmnx-complex-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)\n",
" \n",
"This notebook provides a quick tour of some of OSMnx's key features including how to:\n",
"\n",
Expand Down Expand Up @@ -455,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/01-overview-osmnx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)\n",
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)\n",
" \n",
"Once you've perused the [features demo notebook](00-osmnx-features-demo.ipynb), this notebook demonstrates more details on querying for place boundaries and street networks, visualizing, and saving models to disk."
]
Expand Down Expand Up @@ -485,7 +484,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
15 changes: 7 additions & 8 deletions notebooks/02-routing-speed-time.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -227,8 +226,8 @@
"source": [
"# compare the two routes\n",
"route1_length = int(sum(ox.routing.route_to_gdf(G, route1, weight=\"length\")[\"length\"]))\n",
"route2_length = int(sum(ox.routing.route_to_gdf(G, route2, weight=\"length\")[\"length\"]))\n",
"route1_time = int(sum(ox.routing.route_to_gdf(G, route1, weight=\"travel_time\")[\"travel_time\"]))\n",
"route2_length = int(sum(ox.routing.route_to_gdf(G, route2, weight=\"travel_time\")[\"length\"]))\n",
"route1_time = int(sum(ox.routing.route_to_gdf(G, route1, weight=\"length\")[\"travel_time\"]))\n",
"route2_time = int(sum(ox.routing.route_to_gdf(G, route2, weight=\"travel_time\")[\"travel_time\"]))\n",
"print(\"Route 1 is\", route1_length, \"meters and takes\", route1_time, \"seconds.\")\n",
"print(\"Route 2 is\", route2_length, \"meters and takes\", route2_time, \"seconds.\")"
Expand Down Expand Up @@ -395,7 +394,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/03-graph-place-queries.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)\n",
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)\n",
" \n",
"Once you've perused the features demo and overview notebooks, this notebook provides further demonstration of querying by place name with OSMnx."
]
Expand Down Expand Up @@ -343,7 +342,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/04-simplify-graph-consolidate-nodes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -234,7 +233,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/05-save-load-networks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)\n",
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)\n",
" \n",
"This notebook demonstrates how to save networks to disk as GeoPackages, GraphML files, and .osm formatted XML, and how to load an OSMnx-created network from a GraphML file."
]
Expand Down Expand Up @@ -183,7 +182,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/06-stats-indicators-centrality.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -193,7 +192,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/07-plot-graph-over-shape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"\n",
"This example uses Portland, Maine - a city with several islands within its municipal boundaries. Thus, we set `retain_all=True` when getting the network so that we keep all the graph components, not just the largest connected component.\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -115,7 +114,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/08-custom-filters-infrastructure.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"\n",
"Use OSMnx to download and visualize a power line network and a subway system.\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -138,7 +137,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/09-example-figure-ground.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"\n",
"Use OSMnx to download square-mile city street networks and visualize them as figure-ground diagrams. Discussed in this [blog post](http://geoffboeing.com/2017/01/square-mile-street-network-visualization/).\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -384,7 +383,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/10-building-footprints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"\n",
"Use OSMnx to download OpenStreetMap building footprints and visualize them as figure-ground diagrams.\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -277,7 +276,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/11-interactive-web-mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
"\n",
"Use OSMnx to download a street network, calculate a route between two points, and create a Leaflet web map using GeoPandas [explore](https://geopandas.org/en/stable/docs/reference/api/geopandas.GeoDataFrame.explore.html). See the GeoPandas documentation for more style details.\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)"
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)"
]
},
{
Expand Down Expand Up @@ -287,7 +286,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
11 changes: 5 additions & 6 deletions notebooks/12-node-elevations-edge-grades.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"\n",
"Author: [Geoff Boeing](https://geoffboeing.com/)\n",
"\n",
" - [Overview of OSMnx](http://geoffboeing.com/2016/11/osmnx-python-street-networks/)\n",
" - [GitHub repo](https://github.com/gboeing/osmnx)\n",
" - [Examples, demos, tutorials](https://github.com/gboeing/osmnx-examples)\n",
" - [Documentation](https://osmnx.readthedocs.io/en/stable/)\n",
" - [Journal article/citation](http://geoffboeing.com/publications/osmnx-complex-street-networks/)\n",
" - [Documentation](https://osmnx.readthedocs.io/)\n",
" - [Journal article and citation info](https://geoffboeing.com/publications/osmnx-paper/)\n",
" - [Code repository](https://github.com/gboeing/osmnx)\n",
" - [Examples gallery](https://github.com/gboeing/osmnx-examples)\n",
"\n",
"OSMnx allows you to automatically add elevation attributes to your graph's nodes with the `elevation` module, using either local raster files or the Google Maps Elevation API as the elevation data source. If you use the Google API, you will need an API key. Once your nodes have elevation values, OSMnx can automatically calculate your edges' grades (inclines)."
]
Expand Down Expand Up @@ -359,7 +358,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.8"
"version": "3.11.9"
}
},
"nbformat": 4,
Expand Down
Loading