Skip to main content

Common operations and transformations on routes represented by a 2D line in xy space and corresponding z-axis data.

Project description

Routely

https://travis-ci.com/jhags/routely.svg?branch=main https://coveralls.io/repos/github/jhags/routely/badge.svg?branch=main https://readthedocs.org/projects/routely/badge/?version=latest

Travis build Python 3.6, 3.7, 3.8.

Intro

Common operations and transformations on routes represented by a 2D line in xy space

Route is designed to provide many of the common route operations and transformations to make route processing simpler and quicker.

A route is represented by a series of point coordinates on a two dimensional x-y plane. Z-axis data can be specified as well, however the primary focus of these common transformations are based on the x-y plane data with z-axis data being transformed accordingly.

The primary focus is on x-y plane data because z-axis data does not have to represent a path through three dimensional space, rather z-data can represent additonal layers of route data that correspond to the x-y path.

For example, a runner may be tracking pace or heartrate, a car will have changes in speed, etc. Therefore, transformations are primarily concerned with the x-y route taken.

Installation

pip install routely

Quick start

To begin with, let’s define a path that comprises two lists of x and y points that together form the coordinates of the line.

# x and y coordinates of a path.
x = [-5, 5, 15, 25, 20, 0]
y = [0, 10, 40, 15, 5, 20]

To make use of Routely, we can pass these lists of x and y points to Routely’s Route class.

from routely import Route

r = Route(x, y)

# Plot x vs y
r.plotroute()
https://raw.githubusercontent.com/jhags/routely/main/docs/images/plot_1.png

You can add z-axis data too, which should be passed as a dictionary. This enables you to have one or more z-axis datasets.

# Add a few z-axis datasets
z1 = [0, 1, 2, 3, 4, 5]
z2 = [0, 1, 2, 3, 2, 0]

# z-axis data must be passed as a dictionary
z_data = {'foo':z1, 'bar':z2}

r = Route(x, y, z=z_data)

# Plot z-axis data
# Note that z-axis data is plotted against the distance along the route
r.plot_z()
https://raw.githubusercontent.com/jhags/routely/main/docs/images/plot_2.png

Using the Route object, you can now quickly and easily get key properties of the route data such as:

# Get the bounding box and center coordinates of the route
r.bbox()
((-5, 0), (25, 40))

r.center()
(10.0, 20.0)

# The absolute width, height and centerof the route
r.width()
30

r.height()
40

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

routely-0.1.4.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

routely-0.1.4-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file routely-0.1.4.tar.gz.

File metadata

  • Download URL: routely-0.1.4.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.9

File hashes

Hashes for routely-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2f837e6ce99b99afe416c7ec162f021ac68f69df4cb9c1a2e83d13c892e24755
MD5 f1bed699ff21024c7829501dab4f7dca
BLAKE2b-256 e38fd744c10333cc857e58621cf13f2aed4a19384ca8a6bb7782120552b03f7a

See more details on using hashes here.

File details

Details for the file routely-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: routely-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.7.9

File hashes

Hashes for routely-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 cdd85fa55057cde96dd824b01c43be368bcb602ce93813f6be454727b75930d0
MD5 5f6b94dcb28785c23b6bc26bccc36a56
BLAKE2b-256 24c05588fb598168baa31f810085877b6664bc2646e64b8f9ca10430b5eb2dfb

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