import type { FeatureCollection, GeoJsonProperties, Point, Geometry } from 'geojson'; import type { Bbox } from '@opengeoweb/webmap'; import type { DrawMode, SelectionType } from './types'; /** * Adds properties to the first geojson feature based on the given property object. * It only extends or changes the properties which are defined in styleConfig, * all other properties in the geojson are left unchanged. * @param geojson * @param featureProperties */ export declare const addFeatureProperties: (geojson: GeoJSON.FeatureCollection | undefined, featureProperties: GeoJSON.GeoJsonProperties, featureIndex?: number) => GeoJSON.FeatureCollection; /** * Matches OpenLayers' default `Draw.clickTolerance`. A pointer that moves * further than this between mousedown and mouseup is treated as a drag. */ export declare const POINTER_CLICK_TOLERANCE_PX = 6; /** * Returns true if a `click` event actually came from a drag — i.e. the pointer * moved further than the click tolerance between mousedown and mouseup (e.g. * the user pressed, panned the map, then released). * * Used to prevent panning the map mid-draw from accidentally closing the * polygon: the browser still fires a `click` after a drag, and without this * check it could trigger the close-on-near-start handler. */ export declare const isClickFromDrag: (event: MouseEvent, pointerDownPx: [number, number] | null) => boolean; /** * Checks if the geometry of the feature is empty as defined per GeoJSON spec. * According to the specification, an empty geometry is type 'Polygon' and coordinates * equal [[]]. Also GeoWeb uses empty linestring and poit geometries (coordinates []) * which are supported as well. * * @param feature Feature to test * @returns Whether `feature` is empty or not */ export declare const isGeoJSONGeometryEmpty: (feature: GeoJSON.Feature) => boolean; export declare const getGeoJSONPropertyValue: (property: string, properties: GeoJSON.GeoJsonProperties, polygonDrawMode: DrawMode | undefined, defaultProperties?: GeoJSON.GeoJsonProperties) => number | string; /** * moves geoJSON feature as new feature. Mutates newGeoJSON * @constructor * @param {GeoJSON.FeatureCollection} currentGeoJSON - current geoJSON * @param {GeoJSON.FeatureCollection} newGeoJSON - new geoJSON * @param {number} featureLayerIndex - feature layer index * @param {string} text - reason of change */ export declare const moveFeature: (currentGeoJSON: GeoJSON.FeatureCollection | undefined, newGeoJSON: GeoJSON.FeatureCollection, featureLayerIndex: number, reason: string, selectionType?: string) => number | undefined; /** * Returns the intersection of two point features. In case of a polygon, only the first feature is used. * @param intersectA Feature A * @param intersectB Feature B * @returns The intersection of the two features. */ export declare const intersectPointGeoJSONS: (intersectA: GeoJSON.FeatureCollection, intersectB: GeoJSON.FeatureCollection, geoJSONProperties?: { stroke: string; 'stroke-width': number; 'stroke-opacity': number; fill: string; 'fill-opacity': number; }) => GeoJSON.FeatureCollection; /** * Returns the intersection of two (multi) polygon features. In case of a polygon, only the first feature is used. * @param intersectA Feature A * @param intersectB Feature B * @returns The intersection of the two features. */ export declare function intersectPolygonGeoJSONS(intersectA: FeatureCollection, // drawn polygon (WGS84) intersectB: FeatureCollection, // FIR polygon (WGS84) geoJSONProperties?: GeoJsonProperties, projectionCode?: string): FeatureCollection; export declare const isPointFeatureCollection: (geojson: GeoJSON.FeatureCollection) => geojson is GeoJSON.FeatureCollection; /** * Adds the intersectionStart and intersectionEnd properties to the GeoJSONS structure * @param geoJSONs * @returns GeoJSONS extend with intersections */ export declare const createInterSections: (geojson: GeoJSON.FeatureCollection, otherGeoJSON: GeoJSON.FeatureCollection, geoJSONproperties?: GeoJSON.GeoJsonProperties, proj?: string) => GeoJSON.FeatureCollection; export declare const getGeoJson: (geojson: GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean) => GeoJSON.FeatureCollection; export declare const getLastEmptyFeatureIndex: (geoJSONFeatureCollection: GeoJSON.FeatureCollection) => number | undefined; export declare const getFeatureCollection: (geoJSONFeature: GeoJSON.Feature | GeoJSON.FeatureCollection, shouldAllowMultipleShapes: boolean, geoJSONFeatureCollection?: GeoJSON.FeatureCollection) => GeoJSON.FeatureCollection; export declare const isGeoJSONFeatureCreatedByTool: (existingJSON: GeoJSON.FeatureCollection, selectionType: SelectionType, featureLayerIndex?: number) => boolean; export declare const rewindGeometry: (geoJSON: FeatureCollection) => FeatureCollection; export declare const addGeoJSONProperties: (geoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection, newProperties: GeoJsonProperties) => GeoJSON.Feature | GeoJSON.FeatureCollection; export declare const addSelectionTypeToGeoJSON: (geoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection, selectionType: SelectionType) => GeoJSON.Feature | GeoJSON.FeatureCollection; export declare const getFeatureExtent: (geoJSON: GeoJSON.Feature | GeoJSON.FeatureCollection) => Bbox; export declare const getDrawModeIdFromSelectionType: (selectionType: string, drawModes: DrawMode[]) => string;