{"id":16850814,"url":"https://github.com/amauryval/osmrx","last_synced_at":"2025-10-25T18:31:09.661Z","repository":{"id":103330713,"uuid":"606491082","full_name":"amauryval/OsmRx","owner":"amauryval","description":"Geographic Python library to extract Open Street Map roads (and POIs) from a location or a bounding box, in order to create a graph thanks to Rustworkx. OsmRx is able to clean a network based on Linestring geometries and connect Point geometries. The graph built is able to process graph-analysis (shortest-path, isochrones...)","archived":false,"fork":false,"pushed_at":"2025-01-02T14:07:45.000Z","size":8199,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-04T01:09:25.451Z","etag":null,"topics":["geography","graph","isochrones","maps","network-analysis","nominatim","openstreetmap","overpass-api","pedestrian","point-of-interest","python","rustworkx","shortest-path","topology","vehicle"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amauryval.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-02-25T16:48:33.000Z","updated_at":"2025-01-02T14:06:32.000Z","dependencies_parsed_at":"2023-05-25T15:15:11.523Z","dependency_job_id":null,"html_url":"https://github.com/amauryval/OsmRx","commit_stats":{"total_commits":84,"total_committers":2,"mean_commits":42.0,"dds":0.0714285714285714,"last_synced_commit":"790f6b38e540bfe4524eb67d7c7a05b7c69690fc"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amauryval%2FOsmRx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amauryval%2FOsmRx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amauryval%2FOsmRx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amauryval%2FOsmRx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amauryval","download_url":"https://codeload.github.com/amauryval/OsmRx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238194625,"owners_count":19432090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["geography","graph","isochrones","maps","network-analysis","nominatim","openstreetmap","overpass-api","pedestrian","point-of-interest","python","rustworkx","shortest-path","topology","vehicle"],"created_at":"2024-10-13T13:25:17.494Z","updated_at":"2025-10-25T18:31:04.273Z","avatar_url":"https://github.com/amauryval.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OsmRx\n\nA geographic Python library to extract Open Street Map roads (and POIs) from a location or a bounding box, in order to create a graph thanks to [Rustworkx](https://github.com/Qiskit/rustworkx). OsmRx is able to clean a network based on Linestring geometries and connect Point geometries. The graph built is able to process graph-analysis (shortest-path, isochrones...)\n\nCapabilities:\n* load data from a location name or a bounding box (roads and pois)\n* graph creation (and topology processing and cleaning)\n* shortest path\n* isochrone builder\n\n[![CI](https://github.com/amauryval/osmrx/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/amauryval/osmrx/actions/workflows/main.yml)\n[![codecov](https://codecov.io/gh/amauryval/osmrx/branch/master/graph/badge.svg)](https://codecov.io/gh/amauryval/osmrx)\n\n[![PyPI version](https://badge.fury.io/py/osmrx.svg)](https://badge.fury.io/py/osmrx)\n\nCheck the demo [here](https://amauryval.github.io/omsrx/)\n\n## How to install it ?\n\n### with pip\n\n```bash\npip install osmrx\n```\n\n## How to use it ?\n\nCheck the jupyter notebook [here](https://amauryval.github.io/OsmRx/)\n\nCheck the wiki: TODO\n\n### Get POIs\n\nFind the Points of interest from a location (Point(s)) or a bounding box: \n* OSM attributes are returned\n* features ready to be used with shapely, GeoPandas (...):\n\n\n```python\nfrom osmrx.main.pois import Pois\n\nlocation_name = \"lyon\"  \n\n# Initialize the Pois class\npois_object = Pois()\n# call .from_location(location: str) or .from_bbox(bounds: Tuple[float, float, float, float]) to get data from your location\npois_object.from_location(location_name)  # nominatim api is used to get Lyon coordinates\n\n# It returns a list of dictionnaries [{\"geometry\": Point(...), \"attribute\": \"...\", ...}\n# Free for you to use it with GeoPandas or something else (epsg=4326)\npois_data_found = pois_object.data\n```\n\n### Get Roads\n\nFind the vehicle or pedestrian network (LineString(s)) from a location or a bounding box:\n* OSM attributes available\n* OSM features ready to be used with shapely, GeoPandas (...):\n* data cleaned regarding classical topology rules\n\n```python\nfrom osmrx.main.roads import Roads\n\n# Choose the vehicle or the pedestrian network\nroads_object = Roads(\"vehicle\")\n\n# from_location(location: str) is available\nroads_object.from_bbox({6.019674, 4.023742, 46.072575, 4.122018})\n\n# It returns a list of dictionnaries [{\"geometry\": Point(...), \"attribute\": \"...\", ...}\n# Free for you to use it with GeoPandas or something else (epsg=4326)\nroads_data_found = roads_object.data\n\n# return the rustworkx graph (directed for vehicle / undirected for pedestrian)\ngraph = roads_object.graph\n# Free for you to compute graph analysis\n```\n\n\n### Compute a shortest path\n\nCompute the shortest path from an ordered list of Point(s) (at least 2)\n\n```python\nfrom shapely import Point\n\nfrom osmrx.main.roads import GraphAnalysis\n\n# use the GraphAnalysis class and set:\n# the network type (pedestrian or vehicle) and an ordered list of 2 Shapely Points defining the source and the target\n# of your shortest path)\nanalysis_object = GraphAnalysis(\"pedestrian\",\n                              [Point(4.0793058, 46.0350304), Point(4.0725246, 46.0397676)])  # (epsg=4326)\npaths_built = analysis_object.get_shortest_path()\nfor path_object in paths_built:\n    print(path_object.path)  # LineString shortest path (epsg=4326)\n    print(path_object.features())  # List of LineString (with osm attributes) composing the path found\n```\n\n\n### Compute an Isochrone\n\nBuild an isochrone (Polygon(s)) from a Point\n\n```python\nfrom shapely import Point\n\nfrom osmrx.main.roads import GraphAnalysis\n\n# use the GraphAnalysis class and set:\n# the network type (pedestrian or vehicle) and a list of one Shapely Point (epsg=4326) to build the isochone\nanalysis_object = GraphAnalysis(\"vehicle\", [Point(4.0793058, 46.0350304)])\n\n# Set the distance intervals to compute the isochone with a list of integer or float\nisochrones_built = analysis_object.isochrones_from_distance([0, 250, 500, 1000, 1500])\n\n# List of Polygons with a distance attributes based on the intervals defined\nprint(isochrones_built.data)\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famauryval%2Fosmrx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famauryval%2Fosmrx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famauryval%2Fosmrx/lists"}