polylabel

Function polylabel 

Source
pub fn polylabel<P: GetXY, R: NewXYM<PolyLabelMetadata>>(
    polygon: &Vec<Vec<P>>,
    precision: Option<f64>,
) -> R
Expand description

§Polylabel

§Description

Find the label for a vector polygon

§Usage

use gistools::tools::{PolyLabelMetadata, polylabel};
use s2json::VectorPoint;

let data: Vec<Vec<VectorPoint<()>>> = vec![vec![]];
let emp: VectorPoint<PolyLabelMetadata> = polylabel(&data, None);

assert_eq!(emp, VectorPoint::new_xy(0., 0., Some(PolyLabelMetadata::new(0.))));

§Parameters

  • polygon: the vector polygon to find the label for
  • precision: the precision of the label

§Returns

The label position and the distance to the label