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

Notebook suggestions #2

Merged
merged 1 commit into from
Sep 14, 2022
Merged
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
34 changes: 14 additions & 20 deletions docs/user_guide/preprocessing/roundabout_simplification.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Road Network Simplification of Roundabouts\n",
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
"The following code exemplifies a simple process for road network simplification of roundabouts using [momepy.roundabout_simplification()](http://docs.momepy.org/en/latest/generated/momepy.roundabout_simplification.html?highlight=momepy.roundabout_simplification).\n",
"# Simplification of roundabouts\n",
"\n",
"For this example we will fetch some data from [OpenStreetMap](https://www.openstreetmap.org/#map=6/40.007/-2.488) (using `osmnx`). However, most other data sources should also work as long as their topology has been corrected and can be stored in a GeoDataFrame.\n",
"The code below uses only geometry operations to perform the simplification."
"Analysis using street network can be sensitive to the actual geometry representation. For example, one roundabout can be typically represented as 4 or more nodes, while it is topologically only one. Hence measurements attempting to capture topology (e.g. centrality) or node density will be skewed.\n",
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
"\n",
"The following code exemplifies a simple process for road network simplification of roundabouts using `momepy.roundabout_simplification()`.\n",
"\n",
"For this example we will fetch some data from [OpenStreetMap](https://www.openstreetmap.org/#map=6/40.007/-2.488) (using `osmnx`). However, most other data sources should also work as long as their topology has been corrected and can be stored in a GeoDataFrame."
]
},
{
Expand Down Expand Up @@ -247,8 +249,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Playing with the different parameters\n",
"### _default_"
"## Default behavior"
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
Expand All @@ -269,13 +270,6 @@
"edges_output = mm.roundabout_simplification(edges)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"*_ShapelyDeprecationWarning should be resolved in further versions_."
]
},
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
{
"cell_type": "code",
"execution_count": 5,
Expand Down Expand Up @@ -305,7 +299,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Using the output column _```simplification_group```_ we can count the number of roundabouts that were simplified"
"Using the output column `'simplification_group'` we can count the number of roundabouts that were simplified:"
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
Expand Down Expand Up @@ -379,7 +373,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"It's worth investigating why some roundabouts are still missing from simplification. Since the selection of roundabouts is based on the resulting polygons after polygonizing the road network let's use the [Circular Compactness](https://docs.momepy.org/en/stable/generated/momepy.CircularCompactness.html) parameter of the resulting polygons as the main selection attribute."
"It's worth investigating why some roundabouts are still missing from simplification. Since the selection of roundabouts is based on the resulting polygons after polygonizing the road network let's use the circular compactness (measurable as `momepy.CircularCompactness`) parameter of the resulting polygons as the main selection attribute."
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
]
},
{
Expand All @@ -401,7 +395,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"The _```circom_threshold```_ parameter (default = 0.7) establishes the limit at which roundabouts should be selected."
"The `circom_threshold` parameter (default = 0.7) establishes the limit at which roundabouts should be selected."
]
},
{
Expand Down Expand Up @@ -442,7 +436,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"Let's see the following two **false negatives**,"
"Let's see the following two **false negatives**:"
]
},
{
Expand Down Expand Up @@ -498,11 +492,11 @@
"source": [
"The above helps to exemplify two main reasons why some roundabouts are not being selected:\n",
"1. They are crossed by other roads; which breaks them into multiple polygons\n",
" - eg. `index`: ```[314, 312, 304]```\n",
" - eg. `index`: `[314, 312, 304]`\n",
"1. They don't meet the `circom_threshold`\n",
" - eg. `index`: ```[162]``` --> (0.676) \n",
" - eg. `index`: `[162]` --> (0.676) \n",
" \n",
"## Lowering _**circom_threshold**_ & **include_adjacent**_ = False\n",
"## Adapting parameters\n",
gregmaya marked this conversation as resolved.
Show resolved Hide resolved
"Finally, let's also explore what the outcome would look like if we lower the `circom_threshold` and `include_adjacent` is set to `False` "
]
},
Expand Down