PolyUtils 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<num> point, List<Point<num>> polygon) bool
Checks if point is inside polygon
decode(String encodedPath) List<Point<num>>
Decodes an encoded path string into a sequence of LatLngs.
distanceToLine(Point<num> p, Point<num> start, Point<num> end) num
Computes the distance on the sphere between the point p and the line segment start to end.
encode(List<Point<num>> path) String
Encodes a sequence of LatLngs into an encoded path string.
isClosedPolygon(List<Point<num>> poly) bool
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<num> point, List<Point<num>> polygon, bool geodesic) bool
Same as {@link #isLocationOnEdge(Point, List, bool, num)} with a default tolerance of 0.1 meters.
isLocationOnEdgeTolerance(Point<num> point, List<Point<num>> polygon, bool geodesic, num tolerance) bool
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<num> point, List<Point<num>> polyline, bool geodesic) bool
Same as {@link #isLocationOnPath(Point, List, bool, num)}
isLocationOnPathTolerance(Point<num> point, List<Point<num>> polyline, bool geodesic, num tolerance) bool
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<num> point, List<Point<num>> poly, bool closed, bool geodesic, num toleranceEarth) int
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<num> point, List<Point<num>> polyline, bool geodesic) int
Same as {@link #locationIndexOnPath(Point, List, bool, num)}
locationIndexOnPathTolerance(Point<num> point, List<Point<num>> poly, bool geodesic, num tolerance) int
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<num>> poly, num tolerance) List<Point<num>>
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.