A Fiona CLI plugin for buffering geometries.
Project description
A Fiona CLI plugin for buffering geometries in parallel. Powered by Shapely.
Usage
Usage: fio buffer [OPTIONS] INFILE OUTFILE
Geometries can be dilated with a positive distance, eroded with a negative
distance, and in some cases cleaned or repaired with a distance of 0.
Examples
--------
Default settings - buffer geometries in the input CRS:
$ fio buffer in.geojson out.geojson --dist 10
Dynamically buffer geometries by a distance stored in the field
`magnitude` and write as GeoJSON:
$ fio buffer \
in.shp \
out.geojson \
--driver GeoJSON \
--dist magnitude
Read geometries from one CRS, buffer in another, and then write to a
third:
$ fio buffer in.shp out.shp \
--dist 10 \
--buf-crs EPSG:3857 \
--dst-crs EPSG:32618
Control cap style, mitre limit, segment resolution, and join style:
$ fio buffer in.geojson out.geojson \
--dist 0.1 \
--res 5 \
--cap-style flat \
--join-style mitre \
--mitre-limit 0.1\
Options:
-f, --format, --driver NAME Output driver name. [required]
--cap-style [flat|round|square]
Where geometries terminate, use this style.
(default: round)
--join-style [round|mitre|bevel]
Where geometries touch, use this style.
(default: round)
--res INTEGER Resolution of the buffer around each vertex
of the object. (default: 16)
--mitre-limit FLOAT When using a mitre join, limit the maximum
length of the join corner according to this
ratio. (default: 0.5)
--dist FLOAT | FIELD Buffer distance in georeferenced units
according to --buf-dist. [required]
--src-crs TEXT Specify CRS for input data. Not needed if
set in input file.
--buf-crs TEXT Perform buffer operations in a different
CRS. (default: --src-crs)
--dst-crs TEXT Reproject geometries to a different CRS
before writing. Must be combined with
--buf-crs. (default: --src-crs)
--otype GEOMTYPE Specify output geometry type. (default:
MultiPolygon)
--skip-failures Skip geometries that fail somewhere in the
processing pipeline.
--jobs CORES Process geometries in parallel across N
cores. The goal of this flag is speed so
feature order and ID's are not preserved.
(default: 1)
--help Show this message and exit.
Installing
Via pip:
$ pip install fio-buffer
From source:
$ git clone https://github.com/geowurster/fio-buffer
$ cd fio-buffer
$ python setup.py install
Developing
$ git clone https://github.com/geowurster/fio-buffer
$ cd fio-buffer
$ virtualenv venv
$ source venv/bin/activate
$ pip install -e .[test]
$ py.test tests --cov fio_buffer --cov-report term-missing
License
See LICENSE.txt.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fio-buffer-0.1.tar.gz
(8.2 kB
view details)
File details
Details for the file fio-buffer-0.1.tar.gz
.
File metadata
- Download URL: fio-buffer-0.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 396e58334bed8d45283a55dd30d5d1f3ae51954abd30932e3bdc6bb9fda20923 |
|
MD5 | fc4ae93b4bbe852f59e487d6b70e0514 |
|
BLAKE2b-256 | 0c9186f6707cbfd16f30cbe01dea809b7b12ff17fd211bff3241775b3ae9a098 |