import type { LatLngLiteral } from '../../map/lat-lng'; export declare function containsLocation(point: LatLngLiteral, polygon: LatLngLiteral[], geodesic: boolean): boolean; /** * Computes whether the given point lies inside the specified polygon. * The polygon is always considered closed, regardless of whether the last point equals * the first or not. * Inside is defined as not containing the South Pole -- the South Pole is always outside. * The polygon is formed of great circle segments if geodesic is true, and of rhumb * (loxodromic) segments otherwise. */ export declare function containsLocationLatLng(latitude: number, longitude: number, polygon: LatLngLiteral[], geodesic: boolean): boolean; /** * 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. */ export declare function isLocationOnEdge(point: LatLngLiteral, polygon: LatLngLiteral[], geodesic?: boolean, tolerance?: number): boolean; /** * 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. */ export declare function isLocationOnPath(point: LatLngLiteral, polyline: LatLngLiteral[], geodesic?: boolean, tolerance?: number): boolean; /** * 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. * * @param point our needle * @param poly our haystack * @param geodesic the polyline is composed of great circle segments if geodesic * is true, and of Rhumb segments otherwise * @param tolerance tolerance (in meters) * @return -1 if point does not lie on or near the polyline. * 0 if point is between poly[0] and poly[1] (inclusive), * 1 if between poly[1] and poly[2], * ..., * poly.length-2 if between poly[poly.length - 2] and poly[poly.length - 1] */ export declare function locationIndexOnPath(point: LatLngLiteral, poly: LatLngLiteral[], geodesic: boolean, tolerance?: number): number; /** * 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. * * @param point our needle * @param poly our haystack * @param closed whether the polyline should be considered closed by a segment connecting the last point back to the first one * @param geodesic the polyline is composed of great circle segments if geodesic * is true, and of Rhumb segments otherwise * @param toleranceEarth tolerance (in meters) * @return -1 if point does not lie on or near the polyline. * 0 if point is between poly[0] and poly[1] (inclusive), * 1 if between poly[1] and poly[2], * ..., * poly.length-2 if between poly[poly.length - 2] and poly[poly.length - 1] */ export declare function locationIndexOnEdgeOrPath(point: LatLngLiteral, poly: LatLngLiteral[], closed: boolean, geodesic: boolean, toleranceEarth: number): number; /** * 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. * * When the providing a polygon as input, the first and last point of the list MUST have the * same latitude and longitude (i.e., the polygon must be closed). If the input polygon is not * closed, the resulting polygon may not be fully simplified. * * The time complexity of Douglas-Peucker is O(n^2), so take care that you do not call this * algorithm too frequently in your code. * * @param poly polyline or polygon to be simplified. Polygon should be closed (i.e., * first and last points should have the same latitude and longitude). * @param tolerance in meters. Increasing the tolerance will result in fewer points in the * simplified poly. * @return a simplified poly produced by the Douglas-Peucker algorithm */ export declare function simplify(poly: LatLngLiteral[], tolerance: number): LatLngLiteral[]; /** * 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 * * @param poly polyline or polygon * @return 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 */ export declare function isClosedPolygon(poly: LatLngLiteral[]): boolean; /** * Computes the distance on the sphere between the point p and the line segment start to end. * * @param p the point to be measured * @param start the beginning of the line segment * @param end the end of the line segment * @return the distance in meters (assuming spherical earth) */ export declare function distanceToLine(p: LatLngLiteral, start: LatLngLiteral, end: LatLngLiteral): number; /** * Decodes an encoded path string into a sequence of LatLngs. */ export declare function decode(encodedPath: string): LatLngLiteral[]; /** * Encodes a sequence of LatLngs into an encoded path string. */ export declare function encode(path: LatLngLiteral[]): string; //# sourceMappingURL=poly-util.d.ts.map