PolyUtils class
Polyline and polygon utilities (point-in-polygon, on-path/on-edge tests,
Douglas-Peucker simplification, and polyline encoding/decoding), ported from
the android-maps-utils PolyUtil class.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
containsLocationPoly(
Point< double> point, List<Point< polygon, {bool geodesic = false}) → booldouble> > -
Checks whether
pointis insidepolygonon the sphere. -
decode(
String encodedPath) → List< Point< double> > - Decodes an encoded path string into a sequence of points.
-
distanceToLine(
Point< double> p, Point<double> start, Point<double> end) → double -
Computes the distance on the sphere between the point
pand the line segment fromstarttoend. -
encode(
List< Point< path) → Stringdouble> > - Encodes a sequence of points into an encoded path string.
-
isClosedPolygon(
List< Point< poly) → booldouble> > -
Returns true if
polyis a closed polygon (i.e., the first and last points are the same). -
isLocationOnEdge(
Point< double> point, List<Point< polygon, bool geodesic) → booldouble> > - Same as isLocationOnEdgeTolerance with a default tolerance of 0.1 meters.
-
isLocationOnEdgeTolerance(
Point< double> point, List<Point< polygon, bool geodesic, double tolerance) → booldouble> > -
Computes whether the given
pointlies on or near the edge of apolygon, within a specifiedtolerancein meters. The polygon edge is composed of great circle segments ifgeodesicis true, and of Rhumb segments otherwise. The polygon edge is implicitly closed — the closing segment between the first point and the last point is included. -
isLocationOnPath(
Point< double> point, List<Point< polyline, bool geodesic) → booldouble> > - Same as isLocationOnPathTolerance with a default tolerance of 0.1 meters.
-
isLocationOnPathTolerance(
Point< double> point, List<Point< polyline, bool geodesic, double tolerance) → booldouble> > -
Computes whether the given
pointlies on or near apolyline, within a specifiedtolerancein meters. The polyline is composed of great circle segments ifgeodesicis true, and of Rhumb segments otherwise. The polyline is not closed — the closing segment between the first point and the last point is not included. -
locationIndexOnEdgeOrPath(
Point< double> point, List<Point< poly, bool closed, bool geodesic, double toleranceEarth) → intdouble> > -
Computes whether (and where) a given
pointlies on or near a polyline, within a specifiedtoleranceEarthin meters. -
locationIndexOnPath(
Point< double> point, List<Point< polyline, bool geodesic) → intdouble> > - Same as locationIndexOnPathTolerance with a default tolerance of 0.1 meters.
-
locationIndexOnPathTolerance(
Point< double> point, List<Point< poly, bool geodesic, double tolerance) → intdouble> > -
Computes whether (and where) a given
pointlies on or near a polyline, within a specifiedtolerancein meters. -
simplify(
List< Point< poly, double tolerance) → List<double> >Point< double> > -
Simplifies the given
poly(polyline or polygon) using the Douglas-Peucker decimation algorithm. Increasing thetolerancewill result in fewer points in the simplified polyline or polygon.