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 LatLngs.
-
distanceToLine(
Point< double> p, Point<double> start, Point<double> end) → double - Computes the distance on the sphere between the point p and the line segment start to end.
-
encode(
List< Point< path) → Stringdouble> > - Encodes a sequence of LatLngs into an encoded path string.
-
isClosedPolygon(
List< Point< poly) → booldouble> > - Returns true if the provided list of points is a closed polygon (i.e., the first and last points are the same), and false if it is not
-
isLocationOnEdge(
Point< double> point, List<Point< polygon, bool geodesic) → booldouble> > - Same as isLocationOnEdge with a default tolerance of 0.1 meters.
-
isLocationOnEdgeTolerance(
Point< double> point, List<Point< polygon, bool geodesic, double tolerance) → booldouble> > - Computes whether the given point lies on or near the edge of a polygon, within a specified tolerance in meters. The polygon edge is composed of great circle segments if geodesic is 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 isLocationOnPath
-
isLocationOnPathTolerance(
Point< double> point, List<Point< polyline, bool geodesic, double tolerance) → booldouble> > - Computes whether the given point lies on or near a polyline, within a specified tolerance in meters. The polyline is composed of great circle segments if geodesic is 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 point lies on or near a polyline, within a specified tolerance. If closed, the closing segment between the last and first points of the polyline is not considered.
-
locationIndexOnPath(
Point< double> point, List<Point< polyline, bool geodesic) → intdouble> > - Same as locationIndexOnPath
-
locationIndexOnPathTolerance(
Point< double> point, List<Point< poly, bool geodesic, double tolerance) → intdouble> > - Computes whether (and where) a given point lies on or near a polyline, within a specified tolerance. The polyline is not closed -- the closing segment between the first point and the last point is not included.
-
simplify(
List< Point< poly, double tolerance) → List<double> >Point< double> > - Simplifies the given poly (polyline or polygon) using the Douglas-Peucker decimation algorithm. Increasing the tolerance will result in fewer points in the simplified polyline or polygon.