Skip to main content

This library provides a set of tools for generating isochrones from geographic coordinates. It leverages OpenStreetMap data to construct road networks and calculate areas accessible within specified time limits. The library is designed for both Rust and Python, offering high performance and easy integration into data science workflows.

Project description

OSM_graph

Quickly generate isochrones for Python and Rust!

This library provides a set of tools for generating isochrones and reverse isochrones from geographic coordinates. It leverages OpenStreetMap data to construct road networks and calculate areas accessible within specified time limits. The library is designed for both Rust and Python, offering high performance and easy integration into data science workflows.

Isochrones

Features

  • Graph Construction: Parses OpenStreetMap data to construct a graph representing the road network.
  • Isochrone Calculation: Generates isochrones, areas reachable within a given time frame from a start point, using Dijkstra's algorithm.
  • Reverse Isochrone Calculation: Determines areas from which a point can be reached within a given time frame.
  • Concave and Convex Hulls: Supports generating both concave and convex hulls around isochrones for more accurate or simplified geographical shapes.
  • Caching: Implements caching mechanisms to store and retrieve pre-calculated graphs for faster access. Python Integration: Offers Python bindings to use the library's functionalities directly in Python scripts, notebooks, and applications.
  • Concurrency Support: Utilizes Rust's concurrency features for efficient isochrone calculation over large datasets.
  • GeoJSON Output: Converts isochrones into GeoJSON format for easy visualization and integration with mapping tools.

Installation

To use the library in Rust, add it to your Cargo.toml:

[dependencies]
osm-graph = "0.1.0"

For Python,

pip install pysochrone

Or, ensure you have Rust and maturin installed, then build and install the Python package:

maturin develop

Usage

Rust

use osm_graph::{calculate_isochrones_from_point, HullType};

async fn main() {
    let isochrone = isochrone::calculate_isochrones_from_point(
        48.123456,
        11.123456,
        10_000.0,
        vec![300.0, 600.0, 900.0, 1_200.0, 1_500.0, 1_800.0],
        overpass::NetworkType::Drive,
        isochrone::HullType::Convex,
    )
    .await
    .unwrap();
}

Python

import pysochrone

isochrones = pysochrone.calc_isochrones(
    48.123456, 
    11.123456, 
    5000, 
    [600, 1200, 1800], 
    "Drive", 
    "Convex"
)

Roadmap

[ ] Testing and benchmarks. [ ] Customizable Speed Limits: Allow users to specify custom speed limits for different road types. [x] Support for Pedestrian and Bicycle Networks: Expand the graph construction to support pedestrian and bicycle network types. [ ] Topological simplification of osm graphs for more efficient downstream analytics. [ ] Additional Roadnetwork analytics. [ ] Routing engine. [ ] Advanced Caching Strategies: Implement more sophisticated caching mechanisms for dynamic query parameters. [ ] Interactive Visualization Tools: Develop a set of tools for interactive visualization of isochrones in web applications. [ ] API Integration: Provide integration options with third-party APIs for enhanced data accuracy and features. [ ] Optimization and Parallel Computing: Further optimize the graph algorithms and explore parallel computing options for large-scale data.

Contributing

Contributions are welcome! Please submit pull requests, open issues for discussion, and suggest new features or improvements.

License

This library is licensed under MIT License.

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

pysochrone-0.1.1.tar.gz (22.7 kB view details)

Uploaded Source

Built Distribution

pysochrone-0.1.1-cp39-none-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9 Windows x86-64

File details

Details for the file pysochrone-0.1.1.tar.gz.

File metadata

  • Download URL: pysochrone-0.1.1.tar.gz
  • Upload date:
  • Size: 22.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.4.0

File hashes

Hashes for pysochrone-0.1.1.tar.gz
Algorithm Hash digest
SHA256 67ff580e086f433d1795850216072418ccfa4d9afd6c0f2b265ef75e23116d84
MD5 578be39c3416eb4f7962365d6ed19709
BLAKE2b-256 601c05244aa8d25b696babcda91bcf6c98884cc47ee56f30dcaf13fadb49d361

See more details on using hashes here.

File details

Details for the file pysochrone-0.1.1-cp39-none-win_amd64.whl.

File metadata

File hashes

Hashes for pysochrone-0.1.1-cp39-none-win_amd64.whl
Algorithm Hash digest
SHA256 5f5f548621553485ccc5f76cc813fa080b22d3b99036ca79ec84e2c42d14ed8c
MD5 55e12877ddac7283a6766603f5d06ca8
BLAKE2b-256 ad5b92160ce3a41d37650898038837ca2ec7d1e088f620f123505b8bb05d9888

See more details on using hashes here.

Supported by

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