taxicab

Accurate routing for OpenStreetMap/OSMnx

https://github.com/nathanrooy/taxicab

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
    1 of 2 committers (50.0%) from academic institutions
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (14.3%) to scientific vocabulary

Keywords

gis networkx openstreetmap osm osmnx python routing shortest-path spatial-analysis
Last synced: 6 months ago · JSON representation

Repository

Accurate routing for OpenStreetMap/OSMnx

Basic Info
  • Host: GitHub
  • Owner: nathanrooy
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 462 KB
Statistics
  • Stars: 49
  • Watchers: 5
  • Forks: 7
  • Open Issues: 4
  • Releases: 4
Topics
gis networkx openstreetmap osm osmnx python routing shortest-path spatial-analysis
Created almost 5 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

GitHub Actions Workflow Status GitHub license codecov PyPI pyversions PyPi Version

Taxicab

When routing between two points of longitude and latitude, the built in routing functionality in OSMnx will find the nearest network nodes and route between those. This assumption is fine, and works for many applications but when you need routing with a little more accuracy you'll want to consider using Taxicab. Below are a few examples which highlight Taxicab use cases:

When the nearest nodes are not that close:

When routing along a single edge:

When routing along short routes:

When the nearest nodes are the same:

Installation

The easiest way to use Taxicab is probably via a PyPi install: sh pip install taxicab You can also install directly from this repo: sh pip install git+https://github.com/nathanrooy/taxicab

Example usage

Taxicab is designed to be used as a drop-in replacement for the standard routing functionality found on OSMnx. So, like usual, download a portion of the OpenStreetMap graph:

python from osmnx import graph_from_bbox xmin, xmax = -84.323, -84.305 ymin, ymax = 39.084, 39.092 G = graph_from_bbox([xmin, ymin, xmax, ymax], network_type='drive', simplify=True)

Now, specify your origin and destination: python orig = (39.0871, -84.3105) dest = (39.0880, -84.3200)

Compute the route via the following: python import taxicab as tc route = tc.distance.shortest_path(G, orig, dest)

Which can then be plotted: python tc.plot.plot_graph_route(G, route)

The returned route is a named tuple comprised of four elements: - Route length in meters (or whatever your graph units are). ```python

route.length 669.0529395595279 ```

  • List of node IDs representing the bulk of the route (this is identical to OSMnx). ```python

    route.nodes [197546973, 2090608743, 197656382, 197633479] ```

  • And two partial edges represented by shapely.geometry.linestring.LineString objects. If populated, these represent the first and last segments of the route that extend from the first or last node to some point along that edge. ```python

    route.origedge, route.destedge (, ) ```

User reference

python taxicab.distance.shortest_route(G, orig, dest) Parameters: - G : (networkx.MultiDiGraph) - input graph - orig : (tuple) - a (lat, lng) or (y, x) point - dest : (tuple) - a (lat, lng) or (y, x) point

Returns: (named tuple) - route.length : float - distance in meters of computed route. - route.nodes : path - list of node IDs constituting the shortest path (this is identical to routes found in OSMnx). - route.origedge : shapely.geometry.linestring.LineString - a partial edge representing the first non-complete edge in the route. - route.destedge : shapely.geometry.linestring.LineString - a partial edge representing the last non-complete edge in the route. - Note that if a route is successfully computed the distance will always be returned. However, depending on the length of the route and the underlying network, route.nodes, route.origedge, or route.destedge, may be null.

python taxicab.plot.plot_graph_route() Used exactly the same way as osmnx.plot.plot_graph_route except that it uses the route (named tuple) produced by Taxicab instead. See OSMnx function reference [here]

Owner

  • Name: Nathan Rooy
  • Login: nathanrooy
  • Kind: user
  • Location: Manhattan
  • Company: @Shutterstock

Aerospace engineer. I used to design race cars (CFD), now I clf.fit()

GitHub Events

Total
  • Create event: 4
  • Issues event: 4
  • Release event: 1
  • Watch event: 5
  • Delete event: 3
  • Issue comment event: 3
  • Push event: 41
  • Pull request event: 6
Last Year
  • Create event: 4
  • Issues event: 4
  • Release event: 1
  • Watch event: 5
  • Delete event: 3
  • Issue comment event: 3
  • Push event: 41
  • Pull request event: 6

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 52
  • Total Committers: 2
  • Avg Commits per committer: 26.0
  • Development Distribution Score (DDS): 0.212
Top Committers
Name Email Commits
Nathan Rooy n****y@g****m 41
Nathan Rooy r****a@m****u 11
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 8
  • Average time to close issues: almost 2 years
  • Average time to close pull requests: about 3 hours
  • Total issue authors: 7
  • Total pull request authors: 2
  • Average comments per issue: 0.82
  • Average comments per pull request: 0.13
  • Merged pull requests: 6
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 4
  • Average time to close issues: N/A
  • Average time to close pull requests: about 5 hours
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.25
  • Merged pull requests: 3
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • nathanrooy (3)
  • JobdeVogel (2)
  • YannickAaron (2)
  • 1993Hegde (1)
  • rubchacon (1)
  • ziyadbaron (1)
  • leeke2 (1)
Pull Request Authors
  • nathanrooy (11)
  • YannickAaron (1)
Top Labels
Issue Labels
enhancement (3)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 165 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
pypi.org: taxicab

Accurate routing for Open Street Maps and OSMnx

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 165 Last month
Rankings
Dependent packages count: 10.0%
Stargazers count: 11.0%
Forks count: 12.5%
Downloads: 13.4%
Average: 13.7%
Dependent repos count: 21.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/ci.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v5 composite
  • codecov/codecov-action v5 composite
.github/workflows/python-publish.yml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
  • Shapely >=1.7
  • matplotlib >=3.3.0
  • networkx >=2.5
  • numpy >=1.19
  • osmnx >=2.0.1