Skip to main content

The core of the BSSD project

Project description

BSSD Core

Install

Using pip

pip install bssd

This will install the latest version of the bssd core library available in PyPI to your environment.

Manual installation from source

Install the package into your local python3 virtual environment:

git clone https://git.rwth-aachen.de/fzd/unicar-agil/sonstiges/bssd/core.git bssd

If you are using virtual environments, make sure to activate the correct environment to install the library into e.g:

source /<path-to-my-project>/.venv/bin/activate

Install the library:

pip install -e path/to/bssd/repository

Usage

The package is build as an extension of pyosmium. Following is a simple example on how to use the library. The referenced objects from the handler are only temporary. If data is wished to be stored it must be copied out.

import osmium
from bssd.core import BSSDHandler, Reservation
from bssd.core import mutable


class Handler(BSSDHandler):
    def __init__(self):
        super().__init__()
        self.writer = osmium.SimpleWriter("out.osm")

    # callback function for reservations
    def reservation(self, r: Reservation):
        # r is readonly, to change r it must be converted
        r: mutable.Reservation = r.make_mutable()
        r.bicycle = True
        # write the changed reservation to the output file
        self.writer.add_relation(r.get_osmium())


if __name__ == "__main__":
    h = Handler()
    h.apply_file("in.osm")

BSSDHandler callback functions

These callback functions need to be implemented in the inheriting class to be used. The function will receive the specified objects after calling apply_file(). The relation callback can be used to read non BSSD elements.

  • behavior_space(core.BehaviorSpace)
  • behavior(core.Behavior)
  • boundary_lat(core.BoundaryLat)
  • boundary_long(core.BoundaryLong)
  • reservation(core.Reservation)
  • relation(osm.Relation)

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

bssd_core-0.1.1.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

bssd_core-0.1.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: bssd_core-0.1.1.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for bssd_core-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e6346b655e06575e07b678e2a683ff6f4643a71bf245f9814132fcd283675356
MD5 a6b5f7a98c059c9390bce1c19b3cc30c
BLAKE2b-256 16393e3ff4b77f2c96951bdc171d12f785d4e374257ee06fef11183d073e16ea

See more details on using hashes here.

File details

Details for the file bssd_core-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: bssd_core-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.10

File hashes

Hashes for bssd_core-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9067563c81a6582ea98ca47862b5e47ed721ac97997d7231373d6cb508043962
MD5 6a3f4a2477540813f2f55c29b127ac22
BLAKE2b-256 bf29f21e6e1a5fce397a898f45f93dbd7aa413e11ff73cd2737e67ee46f635d6

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