Skip to main content

test status license badge link to PyPI

Coastal express

Compute nearest neighbor distances along the coast with a view angle.

Installation

$ pip install cx

Example

$ cx --boundary="$PWD/boundary.txt" \
     --islands="$PWD/islands.txt" \
     --view-angle=90.0 \
     --min-distance=3.0 \
     --max-distance=40.0 \
     --output-dir="$PWD/output"

Available options

$ cx --help

Usage: cx [OPTIONS]

Options:
  --boundary TEXT      File containing the boundary.
  --islands TEXT       File(s) containing island data - you can use wildcards.
  --view-angle TEXT    View angle in degrees.
  --min-distance TEXT  Min distance.
  --max-distance TEXT  Max distance.
  --output-dir TEXT    Output folder.
  --help               Show this message and exit.

Definition of the view angle

The code will form view vectors perpendicular to the coastline. The code will make sure that along the boundary, the vectors point towards "inside" and along islands they point towards "outside". The view vector is computed to be perpendicular to the vector connecting the two neighboring points of the current point.

The view angle of N degrees defines a view sector N/2 degrees to both sides of the view vector. In other words a view angle of N degrees is N degrees wide in total and is oriented symmetrically around the view vector which is perpendicular to the coast line.

Input and output formats

The code will read boundary and island files. It assumes that the first line in the boundary file contains the total number of polygon points, followed by one line per point. First and last polygon point are expected to be the same point. Two first numbers in each line are assumed to be x and y coordinates in arbitrary but consistent units. Each line can contain more numbers and the code will not worry about these.

The code can read one or many island files. Each island file can contain one or many polygons. Each polygon starts with one line specifying the total number of points. First and last polygon point are expected to be the same point. Each point line is interpreted the same way as the boundary.

The output format preserves all lines and numbers and the only thing it will do is to append each point line by the computed distance. In other words each point line will become longer by one number.

Metadata

Release files for cx 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cx 0.2.4
File Size Uploaded
cx-0.2.4.tar.gz 14.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cx 0.2.4
File Interpreter ABI Platform
cx-0.2.4-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 25.2 kB

Release files / cx-0.2.4.tar.gz

Download URL cx-0.2.4.tar.gz
Size 14.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7927cdf987109339e0bde6abb729b284591dee9a2a2548945019fcd1cad37402
BLAKE2b-256 checksum
How to use checksums
593f5beada4fbbf6375c3140b8e70cbabaf4a3ebccf79d1314e86a47cde84061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release files / cx-0.2.4-py2.py3-none-any.whl

Download URL cx-0.2.4-py2.py3-none-any.whl
Size 11.2 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
dc04f9eb0859930fd9d2f44b1bb357987f9a1b7f81668b2cb529c3ead8dbb248
BLAKE2b-256 checksum
How to use checksums
22074ac5a899ba4cdcb48757bcf71e805f3e0d0e127c4c9d83f1cfb4522fc268
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-requests/2.32.5

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page