UNPKG

geo-intersection-util

Version:

Point of intersection defined by its offset from the centerline and distance along the centerline

35 lines (34 loc) 1.51 kB
export interface LatLng { lat: number; lng: number; } export interface Cartesian { x: number; y: number; } interface IntersectionResult { intersectionLatLng: LatLng; distance: number; side: 'left' | 'right' | 'center' | null; } export declare class Intersection { constructor(); getInterSection(pathString: string, shotLatLngStr: string, // changed from LatLng to string greenCenter: string): IntersectionResult | undefined; calculateBearing(lat1: number, lng1: number, lat2: number, lng2: number): number; extendLatLng(lat: number, lng: number, distance: number, bearing: number): LatLng; getPoint(pointString: string, extensionDistance: number): LatLng[]; determineSideOnCurvedCenterline(centerlinePoints: LatLng[], point: LatLng): 'left' | 'right' | 'center' | string; euclideanDistance(p1: Cartesian, p2: Cartesian): number; latLngToCartesian(lat: number, lng: number): Cartesian; getDistance(p1: LatLng, p2: LatLng): number; distance(p1: Cartesian, p2: Cartesian): number; findPerpendicularIntersection(p: Cartesian, p1: Cartesian, p2: Cartesian): Cartesian | null; cartesianToLatLng(p: Cartesian): LatLng; findIntersectionPoint(point: LatLng, centerLine: LatLng[]): LatLng | null; getLatLngFromPointsStr(pointsStr: string): LatLng[]; parseCoordinate(coordinate: string): Cartesian; orientCenterLine(centerLine: string, greenCenter: string): string; parseLatLng(coordStr: string): LatLng; } export {};