pub struct Polygon {
    pub(crate) rings: Vec<Ring>,
    pub(crate) tessellation: Option<Tessellation>,
}

Fields

rings: Vec<Ring>tessellation: Option<Tessellation>

Implementations

Does this polygon contain the point in its interior?

Transformations must preserve Rings.

When factor is small, this may collapse Rings and thus fail.

When factor is known to be over 1, then scaling can’t fail.

Returns the arithmetic mean of the outer ring’s points. The result could wind up inside a hole in the polygon. Consider using polylabel too.

Top-left at the origin. Doesn’t take Distance, because this is usually pixels, actually.

Top-left at the origin. Doesn’t take Distance, because this is usually pixels, actually. Note this will panic if width or height is 0.

Top-left at the origin. Doesn’t take Distance, because this is usually pixels, actually.

A rectangle, two sides of which are fully rounded half-circles.

Top-left at the origin. Doesn’t take Distance, because this is usually pixels, actually. If it’s not possible to apply the specified radius, fallback to a regular rectangle.

Union all of the polygons into one geo::MultiPolygon

Find the “pole of inaccessibility” – the most distant internal point from the polygon outline

Do two polygons intersect at all?

Does this polygon intersect a polyline?

Creates the outline around the polygon (both the exterior and holes), with the thickness half straddling the polygon and half of it just outside.

Returns a Tessellation that may union together the outline from the exterior and multiple holes. Callers that need a Polygon must call to_outline on the individual Rings.

Usually m^2, unless the polygon is in screen-space

Doesn’t handle multiple crossings in and out.

Optionally map the world-space points back to GPS.

Extracts all polygons from raw bytes representing a GeoJSON file, along with the string key/value properties. Only the first polygon from multipolygons is returned. If require_in_bounds is set, then the polygon must completely fit within the gps_bounds.

If simplification fails, just keep the original polygon

An arbitrary placeholder value, when Option types aren’t worthwhile

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more
The type returned in the event of a conversion error.
Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.