Skip to content

Commit

Permalink
Merge pull request #1038 from gboeing/lint
Browse files Browse the repository at this point in the history
remove unnecessary unicode characters
  • Loading branch information
gboeing committed Jul 20, 2023
2 parents 7f49fe6 + 85cb1fd commit 507cee3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
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) 20162023 Geoff Boeing https://geoffboeing.com/
Copyright (c) 2016-2023 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

If you use OSMnx in your work, please cite the journal article:

Boeing, G. 2017. "[OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks](https://geoffboeing.com/publications/osmnx-complex-street-networks/)." _Computers, Environment and Urban Systems_ 65, 126139.
Boeing, G. 2017. "[OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks](https://geoffboeing.com/publications/osmnx-complex-street-networks/)." _Computers, Environment and Urban Systems_ 65, 126-139.

## Getting Started

Expand Down
10 changes: 5 additions & 5 deletions docs/further-reading.rst
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
Further Reading
===============

Boeing, G. 2017. `OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks`_. *Computers, Environment and Urban Systems* 65, 126139.
Boeing, G. 2017. `OSMnx: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks`_. *Computers, Environment and Urban Systems* 65, 126-139.

This is the original paper introducing OSMnx and is the official citation for the project.

.. _OSMnx\: New Methods for Acquiring, Constructing, Analyzing, and Visualizing Complex Street Networks: https://geoffboeing.com/publications/osmnx-complex-street-networks/

----

Boeing, G. 2020. `The Right Tools for the Job: The Case for Spatial Science Tool-Building`_. *Transactions in GIS* 24 (5), 12991314.
Boeing, G. 2020. `The Right Tools for the Job: The Case for Spatial Science Tool-Building`_. *Transactions in GIS* 24 (5), 1299-1314.

This paper was presented as the 8th annual Transactions in GIS plenary address at the American Association of Geographers annual meeting in Washington, DC. It describes the development of OSMnx and reviews its use in scientific research over the previous few years.

.. _The Right Tools for the Job\: The Case for Spatial Science Tool-Building: https://geoffboeing.com/publications/right-tools-for-job/

----

Boeing, G. 2020. `Planarity and Street Network Representation in Urban Form Analysis`_. *Environment and Planning B: Urban Analytics and City Science* 47 (5), 855869.
Boeing, G. 2020. `Planarity and Street Network Representation in Urban Form Analysis`_. *Environment and Planning B: Urban Analytics and City Science* 47 (5), 855-869.

This paper discusses the importance of using nonplanar graphs when modeling urban street networks, which was one of the original motivations for developing OSMnx.

.. _Planarity and Street Network Representation in Urban Form Analysis: https://geoffboeing.com/publications/planarity-street-network-representation/

----

Boeing, G. 2021. `Street Network Models and Indicators for Every Urban Area in the World`_. *Geographical Analysis* 54 (3), 519535.
Boeing, G. 2021. `Street Network Models and Indicators for Every Urban Area in the World`_. *Geographical Analysis* 54 (3), 519-535.

This study uses OSMnx to model and analyze the street networks of every urban area in the world: over 160 million OpenStreetMap street network nodes and over 320 million edges across 8,914 urban areas in 178 countries.

.. _Street Network Models and Indicators for Every Urban Area in the World: https://geoffboeing.com/publications/street-network-models-indicators-world/

----

Boeing, G., C. Higgs, S. Liu, B. Giles-Corti, J.F. Sallis, E. Cerin, et al. 2022. `Using Open Data and Open-Source Software to Develop Spatial Indicators of Urban Design and Transport Features for Achieving Healthy and Sustainable Cities`_. *The Lancet Global Health* 10 (6), 907918.
Boeing, G., C. Higgs, S. Liu, B. Giles-Corti, J.F. Sallis, E. Cerin, et al. 2022. `Using Open Data and Open-Source Software to Develop Spatial Indicators of Urban Design and Transport Features for Achieving Healthy and Sustainable Cities`_. *The Lancet Global Health* 10 (6), 907-918.

This study by an international consortium of public health and urban planning researchers uses OSMnx to develop and demonstrate a computational framework to benchmark and monitor urban accessibility around the world.

Expand Down
18 changes: 10 additions & 8 deletions osmnx/bearing.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ def orientation_entropy(Gu, num_bins=36, min_length=0, weight=None):
undirected, unprojected graph with `bearing` attributes on each edge
num_bins : int
number of bins; for example, if `num_bins=36` is provided, then each
bin will represent 10° around the compass
bin will represent 10 degrees around the compass
min_length : float
ignore edges with `length` attributes less than `min_length`; useful
to ignore the noise of many very short edges
Expand All @@ -148,8 +148,8 @@ def _extract_edge_bearings(Gu, min_length=0, weight=None):
"""
Extract undirected graph's bidirectional edge bearings.
For example, if an edge has a bearing of 90° then we will record bearings
of both 90° and 270° for this edge.
For example, if an edge has a bearing of 90 degrees then we will record
bearings of both 90 degrees and 270 degrees for this edge.
Parameters
----------
Expand Down Expand Up @@ -194,10 +194,11 @@ def _bearings_distribution(Gu, num_bins, min_length=0, weight=None):
"""
Compute distribution of bearings across evenly spaced bins.
Prevents bin-edge effects around common values like 0° and 90° by
initially creating twice as many bins as desired, then merging them in
pairs. For example, if `num_bins=36` is provided, then each bin will
represent 10° around the compass, with the first bin representing 355°-5°.
Prevents bin-edge effects around common values like 0 degrees and 90
degrees by initially creating twice as many bins as desired, then merging
them in pairs. For example, if `num_bins=36` is provided, then each bin
will represent 10 degrees around the compass, with the first bin
representing 355 degrees to 5 degrees.
Parameters
----------
Expand Down Expand Up @@ -225,7 +226,8 @@ def _bearings_distribution(Gu, num_bins, min_length=0, weight=None):
bearings = _extract_edge_bearings(Gu, min_length, weight)
count, bin_edges = np.histogram(bearings, bins=bins)

# move last bin to front, so eg 0.01° and 359.99° will be binned together
# move last bin to front, so eg 0.01 degrees and 359.99 degrees will be
# binned together
count = np.roll(count, 1)
bin_counts = count[::2] + count[1::2]

Expand Down
4 changes: 2 additions & 2 deletions osmnx/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def plot_orientation(
undirected, unprojected graph with `bearing` attributes on each edge
num_bins : int
number of bins; for example, if `num_bins=36` is provided, then each
bin will represent 10° around the compass
bin will represent 10 degrees around the compass
min_length : float
ignore edges with `length` attributes less than `min_length`
weight : string
Expand Down Expand Up @@ -742,7 +742,7 @@ def plot_orientation(
bin_counts, bin_edges = bearing._bearings_distribution(Gu, num_bins, min_length, weight)

# positions: where to center each bar. ignore the last bin edge, because
# it's the same as the first (i.e., 0° = 360°)
# it's the same as the first (i.e., 0 degrees = 360 degrees)
positions = np.radians(bin_edges[:-1])

# width: make bars fill the circumference without gaps or overlaps
Expand Down

0 comments on commit 507cee3

Please sign in to comment.