Small utility library containing graph algorighms used in other projects
Project description
DonGraphio
Small utility library containing graph algorighms used in other projects.
Base usage example
pip install dongraphio
import geopandas as gpd
from dongraphio import DonGraphio
from dongraphio import GraphType
import networkx as nx
from shapely import Point
dongrph = DonGraphio(city_crs=32638)
intermodal_graph = dongrph.get_intermodal_graph_from_osm(city_osm_id=3955288)
nx.write_graphml(intermodal_graph,"city_intermodal.graphml")
builds_from = gpd.read_file("test_data/buildings.geojson")
services_to = gpd.read_file("test_data/services.geojson")
adjacency_matrix = dongrph.get_adjacency_matrix(gdf_from=builds_from, gdf_to=services_to, weight="time_min",graph_type=[GraphType.PUBLIC_TRANSPORT, GraphType.WALK])
adjacency_matrix.to_csv("city_adjacency_matrix.csv")
accessibility_isochrones, public_transport_routes, public_transport_stops = dongrph.get_accessibility_isochrones(
graph_type=[GraphType.PUBLIC_TRANSPORT, GraphType.WALK],
points=Point(571747,5709639),
weight_value=15,
weight_type="time_min",
)
accessibility_isochrones.to_file("city_accessibility_isochrones.geojson")
public_transport_routes.to_file("city_public_transport.geojson")
public_transport_stops.to_file("city_public_stops.geojson")
To get rid of GeoPandas warning message about Shapely one can use following construction in their code:
import os
os.environ["USE_PYGEOS"] = os.environ.get("USE_PYGEOS", "0")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dongraphio-0.3.13.tar.gz
(18.6 kB
view details)
Built Distribution
File details
Details for the file dongraphio-0.3.13.tar.gz
.
File metadata
- Download URL: dongraphio-0.3.13.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.1 CPython/3.10.11 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2e31fd1f65594b10391cee8c962c346912deb6574cae7ee0dc296afcd84af2a9 |
|
MD5 | b1cbabf0fa4b91931f062871f8cbc111 |
|
BLAKE2b-256 | ce97dc0b8cf36b58f5c11de7deeda4ef25482d519c90acbc4efc89062fba44f9 |
File details
Details for the file dongraphio-0.3.13-py3-none-any.whl
.
File metadata
- Download URL: dongraphio-0.3.13-py3-none-any.whl
- Upload date:
- Size: 22.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.1 CPython/3.10.11 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 578bbe59885dea23c4f136fde4a01bf38323d2119bbe69438bc9daae6e1ae8fb |
|
MD5 | d3ef354fb208358403d1715b91bb12d4 |
|
BLAKE2b-256 | b424f37e66c47d27bbd622f12b656533305c3e29febfad5a36a1cc158bd66a88 |