the editable site (validation-lab)
This commit is contained in:
commit
3ac81d5a52
13454 files changed
+2227005
No files matched your search
+2
@@ -0,0 +1,2 @@
|
||||
/** Preserve large arcs, reversing only when the sweep crosses back through zero. */
|
||||
export declare function getUpdatedArcDirection(direction: "clockwise" | "anticlockwise", startBearing: number, previousEndBearing: number, endBearing: number): "clockwise" | "anticlockwise";
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function validLatitude(lat: number): boolean;
|
||||
export declare function validLongitude(lng: number): boolean;
|
||||
export declare function coordinatePrecisionIsValid(coordinate: Position, coordinatePrecision: number): boolean;
|
||||
export declare function coordinateIsValid(coordinate: unknown[]): boolean;
|
||||
export declare function getDecimalPlaces(value: number): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function pointInPolygon(point: Position, rings: Position[][]): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import { Polygon } from "geojson";
|
||||
/**
|
||||
* Checks if a GeoJSON Polygon follows the right-hand rule.
|
||||
* @param polygon - The GeoJSON Polygon to check.
|
||||
* @returns {boolean} - True if the polygon follows the right-hand rule (counterclockwise outer ring), otherwise false.
|
||||
*/
|
||||
export declare function followsRightHandRule(polygon: Polygon): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Feature, LineString, Polygon } from "geojson";
|
||||
export declare function selfIntersects(feature: Feature<Polygon> | Feature<LineString>): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { CartesianPoint } from "../common";
|
||||
/**
|
||||
* Calculate the relative angle between two lines
|
||||
* @param A The first point of the first line
|
||||
* @param B The second point of the first line and the first point of the second line
|
||||
* @param C The second point of the second line
|
||||
* @returns The relative angle between the two lines
|
||||
*/
|
||||
export declare function calculateRelativeAngle(A: CartesianPoint, B: CartesianPoint, C: CartesianPoint): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Feature, LineString, Polygon, Position } from "geojson";
|
||||
export declare function centroid(geojson: Feature<Polygon | LineString>): Position;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { CartesianPoint } from "../common";
|
||||
export declare function isClockwiseWebMercator(center: CartesianPoint, secondCoord: CartesianPoint, thirdCoord: CartesianPoint): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function coordinatesIdentical(coordinate: Position, coordinateTwo: Position): boolean;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { CartesianPoint } from "../common";
|
||||
export declare function determineHalfPlane(point: CartesianPoint, lineStart: CartesianPoint, lineEnd: CartesianPoint): string;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Polygon } from "geojson";
|
||||
export declare function ensureRightHandRule(polygon: Polygon): undefined | Polygon;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function isPolygonArray(coords: Position[] | Position[][]): coords is Position[][];
|
||||
export declare const getUnclosedCoordinates: (featureCoordinates: Position[] | Position[][]) => Position[];
|
||||
export declare const getClosedCoordinates: (featureCoordinates: Position[] | Position[][]) => Position[];
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { Position } from "geojson";
|
||||
import { Project, Projection, Unproject } from "../common";
|
||||
export declare function getMidPointCoordinates({ featureCoords, precision, unproject, project, projection, }: {
|
||||
featureCoords: Position[];
|
||||
precision: number;
|
||||
project: Project;
|
||||
unproject: Unproject;
|
||||
projection: Projection;
|
||||
}): Position[];
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
export declare const earthRadius = 6371008.8;
|
||||
export declare function degreesToRadians(degrees: number): number;
|
||||
export declare function lengthToRadians(distance: number): number;
|
||||
export declare function radiansToDegrees(radians: number): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export declare function limitPrecision(num: number, decimalLimit?: number): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Polygon } from "geojson";
|
||||
export declare function polygonAreaSquareMeters(polygon: Polygon): number;
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
import { Position } from "geojson";
|
||||
import { CartesianPoint } from "../../common";
|
||||
export declare function bearing(start: Position, end: Position): number;
|
||||
export declare function webMercatorBearing({ x: x1, y: y1 }: CartesianPoint, { x: x2, y: y2 }: CartesianPoint): number;
|
||||
export declare function normalizeBearing(bearing: number): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { Position } from "geojson";
|
||||
import { CartesianPoint } from "../../common";
|
||||
export declare function destination(origin: Position, distance: number, bearing: number): Position;
|
||||
export declare function webMercatorDestination({ x, y }: CartesianPoint, distance: number, bearing: number): CartesianPoint;
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function haversineDistanceKilometers(pointOne: Position, pointTwo: Position): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { CartesianPoint } from "../../common";
|
||||
export declare const pixelDistanceToLine: (point: CartesianPoint, linePointOne: CartesianPoint, linePointTwo: CartesianPoint) => number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { CartesianPoint } from "../../common";
|
||||
export declare const cartesianDistance: (pointOne: CartesianPoint, pointTwo: CartesianPoint) => number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function rhumbBearing(start: Position, end: Position): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function rhumbDestination(origin: Position, distanceMeters: number, bearing: number): Position;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function rhumbDistance(destination: Position, origin: Position): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { LineString, Position } from "geojson";
|
||||
export declare function lineSliceAlong(coords: LineString["coordinates"], startDist: number, stopDist: number): Position[];
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
import { Position } from "geojson";
|
||||
import { Project, Unproject } from "../common";
|
||||
export declare function midpointCoordinate(coordinates1: Position, coordinates2: Position, precision: number, project: Project, unproject: Unproject): number[];
|
||||
export declare function geodesicMidpointCoordinate(coordinates1: Position, coordinates2: Position, precision: number): number[];
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function nearestPointOnLine(inputCoordinate: Position, lines: [Position, Position][]): {
|
||||
coordinate: Position;
|
||||
distance: number;
|
||||
lineIndex: number;
|
||||
} | undefined;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
import { CartesianPoint } from "../../common";
|
||||
/**
|
||||
* Convert longitude and latitude to web mercator x and y
|
||||
* @param lng
|
||||
* @param lat
|
||||
* @returns - web mercator x and y
|
||||
*/
|
||||
export declare const lngLatToWebMercatorXY: (lng: number, lat: number) => CartesianPoint;
|
||||
/**
|
||||
* Convert web mercator x and y to longitude and latitude
|
||||
* @param x - web mercator x
|
||||
* @param y - web mercator y
|
||||
* @returns - longitude and latitude
|
||||
*/
|
||||
export declare const webMercatorXYToLngLat: (x: number, y: number) => {
|
||||
lng: number;
|
||||
lat: number;
|
||||
};
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
import { Feature, Polygon } from "geojson";
|
||||
import { Unproject } from "../../common";
|
||||
export declare function createBBoxFromPoint({ unproject, point, pointerDistance, }: {
|
||||
point: {
|
||||
x: number;
|
||||
y: number;
|
||||
};
|
||||
unproject: Unproject;
|
||||
pointerDistance: number;
|
||||
}): Feature<Polygon>;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import { Feature, Polygon, Position } from "geojson";
|
||||
export declare function circle(options: {
|
||||
center: Position;
|
||||
radiusKilometers: number;
|
||||
coordinatePrecision: number;
|
||||
steps?: number;
|
||||
}): Feature<Polygon>;
|
||||
export declare function circleWebMercator(options: {
|
||||
center: Position;
|
||||
radiusKilometers: number;
|
||||
coordinatePrecision: number;
|
||||
steps?: number;
|
||||
}): GeoJSON.Feature<GeoJSON.Polygon>;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { Feature, Polygon, Position } from "geojson";
|
||||
export declare function ellipse(options: {
|
||||
center: Position;
|
||||
xRadiusKilometers: number;
|
||||
yRadiusKilometers: number;
|
||||
coordinatePrecision: number;
|
||||
steps?: number;
|
||||
}): Feature<Polygon>;
|
||||
export declare function ellipseWebMercator(options: {
|
||||
center: Position;
|
||||
xRadiusKilometers: number;
|
||||
yRadiusKilometers: number;
|
||||
coordinatePrecision: number;
|
||||
steps?: number;
|
||||
}): Feature<Polygon>;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function generateGreatCircleCoordinates(start: Position, end: Position, numberOfPoints: number): Position[];
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function calculateWebMercatorDistortion(source: Position, target: Position): number;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { Feature, LineString, Polygon } from "geojson";
|
||||
export declare function transformRotate(feature: Feature<Polygon | LineString>, angle: number): Feature<Polygon | LineString, import("geojson").GeoJsonProperties>;
|
||||
/**
|
||||
* Rotate a GeoJSON Polygon geometry in web mercator
|
||||
* @param polygon - GeoJSON Polygon geometry
|
||||
* @param angle - rotation angle in degrees
|
||||
* @returns - rotated GeoJSON Polygon geometry
|
||||
*/
|
||||
export declare const transformRotateWebMercator: (feature: Feature<Polygon> | Feature<LineString>, angle: number) => Feature<Polygon, import("geojson").GeoJsonProperties> | Feature<LineString, import("geojson").GeoJsonProperties>;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
import { Position } from "geojson";
|
||||
export declare function transformScaleWebMercatorCoordinates({ coordinates, originX, originY, xScale, yScale, }: {
|
||||
coordinates: Position[];
|
||||
originX: number;
|
||||
originY: number;
|
||||
xScale: number;
|
||||
yScale: number;
|
||||
}): void;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
import { Feature, LineString, Polygon } from "geojson";
|
||||
import { CartesianPoint } from "../common";
|
||||
/**
|
||||
* Calculates the centroid of a GeoJSON Polygon or LineString in Web Mercator
|
||||
|
||||
* @param {Feature<Polygon | LineString>} feature - The GeoJSON Feature containing either a Polygon or LineString
|
||||
* @returns {{ x: number, y: number }} The centroid of the polygon or line string in Web Mercator coordinates.
|
||||
*/
|
||||
export declare function webMercatorCentroid(feature: Feature<Polygon | LineString>): CartesianPoint;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import { Position } from "geojson";
|
||||
/**
|
||||
* Takes two points and finds the closest point on the line between them to a third point.
|
||||
* @param lines
|
||||
* @param inputCoordinate
|
||||
* @returns
|
||||
*/
|
||||
export declare function webMercatorNearestPointOnLine(inputCoordinate: Position, lines: [Position, Position][]): {
|
||||
coordinate: Position;
|
||||
lineIndex: number;
|
||||
distance: number;
|
||||
} | undefined;
|
||||
+1
@@ -0,0 +1 @@
|
||||
export {};
|
||||
Reference in new issue
Block a user