Skip to main content

Support for stationing used in civil plans

Project description

civstation

Overview

Provides a Station object, which represents a Station of the kind found in civil plans of roads and other linear features, where 5+10 for example represents a point 510 feet (or meters or any units) from an arbitrary starting point.

Station objects

Import the Station class:

from civstation import Station

Create a station object:

sta = Station("4+56.78")

Stations can also be made from a number, which will convert it to a Station.

>>>sta = Station(456.78)
>>>print (sta)
4+56.78

Stations can also be made from a Station, for ease of implentation.

Stations default to displaying two decimal places with trailing zeros. This can be changed by setting decimal_places to the desired number.

>>>sta = Station(456.78, decimal_places = 4)
>>>print(sta)
4+56.7800

Operations

Stations can be added, subtracted, and compared.

Adding a station and a number (float, int, etc.) returns a Station.

Subtracting a number from a station returns a Station.

Subtracting a a Station from a Station returns a float. This is because stations represent a position along a line. Subtracting two stations produces a distance not a position, best represented as a float, not a Station. However, this behavior can be overridden by setting return_float_on_sub = False, to work completely in Stations.

There doesn't appear to be a good reason to multiply or divide Stations, so it is not supported. If this is necessary, convert them to floats or another suitable type.

Definition of Station object

The following code shows the args taken by a Station object.

class Station:
    def __init__(self, sta, decimal_places = 2, return_float_on_sub = True) -> None:

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

civstation-0.1.2.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

civstation-0.1.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file civstation-0.1.2.tar.gz.

File metadata

  • Download URL: civstation-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for civstation-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c146b93e0a434f7a79e9d1f720875c6ad13fa40e2f805c60e24374d121e55254
MD5 ca771b71a041535ada88b60b47ef2d6b
BLAKE2b-256 54ee94a531dd53e2a12162034b2920f2a7d35198359f2116d7b3717e133d770a

See more details on using hashes here.

File details

Details for the file civstation-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: civstation-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for civstation-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d5fb9fadaf636a7f0672a26446b011885b01d0ae8984ef6d200cb566d6f81cc2
MD5 a17798f45fa622399fe384871b4431c0
BLAKE2b-256 475804aab08ff09becc589c8f2ac896a259b282579a0e861a0f8689565320a3d

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