…is the command-line version of Polylabel. Install it using cargo install polylabel_cmd
.
This gives you the polylabel
command.
Polylabel takes one mandatory argument: valid GeoJSON, containing any 1 of:
FeatureCollection
containing Feature
s which are valid Polygon
s, MultiPolygon
s, or GeometryCollection
s containing same.Feature
containing a valid Polygon
, MultiPolygon
, or GeometryCollection
Geometry
which is a valid Polygon
, MultiPolygon
, or GeometryCollection
Any non-(Multi
)Polygon
content is ignored.
It also accepts an optional -t
or --tolerance
switch, allowing you to fine-tune the tolerance from the default 0.001
. Smaller tolerances take longer to calculate.
Irrespective of input, successful output is a GeoJSON FeatureCollection
. Its contents depend on the input geometry:
- Polygon
: The FeatureCollection
contains Point
Feature
s
- MultiPolygon
: The FeatureCollection
contains MultiPoint
Feature
s
- GeometryCollection
: The FeatureCollection
contains GeometryCollection
Feature
s whose geometries are Point
s or MultiPoint
s.
Output features retain the order of input features / geometries, and input feature properties are mapped to output features where they exist.
Input geometries are not validated. Results from invalid input geometries may be incorrect.
Polylabel is fast. Polygons are processed in parallel, using Rayon.
Will be available when I set up CI.