import * as turf from "@turf/turf"; import { Feature } from "ol"; import { Geometry } from "ol/geom"; import * as olExtent from "ol/extent"; import { GraphicLayer } from "src/Layer"; export declare class SpatialAnalysis { static clone(ff: any): Feature; /** * : 创建给定半径和中心点的圆的一个扇形,位于(顺时针)bearing1和bearing2之间;0方位为中心点以北,顺时针正。 * @param {Feature} center 中心点 * @param {number} radius 圆的半径,单位km * @param {number} antBearing 扇区第一个半径的角度,以十进制为单位 * @param {number} rotation 扇形第二半径的角度,以十进制度数表示 * @returns {Feature } */ static sector(center: any, radius: any, antBearing: any, rotation: any): Feature; /** * : 获取一个参考点和一个具有点几何特征的FeatureCollection,并从FeatureCollection最接近的参考点返回点。这个计算是测地线的。 * @param {Feature} targetPoint * @param {Array>} points * @returns {Feature } Point */ static nearestPoint(targetPoint: Feature, points: Array>): Feature; /** * : 获取一条直线应用 贝塞尔算法 (opens new window)返回一个贝塞尔曲线。 * @param {Feature} line * @param {object} options * @param {number} options.resolution 点之间的时间(毫秒)默认值 10000 * @param {number} options.sharpness 样条曲线之间的路径弯曲度的度量 默认值 0.85 * @returns {Feature } lineData */ static bezierSpline(line: Feature | turf.helpers.LineString, options: { resolution: 10000; sharpness: 0.85; }): Feature; /** * : 获取一个点和一个多边形或多个多边形,并确定该点是否位于该多边形内部。多边形可以是凸的,也可以是凹的。 * @param {Feature[]} point * @param {Feature} poly * @returns {Feature []} */ static pointsWithinPolygon(point: Feature[], poly: Feature | any): Feature[]; /** * : 获取一条线并返回具有指定距离偏移量的线。。 * @param {Feature} line * @param {unitsNum} unitsNum 偏移线的距离 米(可以为负值) * @returns {Feature } lineData */ static lineOffset(line: Feature, unitsNum?: number): Feature; /** * : 获取一个点和一个LineString,并计算(多)LineString上最近的点。 * @param { Feature} point * @param { Feature} line * @returns {*} */ static nearestPointOnLine(point: Feature, line: Feature): Feature; /** * : 获取一个点和一个LineString,并计算(多)LineString上最近的点。 * @param { Feature} point * @param { Feature} line * @returns {*} */ static nearestPointOnLines(point: any, line: any): Feature; /** * : 比较相同维度的两个几何图形,如果它们的交集集产生的几何图形与两个几何图形不同,但维度相同,则返回true * @param {Feature} f1 * @param {Feature} f2 * @returns {*} */ static booleanOverlap(f1: Feature, f2: Feature): boolean; /** * : 获取一个点和一个多边形或多个多边形,并确定该点是否位于该多边形内部。多边形可以是凸的,也可以是凹的。 * @param {Feature} f1 * @param {Feature} f2 * @returns {*} */ static booleanPointInPolygon(f1: Feature, f2: Feature): boolean; /** * : 缓冲区分析 * @param {Feature} feature * @param {number}[distance=5] distance 缓冲距离,单位米 * @returns {Feature} */ static buffer(feature: any, distance?: number): Feature; /** * : 通过从第一个多边形剪裁第二个多边形来查找两个多边形之间的差异。 * @param {Feature} feature1 * @param {Feature } feature2 * @returns {Feature } feature */ static difference(feature1: Feature, feature2: Feature): Feature; /** * : 取两个多边形并找到它们的交点。如果它们共享一个边界,返回边界;如果它们不相交,返回undefined。。 * @param {Feature} feature1 * @param {Feature } feature2 * @returns {Feature } feature */ static intersect(feature1: Feature, feature2: Feature): Feature; /** * 包含,feature包含featureList中的要素 * @param {*} feature 范围 * @param {*} featureList 查询的数据列表 * @returns {*} 包含的featureList */ static booleanContains(feature: any, featureList: Feature[] | any): any[]; /** * : 创建泰森多边形 * @param {string} type 范围pointToPolygonType.voronoi tin convex * @param {Array>} featureList 参与运算的点数据数组 * @param {string} strokecolor 可选 边框色 * @param {string} fillcolor 可选 填充色 * @returns {*} 包含的featureList */ static createPolygon(type: string, featureList: Array>, strokecolor?: string, fillcolor?: string): any[]; /** * : 创建多边形网格 * @param {string} type 范围datagridType.point hex square triangle * @param {*} option { box: [0, 0, 0, 0], cellSide: 50 } box 生成四角范围【minLng,minLat,maxLng,maxLat】 cellSide m单位 默认50 * @returns {*} 要素数组 */ static createGrid(type: any, option?: { box: number[]; cellSide: number; }): any[]; /** * :等值面 * @param {any} points 点数据数组 FeatureCollection * @param {number[]} breaks 级别数组 示例 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; * @param {string} zProperty 分组属性字段名 * @returns {*} 要素数组 */ static isobands(points: any, breaks: any, zProperty: any): Feature[]; /** * 采用带有z值的点特征的网格FeatureCollection和一组断点值并生成等值线。 * @param {any} points 点数据数组 FeatureCollection * @param {number[]} breaks 级别数组 示例 [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; * @param {string} zProperty 分组属性字段名 * @returns {*} 要素数组 */ static isolines(points: any, breaks: any, zProperty: any): Feature[]; /** * 随机面,随机节点数 最小3最大10 * @param {any} box 生成四角范围【minLng,minLat,maxLng,maxLat】 * @param {number} maxRadialLength 顶点可以到达多边形中心以外的纬度或经度的最大十进制度数。默认0.0111 * @param {number} maxNum 最大数量 * @returns {*} 要素数组 */ static randomPolygons(box: any, maxRadialLength?: number, maxNum?: number): any[]; /** * : 随机线,随机节点数 最小3最大10 * @param {any} box 生成四角范围【minLng,minLat,maxLng,maxLat】 * @param {number} maxlength 是顶点可以与其前一个顶点相距的最大小数度数。默认0.0111 * @param {number} maxNum 最大数量 * @returns {*} 要素数组 */ static randomPolylines(box: any, maxlength?: number, maxNum?: number): any[]; /** * : 随机点,随机节点数 最小3最大10 * @param {any} box 生成四角范围【minLng,minLat,maxLng,maxLat】 * @param {number} maxNum 最大数量 * @returns {*} 要素数组 */ static randomPoints(box: any, maxNum?: number): any[]; /** * 计算多边形面积 * @param {Feature} polygon * @param {boolean} returnNumber * @returns {*} 计算后结果 */ static formatArea(polygon: any, returnNumber?: boolean): any; /** * 转化范围4326to3857 * @param {number[]} box 四角范围【minLng,minLat,maxLng,maxLat】 * @returns {*} 计算后结果 */ static transTo3857(box: any): olExtent.Extent; /** * 转化范围3857to4326 * @param {number[]} box 四角范围【minX,minY,maxX,maxY】 * @returns {*} 计算后结果【minLng,minLat,maxLng,maxLat】 */ static transExtentTo4326(box: any): olExtent.Extent; /** * 获取要素范围 * @param {Feature} feature 要素 * @returns {number[]}} 计算后结果[x1,y1,x2,y2] */ static getFeatureExtent(feature: Feature): olExtent.Extent; /** * 获取要素坐标 * @param {Feature} feature 要素 * @returns {number[]} 计算后结果Coordinates[x1,y1] */ static getFeatureCoord(feature: Feature): any; /** * 取区域内的随机点,默认在中国范围内 * @param {number[]} box Extent * @returns {number} 计算后结果 */ static randomLatLng(box: any): { lnglat: number[]; box: olExtent.Extent; }; /** * 最短路径 * @param {Feature} startPoint -起点 * @param {Feature} endPoint -终点 * @param {object} options 参数 * @param {Feature[]} options.obstacles 障碍面 * @param {number} options.minDistance 最短路径与障碍物之间的最小距离 * @param {object} options.units 分辨率和最小距离将以表示的单位;可以是度、弧度、英里、公里 * @param {number} options.resolution 计算路径的矩阵点之间的距离 } * @returns {Feature} 计算后结果line */ static shortestPath(startPoint: Feature, endPoint: Feature, options?: { obstacles?: Feature[]; minDistance?: number; units?: string; resolution?: number; }): Feature; /** * : 多线段合并成单线段 * @param {Feature[]} Features * @param {number} distance 指定长度 默认1 单位km * @returns {Feature} 计算后结果line */ static lineMerger(Features: Feature[], distance?: number): { line: Feature; nodeData: any[]; coordinates: any[]; }; /** * : 按线坐标指定长度返回数组 * @param {Feature[]} coord 线的坐标点 * @param {number} distance 指定长度 默认1 单位km * @returns {Feature[]} 点数组 */ private static along; /** * 线坐标分段距离 * @param {Feature[]} coords 线的坐标点 * @returns {Feature[]} 点数组 */ private static lineAttr; static movePointContain(geoMarkerCircle: any, attr: any): { coordIndex: number; distance: number; bearing: number; coords: any[]; }; /** * 二维数组去重 * @param {any} arr * @returns {any[]} 去重后的数组 */ static arrayDup(arr: any): any[]; /** * 对传入的路径集合 进行去重并分段添加虚拟点处理后返回 * @param {*} path 路径数组 * @param {*} segmentLength 分割长度 * @returns {*} */ static decoratePath(path: any, segmentLength: any): any; /** * 线分割,按起始点分割线段 * @param {Feature}_startPoint * @param {Feature}_stopPoint * @param {Feature}_line * @returns {Feature} 3857坐标的数据 */ static lineSlice(_startPoint: Feature, _stopPoint: Feature, _line: Feature): Feature; /** * 判断点是否在线上 * @param {Feature} _point * @param { Feature} _line * @returns {boolean} */ static booleanPointOnLine(_point: Feature, _line: Feature): boolean; /** * 判断线线是否相交 * @param {Feature} _line1 * @param {Feature} _line2 * @returns {boolean} */ static booleanCrosses(_line1: Feature, _line2: Feature): boolean; /** * 获取任何LineString或PolygonGeoJSON,并返回相交点 * @param { Feature} _line1 * @param { Feature} _line2 * @returns { Feature[]} */ static lineIntersect(_line1: Feature, _line2: Feature): Feature[]; /** * 通过另一个Feature分割一个LineString。 * @param {Feature} _line1 * @param {Feature} _feature * @returns {Feature[]} 分割后的要素集合 */ static lineSplit(_line1: Feature, _feature: Feature): Feature; /** * 线线是否相交打断 * @param {layer} layer GraphicLayer 图层 * @param {Array>} lineList 线数组 * @param {Function} callback 回调函数 返回 Feature, 及原properties */ static lineCrossesSplit(layer: GraphicLayer, lineList: Array>, callback: Function): void; /** * 擦除线 * @param {layer} layer GraphicLayer 图层 * @param {number[]} coordinate 擦除点位置 * @param {number} bufferExtent 点缓冲大小,以中心点辐射一个圆形,单位km * @param {Array>} lineList 线数组 * @param {Function} callback 回调函数 返回 Feature, 及原properties * @returns {Function} 不返回值 通过回调函数获取打断后数据 */ static lineErase(layer: GraphicLayer, coordinate: number[], bufferExtent: number, lineList: Array>, callback: Function): void; /** * 转为geoJson格式,不改变坐标系 * @param {Feature} Feature * @returns {any} 返回的是个json Feature): import("geojson").Feature; /** * geoJson转为feature格式,不改变坐标系 * @param {any} json * @returns {any} 返回的是个json Feature; /** * :转为geoJson格式,元数据为3857转为4326 * @param {Feature} Feature * @returns {any} 返回的是个json Feature): any; /** * 转为geoJson数组格式,适用于数组转换 * @param {Feature[]} Feature * @returns {any} 返回的是个json Feature[]): import("geojson").FeatureCollection; /** * 获取中心点坐标 * @param {Feature | Geometry} feature -传入一个要素 * @returns {number[]} Coordinate */ static getCenter(feature: Feature | Geometry): import("ol/coordinate").Coordinate; /** * 转为geoJson数组格式,4326转3857 * @param {any} feature * @returns { Feature} 返回的是个 Feature. */ static to3857(feature: any): Feature; /** * 转为geoJson数组格式,适用于数组转换 * @param {any} Features * @returns { Feature[]} "EPSG:4326" Object. */ static to3857_featureList(Features: any): Feature[]; static lineClipPolygon(clipLine: Feature, polygonList: Feature[], callback: Function, errCallback: Function): void; static formatJsonTo3857(GeoJson: any): any; /** * geoJson数据处理模块(需要引入turf.js) * 输入输出数据均为标准geoJson格式 */ static geoUtil: { /** * 合并多边形 * @param {any} polygons * @returns {any} polygon */ unionPolygon: (polygons: any) => any; /** * 线分割面 * 面类型只能是polygon 但可以是环 * 注:线与多边形必须有两个交点 * @param {any} polygon * @param {any} clipLine * @returns {any} polygon */ polygonClipByLine: (polygon: any, clipLine: any) => any; _singlePolygonClip: (polyLine: any, clipLine: any) => turf.helpers.FeatureCollection; _multiPolygonClip: (polyLine: any, clipLine: any) => turf.helpers.FeatureCollection; /** * 连接两条线 * 方法会将两条线段最近的一段直接连接 * @param {any} line1 * @param {any} line2 * @returns {any} */ connectLine: (line1: any, line2: any) => turf.helpers.Feature; /** * 判断点是否在线里面 * 注:线组成的坐标对比 * @param {any} point * @param {any} line * @returns {any} */ isOnLine: (point: any, line: any) => boolean; /** * 获得两条线交点 * @param {any} line1 * @param {any} line2 * @returns {any} */ getIntersectPoints: (line1: any, line2: any) => turf.helpers.FeatureCollection; /** * multiPolygon转polygons,不涉及属性 * @param {any} multiPolygon * @returns {any} */ multiPolygon2polygons: (multiPolygon: any) => any[]; /** * polygons转multiPolygon,不涉及属性,只输出属性为{} * 考虑polygons中就存在多面的情况 * @param {any} geoJson * @returns {any} */ polygons2MultiPolygon: (geoJson: any) => { type: string; features: { geometry: { coordinates: any[]; type: string; }; type: string; properties: {}; }[]; }; }; }