fio-planet


Namefio-planet JSON
Version 1.0.1 PyPI version JSON
download
home_page
Summaryfio_planet: Fiona CLI plugins from Planet Labs.
upload_time2023-04-21 18:39:15
maintainer
docs_urlNone
authorSean Gillies
requires_python>=3.7
license
keywords geojson gis cli
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            fio-planet
==========

A package of Fiona CLI plugins from Planet Labs.

[![](https://github.com/planetlabs/fio-planet/actions/workflows/check.yml/badge.svg)](https://github.com/planetlabs/fio-planet/actions/workflows/check.yml)
[![](https://github.com/planetlabs/fio-planet/actions/workflows/test.yml/badge.svg)](https://github.com/planetlabs/fio-planet/actions/workflows/test.yml)
[![Documentation Status](https://readthedocs.org/projects/fio-planet/badge/?version=latest)](https://fio-planet.readthedocs.io/en/latest/?badge=latest)

These CLI commands are for creating Unix pipelines which manipulate streams of
GeoJSON features. Such pipelines provide a subset of the functionality of more
complicated tools such as GeoPandas, PostGIS, or QGIS, and are intended for use
with streams of hundreds of features, where the overhead of JSON serialization
between pieces of a pipeline is tolerable.


Installation
------------

```
python -m pip install --user fio-planet
```

Usage
-----

fio-planet adds `filter`, `map`, and `reduce` commands to Fiona's `fio`
program. These commands afford some of the capabilities of spatial SQL, but act
on features of a GeoJSON feature sequence instead of rows of a spatial RDBMS
table.  fio-filter decimates a seqence of features, fio-map multiplies and
transforms features, and fio-reduce turns a sequence of many features into a
sequence of exactly one.  In combination, many transformations are possible.

Expressions take the form of parenthesized lists which may contain other
expressions. The first item in a list is the name of a function or method, or
an expression that evaluates to a function. The second item is the function's
first argument or the object to which the method is bound. The remaining list
items are the positional and keyword arguments for the named function or
method. The list of functions and callables available in an expression
includes:

* Python operators such as `+`, `/`, and `<=` plus `truth`, `not`, and `is`
* Python builtins such as `dict`, `list`, and `map`
* All public functions from itertools, e.g. `islice`, and `repeat`
* All functions importable from Shapely 2.0, e.g. `Point`, and `unary_union`
* All methods of Shapely geometry classes
* Functions specific to fio-planet

Here's an expression that evaluates to a Shapely Point instance.

```lisp
(Point 0 0)
```

`Point` is a callable instance constructor and the pair of `0` values are
positional arguments. Note that the outermost parentheses of an expression are
optional.

Here's an expression that evaluates to a Polygon, using `buffer`.

```lisp
buffer (Point 0 0) :distance 1.0
```

The inner expression `(Point 0 0)` evaluates to a Shapely Point instance,
`buffer` evaluates to `shapely.buffer()`, and `:distance 1.0` assigns a value
of 1.0 to that method's `distance` keyword argument.

In a fio-planet expression, all coordinates and geometry objects are in the
`OGC:CRS84` reference system, like GeoJSON. However, function arguments related
to length or area, such as buffer's distance argument, are understood to have
units of meters.

fio-filter and fio-map evaluate expressions in the context of a GeoJSON feature
and its geometry attribute. These are named `f` and `g`. For example, here is
an expression that tests whether the input feature is within 50 meters of the
given point.

```lisp
<= (distance g (Point -105.0 39.753056)) 50.0
```

fio-reduce evaluates expressions in the context of the sequence of all input
geometries, which is named `c`. For example, this expression dissolves input
geometries using Shapely's `unary_union`.

```lisp
unary_union c
```

Support
-------

Documentation is hosted at Read the Docs: https://fio-planet.readthedocs.io/en/latest/.

For usage help, please use the project discussion forum or email
developers@planet.com.

If you think you've found a bug, please use the project issue tracker.

Roadmap
-------

Version 1.0 adds `filter`, `map`, and `reduce` to Fiona's `fio` CLI.

Note that there are no conditional forms in 1.0's expressions. The project will
likely add a `cond` after 1.0.

Contributing
------------

Before 1.0  the project is looking for feedback on the existing commands more
than it is looking for new commands.

The project uses black, flake8, mypy, and tox for static checks
and testing.

```
black src tests && flake8 && mypy && tox
```

Authors and acknowledgment
--------------------------

Contributors to this project are

* Sean Gillies <sean.gillies@planet.com>

License
-------

Apache License, Version 2.0.


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "fio-planet",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "Planet Developer Relations <developers@planet.com>",
    "keywords": "GeoJSON,GIS,CLI",
    "author": "Sean Gillies",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/9b/b5/a66e60ebdaddbbe747cc377edb8d9b150460f5a5dfb049b96ed658ae3c54/fio_planet-1.0.1.tar.gz",
    "platform": null,
    "description": "fio-planet\n==========\n\nA package of Fiona CLI plugins from Planet Labs.\n\n[![](https://github.com/planetlabs/fio-planet/actions/workflows/check.yml/badge.svg)](https://github.com/planetlabs/fio-planet/actions/workflows/check.yml)\n[![](https://github.com/planetlabs/fio-planet/actions/workflows/test.yml/badge.svg)](https://github.com/planetlabs/fio-planet/actions/workflows/test.yml)\n[![Documentation Status](https://readthedocs.org/projects/fio-planet/badge/?version=latest)](https://fio-planet.readthedocs.io/en/latest/?badge=latest)\n\nThese CLI commands are for creating Unix pipelines which manipulate streams of\nGeoJSON features. Such pipelines provide a subset of the functionality of more\ncomplicated tools such as GeoPandas, PostGIS, or QGIS, and are intended for use\nwith streams of hundreds of features, where the overhead of JSON serialization\nbetween pieces of a pipeline is tolerable.\n\n\nInstallation\n------------\n\n```\npython -m pip install --user fio-planet\n```\n\nUsage\n-----\n\nfio-planet adds `filter`, `map`, and `reduce` commands to Fiona's `fio`\nprogram. These commands afford some of the capabilities of spatial SQL, but act\non features of a GeoJSON feature sequence instead of rows of a spatial RDBMS\ntable.  fio-filter decimates a seqence of features, fio-map multiplies and\ntransforms features, and fio-reduce turns a sequence of many features into a\nsequence of exactly one.  In combination, many transformations are possible.\n\nExpressions take the form of parenthesized lists which may contain other\nexpressions. The first item in a list is the name of a function or method, or\nan expression that evaluates to a function. The second item is the function's\nfirst argument or the object to which the method is bound. The remaining list\nitems are the positional and keyword arguments for the named function or\nmethod. The list of functions and callables available in an expression\nincludes:\n\n* Python operators such as `+`, `/`, and `<=` plus `truth`, `not`, and `is`\n* Python builtins such as `dict`, `list`, and `map`\n* All public functions from itertools, e.g. `islice`, and `repeat`\n* All functions importable from Shapely 2.0, e.g. `Point`, and `unary_union`\n* All methods of Shapely geometry classes\n* Functions specific to fio-planet\n\nHere's an expression that evaluates to a Shapely Point instance.\n\n```lisp\n(Point 0 0)\n```\n\n`Point` is a callable instance constructor and the pair of `0` values are\npositional arguments. Note that the outermost parentheses of an expression are\noptional.\n\nHere's an expression that evaluates to a Polygon, using `buffer`.\n\n```lisp\nbuffer (Point 0 0) :distance 1.0\n```\n\nThe inner expression `(Point 0 0)` evaluates to a Shapely Point instance,\n`buffer` evaluates to `shapely.buffer()`, and `:distance 1.0` assigns a value\nof 1.0 to that method's `distance` keyword argument.\n\nIn a fio-planet expression, all coordinates and geometry objects are in the\n`OGC:CRS84` reference system, like GeoJSON. However, function arguments related\nto length or area, such as buffer's distance argument, are understood to have\nunits of meters.\n\nfio-filter and fio-map evaluate expressions in the context of a GeoJSON feature\nand its geometry attribute. These are named `f` and `g`. For example, here is\nan expression that tests whether the input feature is within 50 meters of the\ngiven point.\n\n```lisp\n<= (distance g (Point -105.0 39.753056)) 50.0\n```\n\nfio-reduce evaluates expressions in the context of the sequence of all input\ngeometries, which is named `c`. For example, this expression dissolves input\ngeometries using Shapely's `unary_union`.\n\n```lisp\nunary_union c\n```\n\nSupport\n-------\n\nDocumentation is hosted at Read the Docs: https://fio-planet.readthedocs.io/en/latest/.\n\nFor usage help, please use the project discussion forum or email\ndevelopers@planet.com.\n\nIf you think you've found a bug, please use the project issue tracker.\n\nRoadmap\n-------\n\nVersion 1.0 adds `filter`, `map`, and `reduce` to Fiona's `fio` CLI.\n\nNote that there are no conditional forms in 1.0's expressions. The project will\nlikely add a `cond` after 1.0.\n\nContributing\n------------\n\nBefore 1.0  the project is looking for feedback on the existing commands more\nthan it is looking for new commands.\n\nThe project uses black, flake8, mypy, and tox for static checks\nand testing.\n\n```\nblack src tests && flake8 && mypy && tox\n```\n\nAuthors and acknowledgment\n--------------------------\n\nContributors to this project are\n\n* Sean Gillies <sean.gillies@planet.com>\n\nLicense\n-------\n\nApache License, Version 2.0.\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "fio_planet: Fiona CLI plugins from Planet Labs.",
    "version": "1.0.1",
    "split_keywords": [
        "geojson",
        "gis",
        "cli"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ba85aca201d8238f12013ebb671da39915b4e5c3a037ba536468bd3b79a1703",
                "md5": "62a420b7d1db2309810bd0b8d863b68f",
                "sha256": "c996cd5d4d19f6adcc967d9e804092df74dc13e2d614dfee58c06971cc9138a1"
            },
            "downloads": -1,
            "filename": "fio_planet-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "62a420b7d1db2309810bd0b8d863b68f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 16768,
            "upload_time": "2023-04-21T18:39:13",
            "upload_time_iso_8601": "2023-04-21T18:39:13.825990Z",
            "url": "https://files.pythonhosted.org/packages/6b/a8/5aca201d8238f12013ebb671da39915b4e5c3a037ba536468bd3b79a1703/fio_planet-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9bb5a66e60ebdaddbbe747cc377edb8d9b150460f5a5dfb049b96ed658ae3c54",
                "md5": "145c78399e78c3964850484eccc038d6",
                "sha256": "40a869ad1e02f9aacbebfbecbe13bec2183f00a3281848dc2e81fa1fed91f771"
            },
            "downloads": -1,
            "filename": "fio_planet-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "145c78399e78c3964850484eccc038d6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 58223,
            "upload_time": "2023-04-21T18:39:15",
            "upload_time_iso_8601": "2023-04-21T18:39:15.440283Z",
            "url": "https://files.pythonhosted.org/packages/9b/b5/a66e60ebdaddbbe747cc377edb8d9b150460f5a5dfb049b96ed658ae3c54/fio_planet-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-21 18:39:15",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "fio-planet"
}
        
Elapsed time: 0.75905s