cx


Namecx JSON
Version 0.2.2 PyPI version JSON
download
home_pagehttps://github.com/bast/coastal-express
SummaryCompute nearest neighbor distances along the coast with a view angle.
upload_time2023-05-30 14:51:22
maintainerNone
docs_urlNone
authorRadovan Bast
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            .. image:: https://github.com/bast/coastal-express/workflows/Test/badge.svg
   :target: https://github.com/bast/coastal-express/actions
.. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg
   :target: LICENSE
.. image:: https://badge.fury.io/py/cx.svg
   :target: https://badge.fury.io/py/cx


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.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/bast/coastal-express",
    "name": "cx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": "Radovan Bast",
    "author_email": "radovan.bast@uit.no",
    "download_url": "https://files.pythonhosted.org/packages/d8/99/fffa5ec5cc419855977324671e4808fa7c35bf13d58417b553378b2f8192/cx-0.2.2.tar.gz",
    "platform": null,
    "description": ".. image:: https://github.com/bast/coastal-express/workflows/Test/badge.svg\n   :target: https://github.com/bast/coastal-express/actions\n.. image:: https://img.shields.io/badge/license-%20MPL--v2.0-blue.svg\n   :target: LICENSE\n.. image:: https://badge.fury.io/py/cx.svg\n   :target: https://badge.fury.io/py/cx\n\n\nCoastal express\n===============\n\nCompute nearest neighbor distances along the coast with a view angle.\n\n\nInstallation\n------------\n\n::\n\n  $ pip install cx\n\n\nExample\n-------\n\n::\n\n  cx --boundary=\"$PWD/boundary.txt\" \\\n     --islands=\"$PWD/islands.txt\" \\\n     --view-angle=90.0 \\\n     --min-distance=3.0 \\\n     --max-distance=40.0 \\\n     --output-dir=\"$PWD/output\"\n\n\nAvailable options\n-----------------\n\n::\n\n  $ cx --help\n\n  Usage: cx [OPTIONS]\n\n  Options:\n    --boundary TEXT      File containing the boundary.\n    --islands TEXT       File(s) containing island data - you can use wildcards.\n    --view-angle TEXT    View angle in degrees.\n    --min-distance TEXT  Min distance.\n    --max-distance TEXT  Max distance.\n    --output-dir TEXT    Output folder.\n    --help               Show this message and exit.\n\n\nDefinition of the view angle\n----------------------------\n\nThe code will form view vectors perpendicular to the coastline. The code will\nmake sure that along the boundary, the vectors point towards \"inside\" and along\nislands they point towards \"outside\". The view vector is computed to be\nperpendicular to the vector connecting the two neighboring points of the\ncurrent point.\n\nThe view angle of N degrees defines a view sector N/2 degrees to both sides of\nthe view vector.  In other words a view angle of N degrees is N degrees wide in\ntotal and is oriented symmetrically around the view vector which is\nperpendicular to the coast line.\n\n\nInput and output formats\n------------------------\n\nThe code will read boundary and island files. It assumes that the first line in\nthe boundary file contains the total number of polygon points, followed by one\nline per point.  First and last polygon point are expected to be the same\npoint.  Two first numbers in each line are assumed to be x and y coordinates in\narbitrary but consistent units.  Each line can contain more numbers and the\ncode will not worry about these.\n\nThe code can read one or many island files. Each island file can contain one or\nmany polygons.  Each polygon starts with one line specifying the total number\nof points.  First and last polygon point are expected to be the same point.\nEach point line is interpreted the same way as the boundary.\n\nThe output format preserves all lines and numbers and the only thing it will do\nis to append each point line by the computed distance. In other words each\npoint line will become longer by one number.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Compute nearest neighbor distances along the coast with a view angle.",
    "version": "0.2.2",
    "project_urls": {
        "Homepage": "https://github.com/bast/coastal-express"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "7a1b7e5c7ed2957d06dcae85e147a14f18e48ec7cf70e2ea5847c01559061a2d",
                "md5": "8d121979f4a67165c21be7047dec82d1",
                "sha256": "456c7740af31c808d1964fef861af91532bb319db5d630f33ac1518c8e8d07c8"
            },
            "downloads": -1,
            "filename": "cx-0.2.2-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8d121979f4a67165c21be7047dec82d1",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 11113,
            "upload_time": "2023-05-30T14:51:19",
            "upload_time_iso_8601": "2023-05-30T14:51:19.642837Z",
            "url": "https://files.pythonhosted.org/packages/7a/1b/7e5c7ed2957d06dcae85e147a14f18e48ec7cf70e2ea5847c01559061a2d/cx-0.2.2-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d899fffa5ec5cc419855977324671e4808fa7c35bf13d58417b553378b2f8192",
                "md5": "dc8750e50cd863ba3cfe382176aeeb38",
                "sha256": "2922ebe367cc98766c0f215e170712c186e7f8924da313a8257e33586dc0f62d"
            },
            "downloads": -1,
            "filename": "cx-0.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "dc8750e50cd863ba3cfe382176aeeb38",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 14038,
            "upload_time": "2023-05-30T14:51:22",
            "upload_time_iso_8601": "2023-05-30T14:51:22.694027Z",
            "url": "https://files.pythonhosted.org/packages/d8/99/fffa5ec5cc419855977324671e4808fa7c35bf13d58417b553378b2f8192/cx-0.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-30 14:51:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "bast",
    "github_project": "coastal-express",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "cx"
}
        
Elapsed time: 0.07677s