Skip to main content

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


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.14.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dongraphio-0.3.14-py3-none-any.whl (22.1 kB view details)

Uploaded Python 3

File details

Details for the file dongraphio-0.3.14.tar.gz.

File metadata

  • Download URL: dongraphio-0.3.14.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Windows/10

File hashes

Hashes for dongraphio-0.3.14.tar.gz
Algorithm Hash digest
SHA256 e5b96a2e771ff05c620fa917d13ba166839b163755b2cba8c01ada49a887a344
MD5 72d679900727bf303724a7e1428cb3e7
BLAKE2b-256 29cc01cb1d4573f7ac505f798c4294ffecce71452e08c6ee5f4cae03266d0c53

See more details on using hashes here.

File details

Details for the file dongraphio-0.3.14-py3-none-any.whl.

File metadata

  • Download URL: dongraphio-0.3.14-py3-none-any.whl
  • Upload date:
  • Size: 22.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.9 Windows/10

File hashes

Hashes for dongraphio-0.3.14-py3-none-any.whl
Algorithm Hash digest
SHA256 6352bbd12cc2039cf8032cf94ac2070fbe58b6c9727858bbc5848675566cab39
MD5 c435fa2a71cc2c366a00e1c35e895422
BLAKE2b-256 22a66772340a96c99f3f24b492e8e9bbba4cde051a1a821159618503be0a7f84

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page