/**
 * Spatial/Geo Utilities for PostGIS with Drizzle ORM
 *
 * Provides helper functions for working with PostGIS geometry and geography types.
 * All functions return Drizzle SQL template literals for use in queries.
 *
 * Requires PostGIS extension to be enabled in PostgreSQL.
 */
import { SQL } from 'drizzle-orm';
import type { GeoJSONPoint, GeoJSONGeometry } from '../types/index.js';
export type { GeoJSONPoint, GeoJSONGeometry };
/**
 * Spatial utilities object
 */
declare const spatialUtils: {
    /**
     * Convert longitude/latitude to PostGIS Point geometry
     * @param longitude - Longitude coordinate
     * @param latitude - Latitude coordinate
     * @param srid - Spatial Reference System ID (default: 4326 for WGS84)
     * @returns SQL for creating a Point geometry
     *
     * @example
     * ```typescript
     * const point = spatialUtils.pointToGeometry(-122.4194, 37.7749); // San Francisco
     * await db.insert(locations).values({
     *   name: 'San Francisco',
     *   location: point
     * });
     * ```
     */
    pointToGeometry(longitude: number, latitude: number, srid?: number): SQL;
    /**
     * Convert GeoJSON object to PostGIS geometry
     * @param geoJSON - GeoJSON object
     * @returns SQL for creating geometry from GeoJSON
     *
     * @example
     * ```typescript
     * const geom = spatialUtils.geoJSONToGeometry({
     *   type: 'Point',
     *   coordinates: [-122.4194, 37.7749]
     * });
     * ```
     */
    geoJSONToGeometry(geoJSON: GeoJSONGeometry): SQL;
    /**
     * Calculate distance between two geometries
     * @param geom1 - First geometry (column name or SQL)
     * @param geom2 - Second geometry (column name or SQL)
     * @param useGeography - Use geography for accurate earth-surface distance
     * @returns SQL for distance calculation
     *
     * @example
     * ```typescript
     * const dist = spatialUtils.distance('location', anotherPoint, true);
     * const results = await db.select({ distance: dist }).from(locations);
     * ```
     */
    distance(geom1: string | SQL, geom2: string | SQL, useGeography?: boolean): SQL;
    /**
     * Check if two geometries are within a specified distance
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @param distance - Distance threshold in meters (for geography) or units (for geometry)
     * @param useGeography - Use geography for earth-surface distance
     * @returns SQL for distance check
     *
     * @example
     * ```typescript
     * const nearby = spatialUtils.dwithin('location', myPoint, 1000, true); // Within 1km
     * const results = await db.select().from(locations).where(nearby);
     * ```
     */
    dwithin(geom1: string | SQL, geom2: string | SQL, distance: number, useGeography?: boolean): SQL;
    /**
     * Check if first geometry is within second geometry
     * @param geom1 - Geometry to test
     * @param geom2 - Container geometry
     * @returns SQL for within check
     */
    within(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Check if first geometry contains second geometry
     * @param geom1 - Container geometry
     * @param geom2 - Geometry to test
     * @returns SQL for contains check
     */
    contains(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Check if two geometries intersect
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @returns SQL for intersects check
     */
    intersects(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Create buffer around geometry
     * @param geom - Geometry to buffer
     * @param distance - Buffer distance
     * @param useGeography - Use geography for earth-surface buffering
     * @returns SQL for buffer operation
     *
     * @example
     * ```typescript
     * const buffered = spatialUtils.buffer('location', 500, true); // 500m buffer
     * ```
     */
    buffer(geom: string | SQL, distance: number, useGeography?: boolean): SQL;
    /**
     * Calculate area of geometry
     * @param geom - Geometry
     * @param useGeography - Use geography for accurate earth-surface area
     * @returns SQL for area calculation
     */
    area(geom: string | SQL, useGeography?: boolean): SQL;
    /**
     * Get centroid of geometry
     * @param geom - Geometry
     * @returns SQL for centroid calculation
     */
    centroid(geom: string | SQL): SQL;
    /**
     * Convert geometry to GeoJSON
     * @param geom - Geometry
     * @returns SQL for GeoJSON conversion
     */
    asGeoJSON(geom: string | SQL): SQL;
    /**
     * Union of two geometries
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @returns SQL for union operation
     */
    union(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Difference between two geometries
     * @param geom1 - First geometry
     * @param geom2 - Geometry to subtract
     * @returns SQL for difference operation
     */
    difference(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Symmetric difference between two geometries
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @returns SQL for symmetric difference operation
     */
    symDifference(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Convex hull of geometry
     * @param geom - Geometry
     * @returns SQL for convex hull
     */
    convexHull(geom: string | SQL): SQL;
    /**
     * Transform geometry to different spatial reference system
     * @param geom - Geometry
     * @param toSRID - Target SRID
     * @returns SQL for transform operation
     */
    transform(geom: string | SQL, toSRID: number): SQL;
    /**
     * Find closest point on first geometry to second geometry
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @returns SQL for closest point
     */
    closestPoint(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Longest line between two geometries
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @returns SQL for longest line
     */
    longestLine(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Shortest line between two geometries
     * @param geom1 - First geometry
     * @param geom2 - Second geometry
     * @returns SQL for shortest line
     */
    shortestLine(geom1: string | SQL, geom2: string | SQL): SQL;
    /**
     * Azimuth (angle) between two points
     * @param point1 - First point
     * @param point2 - Second point
     * @returns SQL for azimuth in radians
     */
    azimuth(point1: string | SQL, point2: string | SQL): SQL;
    /**
     * Check if geometry is valid
     * @param geom - Geometry
     * @returns SQL for validity check
     */
    isValid(geom: string | SQL): SQL;
    /**
     * Attempt to make invalid geometry valid
     * @param geom - Geometry
     * @returns SQL for making geometry valid
     */
    makeValid(geom: string | SQL): SQL;
    /**
     * Simplify geometry
     * @param geom - Geometry
     * @param tolerance - Simplification tolerance
     * @returns SQL for simplification
     */
    simplify(geom: string | SQL, tolerance: number): SQL;
    /**
     * Get bounding box of geometry
     * @param geom - Geometry
     * @returns SQL for bounding box (returns geometry)
     */
    envelope(geom: string | SQL): SQL;
    /**
     * Get X coordinate of point
     * @param point - Point geometry
     * @returns SQL for X coordinate
     */
    x(point: string | SQL): SQL;
    /**
     * Get Y coordinate of point
     * @param point - Point geometry
     * @returns SQL for Y coordinate
     */
    y(point: string | SQL): SQL;
    /**
     * Get length of linestring or multi-linestring
     * @param geom - Geometry
     * @param useGeography - Use geography for earth-surface length
     * @returns SQL for length calculation
     */
    length(geom: string | SQL, useGeography?: boolean): SQL;
    /**
     * Get perimeter of polygon
     * @param geom - Polygon geometry
     * @param useGeography - Use geography for earth-surface perimeter
     * @returns SQL for perimeter calculation
     */
    perimeter(geom: string | SQL, useGeography?: boolean): SQL;
};
export default spatialUtils;
//# sourceMappingURL=spatialUtils.d.ts.map