Skip to main content

Open source project to allow translations between different spoor referential systems

Project description

Openspoor

Openspoor Logo

Introduction

The Openspoor package provides an easy way to transform between different geographical and topological systems commonly used in the Dutch railway network. It prepares this data for analysis and visualization. The goal is to make Openspoor publicly available as an open-source package.

Supported Transformations

Input Data:

  • Point data

Geographical Systems:

  • WGS84 (GPS coordinates)
  • EPSG:28992 (Rijksdriehoek)

Topological Systems:

  • Geocode and geocode kilometrering
  • Spoortak and spoortak kilometrering (unavailable on switches)
  • Spoortakken of different historical versions

Installation

Openspoor can be installed using different package management methods. Before proceeding, ensure you have created a virtual environment.

pip install openspoor

Development

To contribute to Openspoor, follow these steps to set up a development environment.

Step 1: Clone repository:

git clone https://github.com/ProRail-DataLab/openspoor.git
cd openspoor

Step 2: Create virtual environment:

uv venv --python=3.11
source .venv/bin/activate # linux/mac
.venv\Scripts\activate # windows

Step 3: Install dependencies

uv sync

Step 4: Run tests to verify setup

uv run pytest --nbmake --nbmake-kernel=python3

Step 5: install pre-commit hooks

Openspoor uses pre-commit hooks to enforce code quality. To install them:

pre-commit install

To run hooks manually on all files:

pre-commit run --all-files

Step 6: generating documentation

Openspoor uses pdoc to generate documentation. To generate and serve documentation locally:

pdoc --http : openspoor

Demonstration Notebook

A demonstration notebook is available in the demo_notebook folder, showcasing Openspoor's functionality.

Dependencies

Openspoor relies on data and APIs from mapservices.prorail.nl. Be aware of possible issues such as:

  • Changes in API endpoints
  • Modifications in output data format

Package Structure

1. Mapservices

Provides an interface to ProRail's map services API to retrieve railway topology data.

  • PUICMapservices: General railway track and switch data, including Geocode and Spoortak information.
  • SpoortakMapservices: Data for Spoortak identification and local kilometrering.

2. Transformers

Convert geographical and topological data.

  • TransformerCoordinatesToSpoor: WGS84/EPSG:28992 → Spoortak, Geocode
  • TransformerGeocodeToCoordinates: Geocode → WGS84/EPSG:28992
  • TransformerSpoorToCoordinates: Spoortak → WGS84/EPSG:28992

3. Spoortakmodel

Provides historical railway topology to enable transformations on historical data.

4. Visualisations

Allows plotting railway-related data on maps. Supports pandas and geopandas dataframes containing points or linestrings. With the TrackMap class, you can plot the railway network on a interactive map.

Release History

  • 0.3.1: Update for improved code quality.
  • 0.3.0: Added the railway network feautures (shortest path and visualization).
  • 0.1.10: Added support for historical spoortakken.
  • 0.1.9: Added spoortakmodel and visualization features.
  • 0.1.0: First stable release.
  • 0.0.1: Work in progress.

Contributing

We welcome contributions! Follow these steps:

  1. Fork the repository.
  2. Set up the development environment. See the Development section for details.
  3. Create a feature branch:
    git checkout -b feature/your-feature
    
  4. Commit changes:
    git commit -am "Add your feature"
    
  5. Push changes:
    git push origin feature/your-feature
    
  6. Create a pull request and assign at least three reviewers.

Alternatively, contribute by working on open issues listed on the GitHub repository.


For further details, visit the Openspoor GitHub repository.

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

openspoor-0.3.4.tar.gz (29.9 kB view details)

Uploaded Source

Built Distribution

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

openspoor-0.3.4-py3-none-any.whl (38.1 kB view details)

Uploaded Python 3

File details

Details for the file openspoor-0.3.4.tar.gz.

File metadata

  • Download URL: openspoor-0.3.4.tar.gz
  • Upload date:
  • Size: 29.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for openspoor-0.3.4.tar.gz
Algorithm Hash digest
SHA256 c21573c711e7739477f74f1307dd9e28d52f7a059ca53c129cf10a858823fad2
MD5 47b1e837a8d69e6eea0f235a18d3b284
BLAKE2b-256 9d53ec323d061d802f9226d6481a68c66cace0583e48da4358264f3ea700c26b

See more details on using hashes here.

File details

Details for the file openspoor-0.3.4-py3-none-any.whl.

File metadata

  • Download URL: openspoor-0.3.4-py3-none-any.whl
  • Upload date:
  • Size: 38.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for openspoor-0.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 75311518fedd3e7b6b1df731a9f96bda5ead2a4b3d0c1616014e88196caea408
MD5 8396577bf0ccf44916bfaecc894d0a08
BLAKE2b-256 ec1da2a6c2b2c03436657c529442b00e5cc47196ff522a679982f178bbfb9fc8

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