/** * Geometry utilities for spatial queries. * * @module core/spatial/geometry */ import type { Point, BBox, RadiusQuery, ValidationResult } from './types.js'; /** * Calculate the haversine distance between two points. * * @param p1 - First point * @param p2 - Second point * @returns Distance in kilometres */ export declare function haversineDistance(p1: Point, p2: Point): number; /** * Convert a point+radius query to a bounding box. * * Uses a simple approximation that works well for small radii (<500km). * For larger radii, the approximation becomes less accurate at high latitudes. * * @param query - Point and radius * @returns Bounding box containing the circle */ export declare function radiusToBBox(query: RadiusQuery): BBox; /** * Convert a bounding box to a string format "minLon,minLat,maxLon,maxLat". * * @param bbox - Bounding box * @returns String representation */ export declare function bboxToString(bbox: BBox): string; /** * Parse a bounding box string "minLon,minLat,maxLon,maxLat". * * @param str - Bounding box string * @returns Parsed bounding box or null if invalid */ export declare function parseBBox(str: string): BBox | null; /** * Validate a point's coordinates. * * @param lat - Latitude * @param lon - Longitude * @returns Validation result */ export declare function validatePoint(lat: number, lon: number): ValidationResult; /** * Validate a radius value. * * @param radiusKm - Radius in kilometres * @returns Validation result */ export declare function validateRadius(radiusKm: number): ValidationResult; /** * Validate a complete radius query. * * @param query - Radius query to validate * @returns Validation result */ export declare function validateRadiusQuery(query: RadiusQuery): ValidationResult; /** * Convert WGS84 coordinates to Web Mercator (EPSG:3857). * * Used for ArcGIS API calls (e.g., GA HAP). * * @param point - WGS84 point * @returns Web Mercator coordinates [x, y] */ export declare function toWebMercator(point: Point): [number, number]; /** * Convert Web Mercator (EPSG:3857) to WGS84. * * @param x - Web Mercator x coordinate * @param y - Web Mercator y coordinate * @returns WGS84 point */ export declare function fromWebMercator(x: number, y: number): Point; /** * Convert a bounding box to Web Mercator envelope. * * @param bbox - WGS84 bounding box * @returns Web Mercator envelope { xmin, ymin, xmax, ymax } */ export declare function bboxToWebMercator(bbox: BBox): { xmin: number; ymin: number; xmax: number; ymax: number; }; /** * Check if a point is within a bounding box. * * @param point - Point to check * @param bbox - Bounding box * @returns True if point is inside bbox */ export declare function isPointInBBox(point: Point, bbox: BBox): boolean; /** * Check if a point is within a radius of another point. * * @param point - Point to check * @param centre - Centre point * @param radiusKm - Radius in kilometres * @returns True if point is within radius */ export declare function isPointInRadius(point: Point, centre: Point, radiusKm: number): boolean; //# sourceMappingURL=geometry.d.ts.map