Polylabel_Cmd
…is the command-line version of Polylabel. Install it using cargo install polylabel_cmd.
This gives you the polylabel command.
Use
Polylabel takes one mandatory argument: a file containing valid GeoJSON, containing any 1 of:
- a
FeatureCollectioncontainingFeatures which are valid:Polygons orMultiPolygons orGeometryCollections containing either or both of the above, or
- a
Featurecontaining a valid:PolygonorMultiPolygonorGeometryCollectioncontaining either or both of the above.
- a
Geometrywhich is a validPolygonorMultiPolygonorGeometryCollectioncontaining either or both of the above.
- Processing of nested
GeometryCollections is supported, but you shouldn't be using those - Non-(
Multi)Polygongeometries are stripped from any output.
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.
A -p or --pretty flag may be set, which will pretty-print the GeoJSON output.
Irrespective of input, successful output is a GeoJSON FeatureCollection. Its contents depend on the input geometry:
Polygon: TheFeatureCollectioncontainsPointFeaturesMultiPolygon: TheFeatureCollectioncontainsMultiPointFeaturesGeometryCollection: TheFeatureCollectioncontainsGeometryCollectionFeatures whose collection members arePoints orMultiPoints.
Output features retain the order of input features / geometries, and input feature properties are mapped to output features where they exist.
Validity
Input geometries are not validated. Results from invalid input geometries may be incorrect.
Speed
Polylabel is fast. Polygons are processed in parallel, using Rayon.
Binaries
Will be available when I set up CI.