
[](https://pypi.python.org/pypi/georouting)
[](https://anaconda.org/conda-forge/georouting)
[](https://colab.research.google.com/github/wybert/georouting/blob/main/docs/usage.ipynb)
[](https://github.com/psf/black)
<!-- [](https://gishub.org/geemap-binder) -->
<!-- [](https://studiolab.sagemaker.aws/import/github/giswqs/geemap/blob/master/examples/notebooks/00_geemap_key_features.ipynb) -->
<!-- [](https://anaconda.org/conda-forge/geemap) -->
<!-- [](https://pepy.tech/project/geemap) -->
[](https://wybert.github.io/georouting/)
[](https://github.com/wybert/georouting/actions?query=workflow%3Abuild)
[](https://youtube.com/@xiaokangfu3118)
[](https://twitter.com/fxk123)
[](https://opensource.org/licenses/MIT)
<!-- [](https://joss.theoj.org/papers/10.21105/joss.02305) -->
**Geo routing for Python users**, supporting most of the routing tools, including OSRM, Google Maps, Bing Maps, etc. with a unified API.
Warning!!! This project is under active development, wait for the release of version 1.0.0 if you want to use it in production. This package is inspired by [geopy](https://geopy.readthedocs.io/en/stable/). Please help to improve this package by submitting issues and pull requests.
- Free software: MIT license
- Documentation: [https://wybert.github.io/georouting](https://wybert.github.io/georouting)
## Features
- Support most of the routing services, including Google Maps, Bing Maps, OSRM, etc.
- Provide a unified API for routing services
- Support calculating the travel distance matrix between multiple origins and destinations
- Support calculating the travel distance according to OD pairs.
- Easy to visualize the routing results
- Return the travel distance matrix in a Pandas `Dataframe` you like
- Return the routing results in a Geopandas `GeoDataFrame`
- Easy to extend to support more routing services
## Installation
### Using pip
To install georouting, run this command in your terminal:
```bash
pip install georouting
```
or install from GitHub source
```
pip install git+https://github.com/wybert/georouting.git
```
If you don't have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process.
### Using conda
This is not yet available on conda-forge,
```
conda install -c conda-forge georouting
```
or use mamba
```
mamba install -c conda-forge georouting
```
## Install from sources
The sources for georouting can be downloaded from the Github repo.
You can clone the public repository:
```
git clone git://github.com/wybert/georouting
```
Then install it with:
```
python setup.py install
```
## Usage
```python
# how to get routing distance matrix from OSRMRouter
import pandas as pd
data = pd.read_csv("https://raw.githubusercontent.com/wybert/georouting/main/docs/data/sample_3.csv",index_col=0)
one_od_pair = data.iloc[2]
data.head()
from georouting.routers import GoogleRouter
# create a router object with the google_key
router = GoogleRouter(google_key,mode="driving")
# get the route between the origin and destination, this will return a Route object
# this will call the Google Maps API
route = router.get_route([one_od_pair["ZIP_lat"],one_od_pair["ZIP_lon"]],
[one_od_pair["AHA_ID_lat"],one_od_pair["AHA_ID_lon"]])
# Now you can get the distance and duration of the route in meters and seconds
print("Distance: {} meters".format(route.get_distance()))
print("Duration: {} seconds".format(route.get_duration()))
df= route.get_route_geopandas()
df.head()
df.explore(column="speed (m/s)",style_kwds={"weight":11,"opacity":0.8})
```
## TODO
- [x] Google Maps
- [x] Bing Maps
- [x] OSRM Routing
- [x] add more documentation for google router
- [x] add more documentation for bing router
- [x] add more documentation for osrm router
- [x] built and host documentation
- [x] Fix the update in Pypi
- [x] add get_route_distance_batch API
- [x] add visualization for the route, better with o and d markers
- [x] Limit the number of origins and destinations in the distance matrix
- [x] avoid repeat documentation
- [x] add ESRI router
- [x] Add test
- [x] Add more examples
- [x] Add how to contribute
- [x] change the show case use OSRM
- [x] add OSMnx router
- [ ] static plot for the route
- [x] add one API for all routers
- [ ] Add how to cite
## Credits
This package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [giswqs/pypackage](https://github.com/giswqs/pypackage) project template.
Raw data
{
"_id": null,
"home_page": "https://github.com/wybert/georouting",
"name": "georouting",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": "",
"keywords": "georouting",
"author": "Xiaokang Fu",
"author_email": "fxk123@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d6/68/befd0e12eba322291c6bfeb530f641f945d51334cc608286d8eb610571cc/georouting-0.0.8.tar.gz",
"platform": null,
"description": "\n\n\n\n\n\n[](https://pypi.python.org/pypi/georouting)\n[](https://anaconda.org/conda-forge/georouting)\n[](https://colab.research.google.com/github/wybert/georouting/blob/main/docs/usage.ipynb)\n[](https://github.com/psf/black)\n<!-- [](https://gishub.org/geemap-binder) -->\n<!-- [](https://studiolab.sagemaker.aws/import/github/giswqs/geemap/blob/master/examples/notebooks/00_geemap_key_features.ipynb) -->\n<!-- [](https://anaconda.org/conda-forge/geemap) -->\n<!-- [](https://pepy.tech/project/geemap) -->\n[](https://wybert.github.io/georouting/)\n[](https://github.com/wybert/georouting/actions?query=workflow%3Abuild)\n[](https://youtube.com/@xiaokangfu3118)\n[](https://twitter.com/fxk123)\n[](https://opensource.org/licenses/MIT)\n<!-- [](https://joss.theoj.org/papers/10.21105/joss.02305) -->\n\n\n**Geo routing for Python users**, supporting most of the routing tools, including OSRM, Google Maps, Bing Maps, etc. with a unified API. \n\nWarning!!! This project is under active development, wait for the release of version 1.0.0 if you want to use it in production. This package is inspired by [geopy](https://geopy.readthedocs.io/en/stable/). Please help to improve this package by submitting issues and pull requests.\n\n\n- Free software: MIT license\n- Documentation: [https://wybert.github.io/georouting](https://wybert.github.io/georouting)\n \n\n## Features\n\n- Support most of the routing services, including Google Maps, Bing Maps, OSRM, etc.\n- Provide a unified API for routing services\n- Support calculating the travel distance matrix between multiple origins and destinations\n- Support calculating the travel distance according to OD pairs.\n- Easy to visualize the routing results\n- Return the travel distance matrix in a Pandas `Dataframe` you like\n- Return the routing results in a Geopandas `GeoDataFrame`\n- Easy to extend to support more routing services\n\n\n## Installation\n\n### Using pip\n\n\nTo install georouting, run this command in your terminal:\n\n```bash\npip install georouting\n```\n\nor install from GitHub source\n\n```\npip install git+https://github.com/wybert/georouting.git\n```\n\n\nIf you don't have [pip](https://pip.pypa.io) installed, this [Python installation guide](http://docs.python-guide.org/en/latest/starting/installation/) can guide you through the process.\n\n### Using conda\n\nThis is not yet available on conda-forge,\n\n```\nconda install -c conda-forge georouting\n```\n\nor use mamba\n\n```\nmamba install -c conda-forge georouting\n```\n\n\n## Install from sources\n\nThe sources for georouting can be downloaded from the Github repo.\n\nYou can clone the public repository:\n\n```\ngit clone git://github.com/wybert/georouting\n```\n\nThen install it with:\n\n```\npython setup.py install\n```\n\n\n\n## Usage\n\n```python\n\n# how to get routing distance matrix from OSRMRouter\nimport pandas as pd\ndata = pd.read_csv(\"https://raw.githubusercontent.com/wybert/georouting/main/docs/data/sample_3.csv\",index_col=0)\none_od_pair = data.iloc[2]\ndata.head()\n\nfrom georouting.routers import GoogleRouter\n# create a router object with the google_key\nrouter = GoogleRouter(google_key,mode=\"driving\")\n# get the route between the origin and destination, this will return a Route object\n# this will call the Google Maps API\nroute = router.get_route([one_od_pair[\"ZIP_lat\"],one_od_pair[\"ZIP_lon\"]],\n [one_od_pair[\"AHA_ID_lat\"],one_od_pair[\"AHA_ID_lon\"]])\n# Now you can get the distance and duration of the route in meters and seconds\nprint(\"Distance: {} meters\".format(route.get_distance()))\nprint(\"Duration: {} seconds\".format(route.get_duration()))\n\ndf= route.get_route_geopandas()\ndf.head()\n\ndf.explore(column=\"speed (m/s)\",style_kwds={\"weight\":11,\"opacity\":0.8})\n\n```\n\n\n## TODO\n- [x] Google Maps\n- [x] Bing Maps\n- [x] OSRM Routing\n- [x] add more documentation for google router\n- [x] add more documentation for bing router\n- [x] add more documentation for osrm router\n- [x] built and host documentation\n- [x] Fix the update in Pypi\n- [x] add get_route_distance_batch API\n- [x] add visualization for the route, better with o and d markers\n- [x] Limit the number of origins and destinations in the distance matrix\n- [x] avoid repeat documentation\n- [x] add ESRI router\n- [x] Add test \n- [x] Add more examples\n- [x] Add how to contribute\n- [x] change the show case use OSRM\n- [x] add OSMnx router\n- [ ] static plot for the route\n- [x] add one API for all routers\n- [ ] Add how to cite\n\n\n## Credits\n\nThis package was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [giswqs/pypackage](https://github.com/giswqs/pypackage) project template.\n",
"bugtrack_url": null,
"license": "MIT license",
"summary": "Geo routing for Python users",
"version": "0.0.8",
"split_keywords": [
"georouting"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9badb1cf36245cfca3b4b4d2e01bee739fcf93adf3e174b21c140b328b7ae63b",
"md5": "2e09218bc538826690da78580ab54dd1",
"sha256": "d0abf4122bfe61dc71a7166b1f2ba1513c9dd7e824278a355e21caf1bc4e2c05"
},
"downloads": -1,
"filename": "georouting-0.0.8-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "2e09218bc538826690da78580ab54dd1",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": ">=3.7",
"size": 25454,
"upload_time": "2023-02-11T18:54:28",
"upload_time_iso_8601": "2023-02-11T18:54:28.250661Z",
"url": "https://files.pythonhosted.org/packages/9b/ad/b1cf36245cfca3b4b4d2e01bee739fcf93adf3e174b21c140b328b7ae63b/georouting-0.0.8-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d668befd0e12eba322291c6bfeb530f641f945d51334cc608286d8eb610571cc",
"md5": "f1468d9fd6837eaa908571322a3e5e94",
"sha256": "b6807dcfa55a1667ed360225d2bffd137f91e8fb5ed29f4b8c9e7e5389d7cb4f"
},
"downloads": -1,
"filename": "georouting-0.0.8.tar.gz",
"has_sig": false,
"md5_digest": "f1468d9fd6837eaa908571322a3e5e94",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 19989,
"upload_time": "2023-02-11T18:54:29",
"upload_time_iso_8601": "2023-02-11T18:54:29.473514Z",
"url": "https://files.pythonhosted.org/packages/d6/68/befd0e12eba322291c6bfeb530f641f945d51334cc608286d8eb610571cc/georouting-0.0.8.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-02-11 18:54:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "wybert",
"github_project": "georouting",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "georouting"
}