Turf-MCP
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Server capabilities have not been inspected yet.
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| aggregation_collectA | 将点属性聚合到多边形中。 此功能将位于多边形内部的点的属性值聚合到多边形中,用于统计和汇总分析。 Args: polygons: 多边形特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Polygon or MultiPolygon features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {..., "total_population": 聚合值}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"total_population": 1500}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygons = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}}]}' >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"population": 100}}]}' >>> result = asyncio.run(collect(polygons, points, 'population', 'total_population')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"total_population": 100}}, ...]}' Notes: - 输入参数 polygons 和 points 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 仅对位于多边形内部的点进行属性聚合 - 聚合方式为求和,即计算多边形内部所有点的属性值总和 - 依赖于 Turf.js 库和 Node.js 环境 |
| aggregation_clustersDbscanA | 使用 DBSCAN 算法进行点聚类。 此功能使用基于密度的空间聚类算法 (DBSCAN) 对点进行聚类,识别密集区域。 Args: points: 点特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {"cluster": 聚类编号, ...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"cluster": 1}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}]}' >>> result = asyncio.run(clustersDbscan(points, 100.0, '{"minPoints": 3}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"cluster": 1}}, ...]}' Notes: - 输入参数 points 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - DBSCAN 算法能够识别任意形状的聚类,并处理噪声点 - 聚类编号从 0 开始,-1 表示噪声点(不属于任何聚类) - 依赖于 Turf.js 库和 Node.js 环境 |
| aggregation_clustersKmeansA | 使用 K-means 算法进行点聚类。 此功能使用 K-means 聚类算法对点进行聚类,将点划分为指定数量的簇。 Args: points: 点特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {"cluster": 聚类编号, ...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"cluster": 1}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}]}' >>> result = asyncio.run(clustersKmeans(points, 5)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"cluster": 1}}, ...]}' Notes: - 输入参数 points 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - K-means 算法需要预先指定聚类数量 - 聚类编号从 0 开始 - 算法使用随机初始中心点,每次运行结果可能不同 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanClockwiseA | 检查环是否为顺时针方向。 此功能检查给定的坐标环(多边形边界)是否为顺时针方向。 Args: ring: 坐标环数组 - 类型: str (JSON 字符串格式的数组) - 格式: [[x1, y1], [x2, y2], [x3, y3], ...] - 示例: '[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> ring = '[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]' >>> result = asyncio.run(booleanClockwise(ring)) >>> print(result) '{"value": true}' Notes: - 输入参数 ring 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 顺时针环在多边形中表示外部边界 - 逆时针环在多边形中表示内部孔洞 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanContainsA | 检查第一个几何图形是否包含第二个几何图形。 此功能检查第一个GeoJSON几何图形是否完全包含第二个几何图形。 Args: geojson1: 第一个GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]]}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson1 = '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]]}' >>> geojson2 = '{"type": "Point", "coordinates": [1, 1]}' >>> result = asyncio.run(booleanContains(geojson1, geojson2)) >>> print(result) '{"value": true}' Notes: - 输入参数 geojson1 和 geojson2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 包含关系要求第二个几何图形完全在第一个几何图形内部 - 边界接触不被视为包含 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanCrossesA | 检查两个几何图形是否相交。 此功能检查两个GeoJSON几何图形是否相交(交叉但不相交于边界点)。 Args: geojson1: 第一个GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "LineString", "coordinates": [[0, 0], [2, 2]]}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson1 = '{"type": "LineString", "coordinates": [[0, 0], [2, 2]]}' >>> geojson2 = '{"type": "LineString", "coordinates": [[0, 2], [2, 0]]}' >>> result = asyncio.run(booleanCrosses(geojson1, geojson2)) >>> print(result) '{"value": true}' Notes: - 输入参数 geojson1 和 geojson2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 交叉关系要求几何图形在内部点相交 - 边界接触不被视为交叉 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanDisjointA | 检查两个几何图形是否不相交。 此功能检查两个GeoJSON几何图形是否完全不相交(没有共同点)。 Args: geojson1: 第一个GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "Polygon", "coordinates": [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]]}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson1 = '{"type": "Polygon", "coordinates": [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]]}' >>> geojson2 = '{"type": "Polygon", "coordinates": [[[2, 2], [3, 2], [3, 3], [2, 3], [2, 2]]]}' >>> result = asyncio.run(booleanDisjoint(geojson1, geojson2)) >>> print(result) '{"value": true}' Notes: - 输入参数 geojson1 和 geojson2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 不相交关系要求几何图形没有任何共同点 - 边界接触也被视为相交 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanEqualA | 检查两个几何图形是否相等。 此功能检查两个GeoJSON几何图形是否在几何上完全相等。 Args: geojson1: 第一个GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "Point", "coordinates": [1, 1]}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson1 = '{"type": "Point", "coordinates": [1, 1]}' >>> geojson2 = '{"type": "Point", "coordinates": [1, 1]}' >>> result = asyncio.run(booleanEqual(geojson1, geojson2)) >>> print(result) '{"value": true}' Notes: - 输入参数 geojson1 和 geojson2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 相等关系要求几何图形具有相同的坐标和结构 - 属性不同不影响几何相等性判断 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanOverlapA | 检查两个几何图形是否重叠。 此功能检查两个GeoJSON几何图形是否在空间上重叠(有共同区域但不完全包含)。 Args: geojson1: 第一个GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]]}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson1 = '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]]}' >>> geojson2 = '{"type": "Polygon", "coordinates": [[[1, 1], [3, 1], [3, 3], [1, 3], [1, 1]]]}' >>> result = asyncio.run(booleanOverlap(geojson1, geojson2)) >>> print(result) '{"value": true}' Notes: - 输入参数 geojson1 和 geojson2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 重叠关系要求几何图形有共同区域但互不包含 - 边界接触不被视为重叠 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanParallelA | 检查两条线段是否平行。 此功能检查两条线段是否在几何上平行。 Args: line1: 第一条线段 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: Feature with LineString geometry - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[0, 0], [1, 1]]}}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line1 = '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[0, 0], [1, 1]]}}' >>> line2 = '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[0, 1], [1, 2]]}}' >>> result = asyncio.run(booleanParallel(line1, line2)) >>> print(result) '{"value": true}' Notes: - 输入参数 line1 和 line2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 平行关系基于线段的方向向量 - 允许一定的数值容差 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanPointInPolygonA | 检查点是否在多边形内部。 此功能检查点是否位于多边形或多边形集合的内部。 Args: point: 点特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: Feature with Point geometry - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [1, 1]}}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [1, 1]}}' >>> polygon = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]]}}' >>> result = asyncio.run(booleanPointInPolygon(point, polygon)) >>> print(result) '{"value": true}' Notes: - 输入参数 point 和 polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 使用射线法算法判断点是否在多边形内部 - 边界上的点默认被视为内部 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanPointOnLineA | 检查点是否在线上。 此功能检查点是否位于线段或多线的路径上。 Args: point: 点特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: Feature with Point geometry - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [1, 1]}}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [1, 1]}}' >>> line = '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[0, 0], [2, 2]]}}' >>> result = asyncio.run(booleanPointOnLine(point, line)) >>> print(result) '{"value": true}' Notes: - 输入参数 point 和 line 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 使用点到线段距离算法判断点是否在线上 - 允许一定的数值容差 - 依赖于 Turf.js 库和 Node.js 环境 |
| booleans_booleanWithinA | 检查第一个几何图形是否在第二个几何图形内部。 此功能检查第一个GeoJSON几何图形是否完全位于第二个几何图形内部。 Args: geojson1: 第一个GeoJSON对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 示例: '{"type": "Point", "coordinates": [1, 1]}' Returns: str: JSON 字符串格式的布尔结果 - 类型: 包含 value 的对象 - 格式: {"value": true 或 false} - 示例: '{"value": true}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson1 = '{"type": "Point", "coordinates": [1, 1]}' >>> geojson2 = '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [2, 2], [0, 2], [0, 0]]]}' >>> result = asyncio.run(booleanWithin(geojson1, geojson2)) >>> print(result) '{"value": true}' Notes: - 输入参数 geojson1 和 geojson2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 内部关系要求第一个几何图形完全在第二个几何图形内部 - 边界接触不被视为内部 - 依赖于 Turf.js 库和 Node.js 环境 |
| classification_nearestPointA | 查找距离目标点最近的点特征。 此功能从点集合中查找距离给定目标点最近的点特征,并返回该点及其距离信息。 Args: target_point: 目标点特征 - 类型: str (JSON 字符串格式的 GeoJSON Feature) - 格式: Feature with Point geometry - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}' Returns: str: JSON 字符串格式的最近点特征 - 类型: GeoJSON Feature with Point geometry and distance property - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {"distance": 距离数值, ...}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.833, 39.284]}, "properties": {"distance": 12.34, ...}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> target_point = '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}' >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.833, 39.284]}}]}' >>> result = asyncio.run(nearestPoint(target_point, points)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.833, 39.284]}, "properties": {"distance": 12.34, ...}}' Notes: - 输入参数 target_point 和 points 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算的是球面距离,单位为千米 - 返回的点特征包含原始属性以及新增的 distance 属性 - 依赖于 Turf.js 库和 Node.js 环境 |
| coordinate_mutation_clean_coordsA | 清理 GeoJSON 数据中的冗余坐标点。 此功能自动移除连续的重复坐标点,简化几何图形,使数据更加整洁。 Args: geojson: GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]}' Returns: str: JSON 字符串格式的清理后的 GeoJSON 特征或几何图形 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 清理冗余坐标后的 GeoJSON - 示例: '{"type": "LineString", "coordinates": [[0, 0], [0, 10]]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]}' >>> result = asyncio.run(clean_coords(line)) >>> print(result) '{"type": "LineString", "coordinates": [[0, 0], [0, 10]]}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 会移除连续的重复坐标点 - 依赖于 Turf.js 库和 Node.js 环境 |
| coordinate_mutation_flipA | 交换坐标的经度和纬度位置。 此功能将坐标从 [经度, 纬度] 格式转换为 [纬度, 经度] 格式,适用于不同系统的坐标约定。 Args: geojson: GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [20.566406, 43.421008]}' Returns: str: JSON 字符串格式的坐标翻转后的 GeoJSON 特征 - 类型: GeoJSON Feature - 格式: 坐标翻转后的 GeoJSON - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [43.421008, 20.566406]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Point", "coordinates": [20.566406, 43.421008]}' >>> result = asyncio.run(flip(point)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [43.421008, 20.566406]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序从 [经度, 纬度] 翻转为 [纬度, 经度] - 主要用于在不同坐标系约定之间转换 - 依赖于 Turf.js 库和 Node.js 环境 - 注意:输入如果是几何图形,输出会转换为特征对象 |
| coordinate_mutation_rewindA | 修正多边形的环方向,确保外环逆时针、内环顺时针。 此功能自动调整多边形的环方向,符合地理信息系统标准,确保多边形区域计算正确。 Args: geojson: GeoJSON 多边形特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Polygon 或 MultiPolygon 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]]}' Returns: str: JSON 字符串格式的重绕后的 GeoJSON 多边形 - 类型: GeoJSON Feature with Polygon geometry - 格式: 重绕环方向后的多边形 - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[121, -29], [121, -18], [138, -18], [138, -29], [121, -29]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[121, -29], [138, -29], [138, -18], [121, -18], [121, -29]]]}' >>> result = asyncio.run(rewind(polygon)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[121, -29], [121, -18], [138, -18], [138, -29], [121, -29]]]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 外环应为逆时针方向,内环应为顺时针方向 - 依赖于 Turf.js 库和 Node.js 环境 |
| coordinate_mutation_round_numberA | 对数字进行四舍五入,控制小数位数。 此功能将数字四舍五入到指定的小数位数,用于精确控制数值的精度。 Args: num: 要四舍五入的数字 - 类型: float - 范围: 任意浮点数 - 示例: 120.4321 Returns: str: JSON 字符串格式的四舍五入结果对象 - 类型: 包含 value 的对象 - 格式: {"value": 四舍五入后的数值} - 示例: '{"value": 120.43}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> result = asyncio.run(round_number(120.4321, 2)) >>> print(result) '{"value": 120.43}' Notes: - 如果未提供精度参数,默认四舍五入到整数 - 精度为 0 时返回整数 - 依赖于 Turf.js 库和 Node.js 环境 |
| coordinate_mutation_truncateA | 截断 GeoJSON 几何图形的坐标精度。 该函数使用 Turf.js 库的 truncate 方法,减少 GeoJSON 几何图形坐标的小数精度, 并可选择移除 Z 坐标值。 Args: geojson: GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [70.46923055566859, 58.11088890802906, 1508]}' Returns: str: JSON 字符串格式的精度截断后的 GeoJSON 特征 - 类型: GeoJSON Feature - 格式: 坐标精度截断后的 GeoJSON - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [70.469, 58.111]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Point", "coordinates": [70.46923055566859, 58.11088890802906, 1508]}' >>> options = '{"precision": 3, "coordinates": 2}' >>> result = asyncio.run(truncate(point, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [70.469, 58.111]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 通过设置 coordinates 为 2 可以移除 Z 坐标值 - 依赖于 Turf.js 库和 Node.js 环境 |
| data_sampleA | 从特征集合中随机采样指定数量的特征。 此功能从输入的特征集合中随机选择指定数量的特征,返回一个新的特征集合。 Args: feature_collection: 输入特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: 任何有效的 GeoJSON FeatureCollection - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection - 格式: {"type": "FeatureCollection", "features": [...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> feature_collection = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' >>> result = asyncio.run(sample(feature_collection, 5)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Notes: - 输入参数 feature_collection 必须是有效的 JSON 字符串 - 采样数量不能超过输入特征集合中的特征总数 - 如果采样数量为0,返回空的特征集合 - 采样是随机进行的,每次调用可能得到不同的结果 - 依赖于 Turf.js 库和 Node.js 环境 |
| feature_conversion_combineA | 将特征集合合并为复合几何图形。 此功能将点、线或多边形特征集合分别合并为多点、多线或多边形复合几何图形。 Args: feature_collection: GeoJSON 特征集合 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [19.026432, 47.49134]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [19.074497, 47.509548]}}]}' Returns: str: JSON 字符串格式的合并后 GeoJSON 特征集合 - 类型: GeoJSON FeatureCollection with MultiPoint, MultiLineString or MultiPolygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "...", "coordinates": [...]}}]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> fc = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [19.026432, 47.49134]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [19.074497, 47.509548]}}]}' >>> result = asyncio.run(combine(fc)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "MultiPoint", "coordinates": [[19.026432, 47.49134], [19.074497, 47.509548]]}}]}' Notes: - 输入参数 feature_collection 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 点特征会合并为多点,线特征会合并为多线,多边形特征会合并为多多边形 - 依赖于 Turf.js 库和 Node.js 环境 |
| feature_conversion_explodeA | 将几何图形分解为单独的点特征。 此功能将给定的 GeoJSON 特征分解为所有顶点坐标的单独点特征集合。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' Returns: str: JSON 字符串格式的点特征集合 - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' >>> result = asyncio.run(explode(polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-81, 41]}}, ...]}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回所有几何图形顶点的点特征集合 - 依赖于 Turf.js 库和 Node.js 环境 |
| feature_conversion_flattenA | 将复合几何图形展平为简单几何图形。 此功能将多几何图形(如多点、多线、多多边形)展平为对应的简单几何图形特征集合。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "MultiPolygon", "coordinates": [[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]]}' Returns: str: JSON 字符串格式的展平后特征集合 - 类型: GeoJSON FeatureCollection with simple geometry features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "...", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> multi_polygon = '{"type": "MultiPolygon", "coordinates": [[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]], [[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]]]}' >>> result = asyncio.run(flatten(multi_polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0], [102.0, 2.0]]]}}, ...]}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 多几何图形会被展平为对应的简单几何图形集合 - 依赖于 Turf.js 库和 Node.js 环境 |
| feature_conversion_line_to_polygonA | 将线转换为多边形。 此功能将线几何图形转换为多边形几何图形,自动闭合线段的起点和终点。 Args: line: GeoJSON 线特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 或 MultiLineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]}' Returns: str: JSON 字符串格式的 GeoJSON Polygon 或 MultiPolygon 特征 - 类型: GeoJSON Feature with Polygon or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]}' >>> options = '{"properties": {"name": "converted polygon"}}' >>> result = asyncio.run(line_to_polygon(line, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]}}' Notes: - 输入参数 line 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 线会自动闭合形成多边形边界 - 依赖于 Turf.js 库和 Node.js 环境 |
| feature_conversion_polygonizeA | 将线几何图形转换为多边形。 此功能将线或多线几何图形转换为多边形几何图形集合,基于线的闭合区域创建多边形。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection, Geometry 或 Feature 规范,包含 LineString 或 MultiLineString - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]}}]}' Returns: str: JSON 字符串格式的多边形特征集合 - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]}}]}' >>> result = asyncio.run(polygonize(geojson)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]]}}]}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 基于线的闭合区域创建多边形 - 依赖于 Turf.js 库和 Node.js 环境 |
| feature_conversion_polygon_to_lineA | 将多边形转换为线几何图形。 此功能将多边形或多边形几何图形转换为线或多线几何图形,提取多边形的边界。 Args: polygon: GeoJSON 多边形特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Polygon 或 MultiPolygon 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]}' Returns: str: JSON 字符串格式的 GeoJSON LineString 或 MultiLineString 特征 - 类型: GeoJSON Feature with LineString or MultiLineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]]}' >>> result = asyncio.run(polygon_to_line(polygon)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]}}' Notes: - 输入参数 polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 提取多边形的边界作为线几何图形 - 依赖于 Turf.js 库和 Node.js 环境 |
| grid_hexGridA | 在边界框内生成六边形网格。 此功能在指定的边界框内创建六边形网格,用于空间分析和可视化。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) - 格式: [minX, minY, maxX, maxY] - 示例: '[-180, -90, 180, 90]' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"type": "hexagon"}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-180, -90, 180, 90]' >>> result = asyncio.run(hexGrid(bbox, 50.0, '{"units": "miles"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {...}}, ...]}' Notes: - 输入参数 bbox 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 六边形网格提供均匀的空间覆盖,常用于地理分析 - 依赖于 Turf.js 库和 Node.js 环境 |
| grid_pointGridA | 在边界框内生成点网格。 此功能在指定的边界框内创建规则分布的点网格,用于空间采样和插值。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) - 格式: [minX, minY, maxX, maxY] - 示例: '[-180, -90, 180, 90]' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"type": "grid_point"}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-180, -90, 180, 90]' >>> result = asyncio.run(pointGrid(bbox, 50.0, '{"units": "miles"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"type": "grid_point"}}, ...]}' Notes: - 输入参数 bbox 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 点网格提供规则的空间采样点,常用于插值和统计 - 依赖于 Turf.js 库和 Node.js 环境 |
| grid_squareGridA | 在边界框内生成正方形网格。 此功能在指定的边界框内创建正方形网格,用于空间分析和区域划分。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) - 格式: [minX, minY, maxX, maxY] - 示例: '[-180, -90, 180, 90]' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"type": "square"}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-180, -90, 180, 90]' >>> result = asyncio.run(squareGrid(bbox, 50.0, '{"units": "miles"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"type": "square"}}, ...]}' Notes: - 输入参数 bbox 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 正方形网格提供规则的矩形区域,常用于统计和聚合 - 依赖于 Turf.js 库和 Node.js 环境 |
| grid_triangleGridA | 在边界框内生成三角形网格。 此功能在指定的边界框内创建三角形网格,用于空间分析和表面建模。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) - 格式: [minX, minY, maxX, maxY] - 示例: '[-180, -90, 180, 90]' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"type": "triangle"}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-180, -90, 180, 90]' >>> result = asyncio.run(triangleGrid(bbox, 50.0, '{"units": "miles"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"type": "triangle"}}, ...]}' Notes: - 输入参数 bbox 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 三角形网格提供灵活的空间划分,常用于表面建模 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_featureCollectionA | 将多个地理特征组合成一个特征集合。 此功能将一组地理特征组合成一个统一的特征集合,便于批量处理和管理多个地理对象。 Args: features: 特征数组 - 类型: str (JSON 字符串格式的数组) - 格式: 包含 GeoJSON 特征的数组 - 示例: '[{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.833, 39.284]}}]' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection - 格式: {"type": "FeatureCollection", "features": [...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> features = '[{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.833, 39.284]}}]' >>> result = asyncio.run(featureCollection(features)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Notes: - 输入参数 features 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 特征集合是组织和管理多个地理对象的有效方式 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_featureA | 创建单个地理特征对象。 此功能将几何图形和属性信息组合成一个完整的地理特征,用于表示具体的地理要素。 Args: geometry: 几何图形对象 - 类型: str (JSON 字符串格式的 GeoJSON 几何图形) - 格式: 任何有效的 GeoJSON 几何图形 - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的 GeoJSON Feature - 类型: GeoJSON Feature - 格式: {"type": "Feature", "geometry": {...}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"name": "Location A"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geometry = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> properties = '{"name": "Location A"}' >>> result = asyncio.run(feature(geometry, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"name": "Location A"}}' Notes: - 输入参数 geometry、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 特征是 GeoJSON 中的基本数据单元,包含几何信息和属性 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_geometryCollectionA | 创建几何图形集合特征。 此功能将多个不同类型的几何图形组合成一个几何集合特征,适用于包含多种几何类型的复杂场景。 Args: geometries: 几何图形数组 - 类型: str (JSON 字符串格式的数组) - 格式: 包含 GeoJSON 几何图形的数组 - 示例: '[{"type": "Point", "coordinates": [100, 0]}, {"type": "LineString", "coordinates": [[101, 0], [102, 1]]}]' Returns: str: JSON 字符串格式的 GeoJSON Feature with GeometryCollection - 类型: GeoJSON Feature with GeometryCollection geometry - 格式: {"type": "Feature", "geometry": {"type": "GeometryCollection", "geometries": [...]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "GeometryCollection", "geometries": [{"type": "Point", "coordinates": [100, 0]}, ...]}, "properties": {"name": "mixed geometries"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geometries = '[{"type": "Point", "coordinates": [100, 0]}, {"type": "LineString", "coordinates": [[101, 0], [102, 1]]}]' >>> properties = '{"name": "mixed geometries"}' >>> result = asyncio.run(geometryCollection(geometries, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "GeometryCollection", "geometries": [...]}, "properties": {"name": "mixed geometries"}}' Notes: - 输入参数 geometries、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 几何集合可以包含不同类型的几何图形 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_lineStringA | 创建线特征对象。 此功能根据坐标点数组创建线特征,用于表示路径、边界等线性地理要素。 Args: coordinates: 坐标点数组 - 类型: str (JSON 字符串格式的数组) - 格式: [[lng1, lat1], [lng2, lat2], ...] - 示例: '[[-74, 40], [-78, 42], [-82, 35]]' Returns: str: JSON 字符串格式的 GeoJSON LineString Feature - 类型: GeoJSON Feature with LineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}, "properties": {"name": "route"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> coordinates = '[[-74, 40], [-78, 42], [-82, 35]]' >>> properties = '{"name": "route"}' >>> result = asyncio.run(lineString(coordinates, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}, "properties": {"name": "route"}}' Notes: - 输入参数 coordinates、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 至少需要两个坐标点才能创建有效的线 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_multiLineStringA | 创建多线特征对象。 此功能根据多组坐标点数组创建多线特征,用于表示包含多条线的复杂线性要素。 Args: coordinates: 多线坐标数组 - 类型: str (JSON 字符串格式的数组) - 格式: [[[lng1, lat1], [lng2, lat2], ...], [[lng3, lat3], [lng4, lat4], ...]] - 示例: '[[[[-24, 63], [-23, 60], [-25, 65], [-20, 69]]], [[[-14, 43], [-13, 40], [-15, 45], [-10, 49]]]]' Returns: str: JSON 字符串格式的 GeoJSON MultiLineString Feature - 类型: GeoJSON Feature with MultiLineString geometry - 格式: {"type": "Feature", "geometry": {"type": "MultiLineString", "coordinates": [...]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "MultiLineString", "coordinates": [[[-24, 63], [-23, 60], ...], [[-14, 43], [-13, 40], ...]]}, "properties": {"name": "multi route"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> coordinates = '[[[[-24, 63], [-23, 60], [-25, 65], [-20, 69]]], [[[-14, 43], [-13, 40], [-15, 45], [-10, 49]]]]' >>> properties = '{"name": "multi route"}' >>> result = asyncio.run(multiLineString(coordinates, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "MultiLineString", "coordinates": [...]}, "properties": {"name": "multi route"}}' Notes: - 输入参数 coordinates、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 多线特征包含多条独立的线 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_multiPointA | 创建多点特征对象。 此功能根据坐标点数组创建多点特征,用于表示一组相关的点要素。 Args: coordinates: 多点坐标数组 - 类型: str (JSON 字符串格式的数组) - 格式: [[lng1, lat1], [lng2, lat2], ...] - 示例: '[[0, 0], [10, 10]]' Returns: str: JSON 字符串格式的 GeoJSON MultiPoint Feature - 类型: GeoJSON Feature with MultiPoint geometry - 格式: {"type": "Feature", "geometry": {"type": "MultiPoint", "coordinates": [...]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "MultiPoint", "coordinates": [[0, 0], [10, 10]]}, "properties": {"name": "point group"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> coordinates = '[[0, 0], [10, 10]]' >>> properties = '{"name": "point group"}' >>> result = asyncio.run(multiPoint(coordinates, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "MultiPoint", "coordinates": [[0, 0], [10, 10]]}, "properties": {"name": "point group"}}' Notes: - 输入参数 coordinates、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 多点特征包含多个独立的点 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_multiPolygonA | 创建多多边形特征对象。 此功能根据多组多边形坐标数组创建多多边形特征,用于表示包含多个多边形的复杂区域要素。 Args: coordinates: 多多边形坐标数组 - 类型: str (JSON 字符串格式的数组) - 格式: [[[[lng1, lat1], [lng2, lat2], ...]], [[[lng3, lat3], [lng4, lat4], ...]]] - 示例: '[[[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [[[[10, 0], [10, 5], [15, 5], [15, 0], [10, 0]]]]]' Returns: str: JSON 字符串格式的 GeoJSON MultiPolygon Feature - 类型: GeoJSON Feature with MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "MultiPolygon", "coordinates": [...]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "MultiPolygon", "coordinates": [[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]], [[[10, 0], [10, 5], [15, 5], [15, 0], [10, 0]]]]}, "properties": {"name": "multi area"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> coordinates = '[[[[[0, 0], [0, 10], [10, 10], [10, 0], [0, 0]]]], [[[[10, 0], [10, 5], [15, 5], [15, 0], [10, 0]]]]]' >>> properties = '{"name": "multi area"}' >>> result = asyncio.run(multiPolygon(coordinates, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "MultiPolygon", "coordinates": [...]}, "properties": {"name": "multi area"}}' Notes: - 输入参数 coordinates、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 多多边形特征包含多个独立的多边形 - 每个多边形必须形成闭合环 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_pointA | 创建点特征对象。 此功能根据坐标点创建点特征,用于表示具体的地理位置点。 Args: coordinates: 坐标点 - 类型: str (JSON 字符串格式的数组) - 格式: [lng, lat] - 示例: '[-75.343, 39.984]' Returns: str: JSON 字符串格式的 GeoJSON Point Feature - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"name": "Location A"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> coordinates = '[-75.343, 39.984]' >>> properties = '{"name": "Location A"}' >>> result = asyncio.run(point(coordinates, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"name": "Location A"}}' Notes: - 输入参数 coordinates、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 点特征是地理信息系统中最基本的要素类型 - 依赖于 Turf.js 库和 Node.js 环境 |
| helper_polygonA | 创建多边形特征对象。 此功能根据坐标点数组创建多边形特征,用于表示区域、地块等面状地理要素。 Args: coordinates: 多边形坐标数组 - 类型: str (JSON 字符串格式的数组) - 格式: [[[lng1, lat1], [lng2, lat2], [lng3, lat3], [lng1, lat1]]] - 示例: '[[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]' Returns: str: JSON 字符串格式的 GeoJSON Polygon Feature - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {...}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}, "properties": {"name": "area"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> coordinates = '[[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]' >>> properties = '{"name": "area"}' >>> result = asyncio.run(polygon(coordinates, properties)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}, "properties": {"name": "area"}}' Notes: - 输入参数 coordinates、properties 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 多边形必须形成闭合环,首尾坐标点必须相同 - 支持带孔的多边形(多个环) - 依赖于 Turf.js 库和 Node.js 环境 |
| interpolation_interpolateA | 使用反距离权重法进行空间插值。 此功能根据已知点的属性值,使用反距离权重法在网格上估计属性值。 Args: points: 已知点的特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"elevation": 100}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point or Polygon features - 格式: {"type": "FeatureCollection", "features": [...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"temperature": 25.5}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"temperature": 25.5}}]}' >>> result = asyncio.run(interpolate(points, 100.0, '{"gridType": "point", "property": "temperature"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"temperature": 25.5}}, ...]}' Notes: - 输入参数 points 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 反距离权重法假设距离越近的点对插值结果影响越大 - 依赖于 Turf.js 库和 Node.js 环境 |
| interpolation_isobandsA | 从点网格生成等值带。 此功能从具有z值的点网格生成填充的等值带,用于创建连续值的区域表示。 Args: point_grid: 点网格特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features (必须是方形或矩形网格) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"elevation": 100}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with MultiPolygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "MultiPolygon", "coordinates": [...]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "MultiPolygon", "coordinates": [...]}, "properties": {"min": 0, "max": 10}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point_grid = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"temperature": 25.5}}]}' >>> breaks = '[0, 10, 20, 30]' >>> result = asyncio.run(isobands(point_grid, breaks, '{"zProperty": "temperature"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "MultiPolygon", "coordinates": [...]}, "properties": {"min": 0, "max": 10}}, ...]}' Notes: - 输入参数 point_grid、breaks 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 点网格必须是方形或矩形排列 - 等值带用于可视化连续数据的范围 - 依赖于 Turf.js 库和 Node.js 环境 |
| interpolation_isolinesA | 从点网格生成等值线。 此功能从具有z值的点网格生成等值线,用于创建连续值的线状表示。 Args: point_grid: 点网格特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features (必须是方形或矩形网格) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"elevation": 100}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with LineString features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}, "properties": {"value": 10}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point_grid = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"temperature": 25.5}}]}' >>> breaks = '[0, 10, 20, 30]' >>> result = asyncio.run(isolines(point_grid, breaks, '{"zProperty": "temperature"}')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}, "properties": {"value": 10}}, ...]}' Notes: - 输入参数 point_grid、breaks 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 点网格必须是方形或矩形排列 - 等值线用于可视化连续数据的等值边界 - 依赖于 Turf.js 库和 Node.js 环境 |
| interpolation_planepointA | 计算点在三角形平面上的z值。 此功能根据三角形三个顶点的z值,计算给定点在三角形平面上的插值z值。 Args: point: 点特征 - 类型: str (JSON 字符串格式的 GeoJSON Feature) - 格式: Feature with Point geometry - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.3221, 39.529]}}' Returns: str: JSON 字符串格式的z值结果 - 类型: 包含 value 的对象 - 格式: {"value": z值} - 示例: '{"value": 35.5}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.3221, 39.529]}}' >>> triangle = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-75.1221, 39.57], [-75.58, 39.18], [-75.97, 39.86], [-75.1221, 39.57]]]}, "properties": {"a": 11, "b": 122, "c": 44}}' >>> result = asyncio.run(planepoint(point, triangle)) >>> print(result) '{"value": 35.5}' Notes: - 输入参数 point 和 triangle 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 三角形必须包含三个顶点,且首尾坐标相同形成闭合环 - 三角形属性'a', 'b', 'c'分别对应三个顶点的z值 - 依赖于 Turf.js 库和 Node.js 环境 |
| interpolation_tinA | 从点集创建不规则三角网。 此功能从点集创建不规则三角网,用于表面建模和地形分析。 Args: points: 点特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"elevation": 100}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"a": 100, "b": 150, "c": 120}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984], "properties": {"elevation": 100}}]}' >>> result = asyncio.run(tin(points, 'elevation')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}, "properties": {"a": 100, "b": 150, "c": 120}}, ...]}' Notes: - 输入参数 points 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 不规则三角网用于创建连续的表面模型 - 每个三角形包含三个顶点的z值属性 - 依赖于 Turf.js 库和 Node.js 环境 |
| joins_pointsWithinPolygonA | 查找多边形内部的点。 此功能识别位于多边形或多边形集合内部的点特征,返回这些点特征。 Args: points: 点特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}]}' >>> polygons = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}}]}' >>> result = asyncio.run(pointsWithinPolygon(points, polygons)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Notes: - 输入参数 points 和 polygons 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 仅返回位于多边形内部的点 - 位于多边形边界上的点可能被视为内部或外部,取决于具体实现 - 依赖于 Turf.js 库和 Node.js 环境 |
| joins_tagA | 为点特征添加多边形属性。 此功能将多边形特征的属性值关联到位于多边形内部的点特征上。 Args: points: 点特征集合 - 类型: str (JSON 字符串格式的 GeoJSON FeatureCollection) - 格式: FeatureCollection with Point features - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {...}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"area_name": "Area A"}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}]}' >>> polygons = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]], "properties": {"name": "Area A"}}]}' >>> result = asyncio.run(tag(points, polygons, 'name', 'area_name')) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}, "properties": {"area_name": "Area A"}}, ...]}' Notes: - 输入参数 points 和 polygons 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 仅对位于多边形内部的点添加属性 - 如果一个点位于多个多边形内,将使用最后一个匹配的多边形属性 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_alongA | 在线上计算指定距离处的点位置。 此功能沿着给定线段从起点开始移动指定距离,找到对应的坐标点位置。 Args: line: GeoJSON LineString 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[-83, 30], [-84, 36], [-78, 41]]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 33.2]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[-83, 30], [-84, 36], [-78, 41]]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(along(line, 200, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 33.2]}}' Notes: - 如果距离超过线长度,会自动返回线终点 - 如果距离为负值,会自动返回线起点 - 输入参数 line 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_areaA | 计算多边形区域的面积。 此功能计算给定多边形区域的面积,返回以平方米为单位的数值结果。 Args: polygon: GeoJSON 多边形特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Polygon 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}' Returns: str: JSON 字符串格式的面积结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 面积数值, "units": "square meters"} - 示例: '{"value": 1234567.89, "units": "square meters"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}' >>> result = asyncio.run(area(polygon)) >>> print(result) '{"value": 1234567.89, "units": "square meters"}' Notes: - 输入参数 polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回的面积单位为平方米 - 依赖于 Turf.js 库和 Node.js 环境 - 支持 Polygon 和 MultiPolygon 几何类型 |
| measurement_bboxA | 计算地理对象的边界范围。 此功能计算给定地理对象的边界框,返回包含对象的最小矩形范围坐标。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' Returns: str: JSON 字符串格式的边界框数组 - 类型: 数组 [minX, minY, maxX, maxY] - 格式: [最小经度, 最小纬度, 最大经度, 最大纬度] - 示例: '[-82, 35, -74, 42]' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' >>> result = asyncio.run(bbox(line)) >>> print(result) '[-82, 35, -74, 42]' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回的边界框格式为 [minX, minY, maxX, maxY] - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_bboxPolygonA | 将边界框转换为多边形特征。 此功能将边界框坐标转换为完整的多边形几何图形,便于进行多边形操作和可视化。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) - 格式: [minX, minY, maxX, maxY] - 示例: '[-82, 35, -74, 42]' Returns: str: JSON 字符串格式的 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-82, 35], [-74, 35], [-74, 42], [-82, 42], [-82, 35]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-82, 35, -74, 42]' >>> options = '{"properties": {"name": "bounding box"}}' >>> result = asyncio.run(bboxPolygon(bbox, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-82, 35], [-74, 35], [-74, 42], [-82, 42], [-82, 35]]]}}' Notes: - 输入参数 bbox 和 options 必须是有效的 JSON 字符串 - 边界框格式为 [minX, minY, maxX, maxY] - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_bearingA | 计算两点之间的地理方位角。 该函数使用 Turf.js 库的 bearing 方法,计算从第一个点到第二个点的方位角。 Args: point1: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的方位角结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 方位角数值, "units": "degrees"} - 示例: '{"value": 45.5, "units": "degrees"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point1 = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> point2 = '{"type": "Point", "coordinates": [-75.534, 39.123]}' >>> result = asyncio.run(bearing(point1, point2)) >>> print(result) '{"value": 45.5, "units": "degrees"}' Notes: - 输入参数 point1 和 point2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 方位角是从北方向顺时针测量的角度 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_centerA | 计算特征集合的中心点。 此功能计算给定特征集合的几何中心,返回所有特征边界框的中心点位置。 Args: geojson: GeoJSON 特征集合 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-97.522259, 35.4691]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-97.5, 35.5]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-97.522259, 35.4691]}}]}' >>> options = '{"properties": {"name": "center point"}}' >>> result = asyncio.run(center(geojson, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-97.5, 35.5]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回的中心点是所有特征边界框的中心 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_centerOfMassA | 计算 GeoJSON 对象的质心。 该函数使用 Turf.js 库的 centerOfMass 方法,计算给定 GeoJSON 对象的质心。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 35.5]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' >>> options = '{"properties": {"name": "center of mass"}}' >>> result = asyncio.run(centerOfMass(polygon, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 35.5]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 质心是基于几何形状的质量分布计算的中心点 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_centroidA | 计算几何对象的中心点。 此功能计算给定几何对象的几何中心,通过平均所有顶点坐标确定中心位置。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 35.5]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' >>> options = '{"properties": {"name": "centroid"}}' >>> result = asyncio.run(centroid(polygon, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 35.5]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 几何中心是通过平均所有顶点坐标计算的中心点 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_destinationA | 从起点计算指定距离和方位角的目标点。 此功能从给定起点出发,沿着指定方位角移动指定距离,计算并返回目标点的位置坐标。 Args: origin: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-74.5, 39.5]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> origin = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> options = '{"units": "miles", "properties": {"name": "destination"}}' >>> result = asyncio.run(destination(origin, 50.0, 90.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-74.5, 39.5]}}' Notes: - 输入参数 origin 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 方位角是从北方向顺时针测量的角度 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_distanceA | 计算两点之间的球面距离。 此功能计算地球上两点之间的实际距离,考虑地球曲率,返回指定单位的距离值。 Args: point1: 第一个 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的距离结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 距离数值, "units": "距离单位"} - 示例: '{"value": 123.45, "units": "miles"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point1 = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> point2 = '{"type": "Point", "coordinates": [-75.534, 39.123]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(distance(point1, point2, options)) >>> print(result) '{"value": 123.45, "units": "miles"}' Notes: - 输入参数 point1、point2 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算的是两点之间的球面距离 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_envelopeA | 将地理对象转换为边界框多边形。 此功能计算给定地理对象的边界框,并将其转换为完整的多边形几何图形,便于进行多边形操作。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Returns: str: JSON 字符串格式的 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-82, 35], [-74, 35], [-74, 42], [-82, 42], [-82, 35]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}]}' >>> result = asyncio.run(envelope(geojson)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-82, 35], [-74, 35], [-74, 42], [-82, 42], [-82, 35]]]}}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 包络多边形是包含所有输入特征的最小边界框多边形 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_lengthA | 计算线或多线的长度。 此功能计算给定线或多线几何图形的实际长度,考虑地球曲率,返回指定单位的长度值。 Args: geojson: GeoJSON 线或多线对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 或 MultiLineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' Returns: str: JSON 字符串格式的长度结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 长度数值, "units": "距离单位"} - 示例: '{"value": 123.45, "units": "miles"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(length(line, options)) >>> print(result) '123.45' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算的是线或多线的球面长度 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_midpointA | 计算两点之间的中点。 该函数使用 Turf.js 库的 midpoint 方法,计算两个 GeoJSON 点特征之间的中点。 Args: point1: 第一个 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [144.834823, -37.771257]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [144.9886315, -37.801097]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point1 = '{"type": "Point", "coordinates": [144.834823, -37.771257]}' >>> point2 = '{"type": "Point", "coordinates": [145.14244, -37.830937]}' >>> result = asyncio.run(midpoint(point1, point2)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [144.9886315, -37.801097]}}' Notes: - 输入参数 point1 和 point2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算的是两点之间的球面中点 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_pointOnFeatureA | 在 GeoJSON 特征上找到最近的点。 该函数使用 Turf.js 库的 pointOnFeature 方法,在给定的 GeoJSON 特征上找到最近的点。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 35.5]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[-81, 41], [-88, 36], [-84, 31], [-80, 33], [-77, 39], [-81, 41]]]}' >>> result = asyncio.run(pointOnFeature(polygon)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-82.5, 35.5]}}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回的特征上最近的点 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_pointToLineDistanceA | 计算点到线的最短距离。 该函数使用 Turf.js 库的 pointToLineDistance 方法,计算点到线的最短距离。 Args: point: 点 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的距离结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 距离数值, "units": "距离单位"} - 示例: '{"value": 12.34, "units": "miles"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> line = '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' >>> options = '{"units": "miles", "method": "geodesic"}' >>> result = asyncio.run(pointToLineDistance(point, line, options)) >>> print(result) '12.34' Notes: - 输入参数 point、line 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算的是点到线的最短球面距离 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_rhumbBearingA | 计算两点之间的恒向线方位角。 该函数使用 Turf.js 库的 rhumbBearing 方法,计算从第一个点到第二个点的恒向线方位角。 Args: point1: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的方位角结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 方位角数值, "units": "degrees"} - 示例: '{"value": 45.5, "units": "degrees"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point1 = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> point2 = '{"type": "Point", "coordinates": [-75.534, 39.123]}' >>> options = '{"final": true}' >>> result = asyncio.run(rhumbBearing(point1, point2, options)) >>> print(result) '45.5' Notes: - 输入参数 point1、point2 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 恒向线方位角是沿着恒向线(等角航线)的方位角 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_rhumbDestinationA | 沿恒向线计算目标点。 该函数使用 Turf.js 库的 rhumbDestination 方法,从起点沿着指定恒向线方位角移动指定距离来计算目标点。 Args: origin: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}} - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-74.5, 39.5]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> origin = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> options = '{"units": "miles", "properties": {"name": "rhumb destination"}}' >>> result = asyncio.run(rhumbDestination(origin, 50.0, 90.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-74.5, 39.5]}}' Notes: - 输入参数 origin 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 恒向线方位角是沿着恒向线(等角航线)的方位角 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_rhumbDistanceA | 计算两点之间的恒向线距离。 该函数使用 Turf.js 库的 rhumbDistance 方法,计算两个 GeoJSON 点特征之间的恒向线距离。 Args: point1: 第一个 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' Returns: str: JSON 字符串格式的距离结果对象 - 类型: 包含 value 和 units 的对象 - 格式: {"value": 距离数值, "units": "距离单位"} - 示例: '{"value": 123.45, "units": "miles"}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point1 = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> point2 = '{"type": "Point", "coordinates": [-75.534, 39.123]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(rhumbDistance(point1, point2, options)) >>> print(result) '123.45' Notes: - 输入参数 point1、point2 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算的是两点之间的恒向线距离(等角航线距离) - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_squareA | 计算包含边界框的最小正方形边界框。 该函数使用 Turf.js 库的 square 方法,计算包含给定边界框的最小正方形边界框。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) - 格式: [minX, minY, maxX, maxY] - 示例: '[-20, -20, -15, 0]' Returns: str: JSON 字符串格式的正方形边界框数组 - 类型: 数组 [minX, minY, maxX, maxY] - 格式: [最小经度, 最小纬度, 最大经度, 最大纬度] - 示例: '[-20, -20, 0, 0]' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-20, -20, -15, 0]' >>> result = asyncio.run(square(bbox)) >>> print(result) '[-20, -20, 0, 0]' Notes: - 输入参数 bbox 必须是有效的 JSON 字符串 - 边界框格式为 [minX, minY, maxX, maxY] - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回的是包含输入边界框的最小正方形边界框 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_greatCircleA | 计算两点之间的大圆路径。 该函数使用 Turf.js 库的 greatCircle 方法,计算两个 GeoJSON 点特征之间的大圆路径。 Args: start: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-122, 48]}' Returns: str: JSON 字符串格式的 GeoJSON LineString 或 MultiLineString 特征 - 类型: GeoJSON Feature with LineString or MultiLineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} 或 {"type": "Feature", "geometry": {"type": "MultiLineString", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-122, 48], [-120, 47], ...]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> start = '{"type": "Point", "coordinates": [-122, 48]}' >>> end = '{"type": "Point", "coordinates": [-77, 39]}' >>> options = '{"properties": {"name": "Seattle to DC"}, "npoints": 200}' >>> result = asyncio.run(greatCircle(start, end, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-122, 48], [-120, 47], ...]}}' Notes: - 输入参数 start、end 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果起点和终点跨越日期变更线,结果可能是 MultiLineString - 大圆路径是球面上两点之间的最短路径 - 依赖于 Turf.js 库和 Node.js 环境 |
| measurement_polygonTangentsA | 计算多边形上的切线点。 该函数使用 Turf.js 库的 polygonTangents 方法,计算从给定点到多边形(或多边形集合)的两个切线点。 Args: point: 点 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [61, 5]}' Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng1, lat1]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng2, lat2]}}]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [15, 8]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [25, 3]}}]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> point = '{"type": "Point", "coordinates": [61, 5]}' >>> polygon = '{"type": "Polygon", "coordinates": [[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]}' >>> result = asyncio.run(polygonTangents(point, polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [15, 8]}}, {"type": "Feature", "geometry": {"type": "Point", "coordinates": [25, 3]}}]}' Notes: - 输入参数 point 和 polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回两个切线点,分别对应多边形的两个切线 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_kinksA | 查找几何图形中的自相交点。 此功能检测线或多边形几何图形中的自相交点(扭结点),返回这些交叉点的位置坐标。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 支持 LineString、MultiLineString、Polygon、MultiPolygon - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-12.034835, 8.901183], [-12.060413, 8.899826], [-12.03638, 8.873199], [-12.059383, 8.871418], [-12.034835, 8.901183]]]}' Returns: str: JSON 字符串格式的点特征集合 - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[-12.034835, 8.901183], [-12.060413, 8.899826], [-12.03638, 8.873199], [-12.059383, 8.871418], [-12.034835, 8.901183]]]}' >>> result = asyncio.run(kinks(polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-12.045, 8.885]}}]}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回所有自相交点的位置坐标 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_arcA | 创建圆弧线段。 此功能以给定点为中心,创建指定半径和方位角范围的圆弧线段。 Args: center: 中心点 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75, 40]}' Returns: str: JSON 字符串格式的 GeoJSON LineString 特征 - 类型: GeoJSON Feature with LineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> center = '{"type": "Point", "coordinates": [-75, 40]}' >>> options = '{"units": "miles", "steps": 32}' >>> result = asyncio.run(line_arc(center, 5.0, 25.0, 45.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-75, 40], ...]}}' Notes: - 输入参数 center 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 方位角是从北方向顺时针测量的角度 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_chunkA | 将线分割为指定长度的线段。 此功能将线或多线几何图形分割为多个指定长度的线段,便于分段处理和分析。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection, Geometry 或 Feature 规范,包含 LineString 或 MultiLineString - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[-95, 40], [-93, 45], [-85, 50]]}' Returns: str: JSON 字符串格式的线特征集合 - 类型: GeoJSON FeatureCollection with LineString features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[-95, 40], [-93, 45], [-85, 50]]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(line_chunk(line, 15.0, options)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}}, ...]}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果线长度小于分段长度,则返回原始线 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_intersectA | 计算两条线的交点。 此功能计算两条线或多边形几何图形之间的交点,返回所有交叉点的位置坐标。 Args: line1: 第一条线 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 支持 LineString、MultiLineString、Polygon、MultiPolygon - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[126, -11], [129, -21]]}' Returns: str: JSON 字符串格式的点特征集合 - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line1 = '{"type": "LineString", "coordinates": [[126, -11], [129, -21]]}' >>> line2 = '{"type": "LineString", "coordinates": [[123, -18], [131, -14]]}' >>> result = asyncio.run(line_intersect(line1, line2)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [127.5, -16]}}]}' Notes: - 输入参数 line1 和 line2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回两条线之间的所有交点 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_overlapA | 查找两条线的重叠部分。 此功能计算两条线几何图形之间的重叠线段,返回这些重叠部分的几何图形。 Args: line1: 第一条线 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 支持 LineString、MultiLineString、Polygon、MultiPolygon - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[115, -35], [125, -30], [135, -30], [145, -35]]}' Returns: str: JSON 字符串格式的线特征集合 - 类型: GeoJSON FeatureCollection with LineString features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line1 = '{"type": "LineString", "coordinates": [[115, -35], [125, -30], [135, -30], [145, -35]]}' >>> line2 = '{"type": "LineString", "coordinates": [[115, -25], [125, -30], [135, -30], [145, -25]]}' >>> result = asyncio.run(line_overlap(line1, line2)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[125, -30], [135, -30]]}}]}' Notes: - 输入参数 line1 和 line2 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回两条线之间的所有重叠线段 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_segmentA | 将几何图形分解为线段。 此功能将线或多边形几何图形分解为独立的线段,每个线段包含两个顶点坐标。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 支持 LineString、MultiLineString、Polygon、MultiPolygon - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]}' Returns: str: JSON 字符串格式的线特征集合 - 类型: GeoJSON FeatureCollection with LineString features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[-50, 5], [-40, -10], [-50, -10], [-40, 5], [-50, 5]]]}' >>> result = asyncio.run(line_segment(polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-50, 5], [-40, -10]]}}, ...]}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回所有几何图形的独立线段 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_sliceA | 在线段上截取指定起点和终点之间的部分。 此功能在线段上找到与起点和终点最近的位置,并截取这两点之间的线段部分。 Args: start_point: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-77.029609, 38.881946]}' Returns: str: JSON 字符串格式的 GeoJSON LineString 特征 - 类型: GeoJSON Feature with LineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> start = '{"type": "Point", "coordinates": [-77.029609, 38.881946]}' >>> end = '{"type": "Point", "coordinates": [-77.021884, 38.889563]}' >>> line = '{"type": "LineString", "coordinates": [[-77.031669, 38.878605], [-77.029609, 38.881946], [-77.020339, 38.884084], [-77.025661, 38.885821], [-77.021884, 38.889563], [-77.019824, 38.892368]]}' >>> result = asyncio.run(line_slice(start, end, line)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-77.029609, 38.881946], [-77.021884, 38.889563]]}}' Notes: - 输入参数 start_point、end_point 和 line 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 截取起点和终点之间的线段部分 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_slice_alongA | 沿线段长度截取指定距离范围的部分。 此功能根据起点距离和终点距离在线段上截取对应的部分,便于按长度分割线段。 Args: line: 线 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[7, 45], [9, 45], [14, 40], [14, 41]]}' Returns: str: JSON 字符串格式的 GeoJSON LineString 特征 - 类型: GeoJSON Feature with LineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[7, 45], [9, 45], [14, 40], [14, 41]]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(line_slice_along(line, 12.5, 25.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[...]]}}' Notes: - 输入参数 line 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 根据距离范围截取线段部分 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_line_splitA | 用分割器将线段分割为多段。 此功能使用分割器几何图形将线段分割为多个部分,返回分割后的线段集合。 Args: line: 线 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[120, -25], [145, -25]]}' Returns: str: JSON 字符串格式的线特征集合 - 类型: GeoJSON FeatureCollection with LineString features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[120, -25], [145, -25]]}' >>> splitter = '{"type": "LineString", "coordinates": [[130, -15], [130, -35]]}' >>> result = asyncio.run(line_split(line, splitter)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[120, -25], [130, -25]]}}, {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[130, -25], [145, -25]]}}]}' Notes: - 输入参数 line 和 splitter 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 使用分割器将线段分割为多个部分 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_maskA | 使用掩膜多边形裁剪几何图形。 此功能使用掩膜多边形对输入多边形进行裁剪,返回掩膜范围内的多边形部分。 Args: polygons: 输入多边形 GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 支持 Polygon、MultiPolygon、Feature、Feature、FeatureCollection<Polygon | MultiPolygon> - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]}' Returns: str: JSON 字符串格式的 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygons = '{"type": "Polygon", "coordinates": [[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]}' >>> mask_polygon = '{"type": "Polygon", "coordinates": [[[90, -55], [170, -55], [170, 10], [90, 10], [90, -55]]]}' >>> result = asyncio.run(mask(polygons, mask_polygon)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}}' Notes: - 输入参数 polygons 和 mask_polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果未提供掩膜多边形,则使用世界范围作为掩膜 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_nearest_point_on_lineA | 找到线上距离给定点最近的位置。 此功能在线段上找到距离给定点最近的位置,返回该位置坐标及距离信息。 Args: line: 线 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[-77.031669, 38.878605], [-77.029609, 38.881946], [-77.020339, 38.884084], [-77.025661, 38.885821], [-77.021884, 38.889563], [-77.019824, 38.892368]]}' Returns: str: JSON 字符串格式的 GeoJSON Point 特征 - 类型: GeoJSON Feature with Point geometry - 格式: {"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}, "properties": {"location": 距离起点位置, "distance": 距离值}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[-77.031669, 38.878605], [-77.029609, 38.881946], [-77.020339, 38.884084], [-77.025661, 38.885821], [-77.021884, 38.889563], [-77.019824, 38.892368]]}' >>> point = '{"type": "Point", "coordinates": [-77.037076, 38.884017]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(nearest_point_on_line(line, point, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-77.03, 38.883]}, "properties": {"location": 0.5, "distance": 0.2}}' Notes: - 输入参数 line 和 point 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回线上距离给定点最近的位置及相关信息 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_sectorA | 创建扇形多边形区域。 此功能以给定点为中心,创建指定半径和方位角范围的扇形多边形区域。 Args: center: 中心点 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75, 40]}' Returns: str: JSON 字符串格式的 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> center = '{"type": "Point", "coordinates": [-75, 40]}' >>> options = '{"units": "miles", "steps": 32}' >>> result = asyncio.run(sector(center, 5.0, 25.0, 45.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-75, 40], ...]]}}' Notes: - 输入参数 center 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 方位角是从北方向顺时针测量的角度 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_shortest_pathA | 计算两点之间的最短路径。 此功能计算两个地理点之间的最短路径,考虑障碍物和地形因素,返回最优路径线段。 Args: start_point: 起点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-122, 48]}' Returns: str: JSON 字符串格式的 GeoJSON LineString 特征 - 类型: GeoJSON Feature with LineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> start = '{"type": "Point", "coordinates": [-122, 48]}' >>> end = '{"type": "Point", "coordinates": [-77, 39]}' >>> options = '{"resolution": 100}' >>> result = asyncio.run(shortest_path(start, end, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-122, 48], ...]]}}' Notes: - 输入参数 start_point 和 end_point 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算两点之间的最短路径,考虑地理因素 - 依赖于 Turf.js 库和 Node.js 环境 |
| misc_unkink_polygonA | 消除多边形中的自相交部分。 此功能检测并消除多边形中的自相交部分(扭结),返回无自相交的多边形集合。 Args: polygon: 多边形 GeoJSON 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Polygon 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [0, 2], [2, 2], [0, 0]]]}' Returns: str: JSON 字符串格式的多边形特征集合 - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}}, ...]} Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Polygon", "coordinates": [[[0, 0], [2, 0], [0, 2], [2, 2], [0, 0]]]}' >>> result = asyncio.run(unkink_polygon(polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, 0], [1, 1], [0, 2], [0, 0]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[1, 1], [2, 0], [2, 2], [1, 1]]]}}]}' Notes: - 输入参数 polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 消除多边形中的自相交部分,返回多个无自相交的多边形 - 依赖于 Turf.js 库和 Node.js 环境 |
| random_randomPositionA | 生成随机的地理坐标位置。 此功能在指定的边界框内随机生成一个地理坐标位置,返回经度和纬度坐标。 Args: bbox: 边界框数组 - 类型: str (JSON 字符串格式的数组) 或 None - 格式: [minX, minY, maxX, maxY] - 默认: [-180, -90, 180, 90] (全球范围) - 示例: '[-180, -90, 180, 90]' Returns: str: JSON 字符串格式的坐标位置数组 - 类型: 数组 [经度, 纬度] - 格式: [lng, lat] - 示例: '[-75.343, 39.984]' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> bbox = '[-180, -90, 180, 90]' >>> result = asyncio.run(randomPosition(bbox)) >>> print(result) '[-75.343, 39.984]' Notes: - 输入参数 bbox 必须是有效的 JSON 字符串或 None - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果未指定边界框,默认在全球范围内生成随机位置 - 依赖于 Turf.js 库和 Node.js 环境 |
| random_randomPointA | 生成随机点特征集合。 此功能在指定边界框内生成指定数量的随机点,返回点特征集合。 Args: count: 生成点的数量 - 类型: int - 默认: 1 - 示例: 25 Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Point features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [lng, lat]}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> result = asyncio.run(randomPoint(25)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-75.343, 39.984]}}, ...]}' Notes: - 输入参数 options 必须是有效的 JSON 字符串或 None - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果未指定边界框,默认在全球范围内生成随机点 - 依赖于 Turf.js 库和 Node.js 环境 |
| random_randomLineStringA | 生成随机线特征集合。 此功能在指定边界框内生成指定数量的随机线,返回线特征集合。 Args: count: 生成线的数量 - 类型: int - 默认: 1 - 示例: 25 Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with LineString features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> result = asyncio.run(randomLineString(25)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}}, ...]}' Notes: - 输入参数 options 必须是有效的 JSON 字符串或 None - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果未指定边界框,默认在全球范围内生成随机线 - 依赖于 Turf.js 库和 Node.js 环境 |
| random_randomPolygonA | 生成随机多边形特征集合。 此功能在指定边界框内生成指定数量的随机多边形,返回多边形特征集合。 Args: count: 生成多边形的数量 - 类型: int - 默认: 1 - 示例: 25 Returns: str: JSON 字符串格式的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}}, ...]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> result = asyncio.run(randomPolygon(25)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]}}, ...]}' Notes: - 输入参数 options 必须是有效的 JSON 字符串或 None - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果未指定边界框,默认在全球范围内生成随机多边形 - 多边形会自动闭合,首尾坐标点相同 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_bboxClipA | 将 GeoJSON 特征裁剪到指定的边界框内。 此功能将输入的 GeoJSON 特征(线或多边形)裁剪到给定的边界框范围内,只保留边界框内的部分。 Args: feature: GeoJSON 特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Feature 规范,支持 LineString、MultiLineString、Polygon、MultiPolygon - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]}}' Returns: str: JSON 字符串格式的裁剪后的 GeoJSON 特征 - 类型: GeoJSON Feature with LineString, MultiLineString, Polygon, or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [10, 8], [3, 7], [2, 2]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> feature = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]}}' >>> bbox = '[0, 0, 10, 10]' >>> result = asyncio.run(bboxClip(feature, bbox)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[2, 2], [8, 4], [10, 8], [3, 7], [2, 2]]]}}' Notes: - 输入参数 feature 和 bbox 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 裁剪多边形时可能会产生退化边 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_bezierSplineA | 将直线转换为平滑的贝塞尔曲线。 此功能将输入的直线路径转换为平滑的曲线路径,使线条更加流畅自然。 Args: line: GeoJSON LineString 特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-76.091308, 18.427501], [-76.695556, 18.729501], [-76.552734, 19.40443]]}}' Returns: str: JSON 字符串格式的贝塞尔样条曲线 GeoJSON LineString 特征 - 类型: GeoJSON Feature with LineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-76.091308, 18.427501], [-76.5, 19.0], [-76.695556, 18.729501]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-76.091308, 18.427501], [-76.695556, 18.729501], [-76.552734, 19.40443]]}}' >>> options = '{"resolution": 20000, "sharpness": 0.5}' >>> result = asyncio.run(bezierSpline(line, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-76.091308, 18.427501], [-76.5, 19.0], [-76.695556, 18.729501]]}}' Notes: - 输入参数 line 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 生成的曲线会平滑原始 LineString 的路径 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_circleA | 根据中心点和半径创建圆形区域。 此功能以指定的中心点和半径生成一个圆形多边形区域,可以控制圆形的平滑度和单位。 Args: center: 中心点 GeoJSON Point 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Point 规范或坐标数组 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Point", "coordinates": [-75.343, 39.984]}' 或 '[-75.343, 39.984]' Returns: str: JSON 字符串格式的圆形 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-75.35, 39.99], [-75.34, 39.99], ...]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> center = '{"type": "Point", "coordinates": [-75.343, 39.984]}' >>> options = '{"steps": 32, "units": "miles"}' >>> result = asyncio.run(circle(center, 5.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-75.35, 39.99], [-75.34, 39.99], ...]]}}' Notes: - 输入参数 center 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - steps 参数控制圆的平滑度,值越大圆越平滑 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_cloneA | 创建 GeoJSON 对象的完整副本。 此功能创建输入 GeoJSON 对象的深拷贝,包括所有属性和几何信息。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}, "properties": {"color": "red"}}' Returns: str: JSON 字符串格式的克隆后的 GeoJSON 对象 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 与输入相同的格式,包含所有属性和外成员 - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}, "properties": {"color": "red"}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}, "properties": {"color": "red"}}' >>> result = asyncio.run(clone(geojson)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}, "properties": {"color": "red"}}' Notes: - 输入参数 geojson 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 此方法比 JSON.parse + JSON.stringify 更快 - 包含所有可能的"外成员"(非标准属性) - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_concaveA | 计算点集的凹包。 该函数使用 Turf.js 库的 concave 方法,从一组点生成凹包多边形。 Args: points: 点集 GeoJSON FeatureCollection - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范,包含 Point 特征 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-63.601226, 44.642643]}}, ...]}' Returns: str: JSON 字符串格式的凹包 GeoJSON Polygon 或 MultiPolygon 特征 - 类型: GeoJSON Feature with Polygon or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} 或 null(如果无法计算) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-63.6, 44.64], [-63.59, 44.65], ...]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-63.601226, 44.642643]}}]}' >>> options = '{"maxEdge": 1, "units": "miles"}' >>> result = asyncio.run(concave(points, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-63.6, 44.64], [-63.59, 44.65], ...]]}}' Notes: - 输入参数 points 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 内部使用 turf-tin 生成几何图形 - 如果无法计算凹包,返回 null - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_convexA | 计算点集的凸包。 该函数使用 Turf.js 库的 convex 方法,从一组点生成凸包多边形。 Args: points: 点集 GeoJSON FeatureCollection - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范,包含 Point 特征 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [10.195312, 43.755225]}}, ...]}' Returns: str: JSON 字符串格式的凸包 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[10.195312, 43.755225], [10.404052, 43.8424511], ...]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> points = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Point", "coordinates": [10.195312, 43.755225]}}]}' >>> result = asyncio.run(convex(points)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[10.195312, 43.755225], [10.404052, 43.8424511], ...]]}}' Notes: - 输入参数 points 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 凸包是包含所有点的最小凸多边形 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_differenceA | 计算两个多边形的差异。 该函数使用 Turf.js 库的 difference 方法,计算两个多边形的几何差异。 Args: featureCollection: 包含两个多边形的 GeoJSON FeatureCollection - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范,包含两个 Polygon 特征 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[128, -26], [141, -26], [141, -21], [128, -21], [128, -26]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[126, -28], [140, -28], [140, -20], [126, -20], [126, -28]]]}}]}' Returns: str: JSON 字符串格式的差异 GeoJSON Feature - 类型: GeoJSON Feature with Polygon or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[128, -26], [141, -26], ...]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> featureCollection = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[128, -26], [141, -26], [141, -21], [128, -21], [128, -26]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[126, -28], [140, -28], [140, -20], [126, -20], [126, -28]]]}}]}' >>> result = asyncio.run(difference(featureCollection)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[128, -26], [141, -26], ...]]}}' Notes: - 输入参数 featureCollection 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 计算第一个多边形与第二个多边形的差异 - 返回第一个多边形中不在第二个多边形中的部分 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_dissolveA | 合并相邻的多边形。 该函数使用 Turf.js 库的 dissolve 方法,合并相邻的多边形特征。 Args: featureCollection: 多边形特征集合 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范,包含 Polygon 特征 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, -1], [0, 0], [1, 0], [1, -1], [0,-1]]]}}]}' Returns: str: JSON 字符串格式的合并后的 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}}]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, -1], [0, 1], [1, 1], [1, -1], [0, -1]]]}}]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> featureCollection = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, 0], [0, 1], [1, 1], [1, 0], [0, 0]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, -1], [0, 0], [1, 0], [1, -1], [0,-1]]]}}]}' >>> options = '{"propertyName": "combine"}' >>> result = asyncio.run(dissolve(featureCollection, options)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0, -1], [0, 1], [1, 1], [1, -1], [0, -1]]]}}]}' Notes: - 输入参数 featureCollection 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 不支持 MultiPolygon 特征 - 如果提供 propertyName,只有具有相同属性值的多边形才会被合并 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_intersectA | 计算多边形的交集。 该函数使用 Turf.js 库的 intersect 方法,计算两个多边形的几何交集。 Args: featureCollection: 包含两个多边形的 GeoJSON FeatureCollection - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON FeatureCollection 规范,包含两个 Polygon 特征 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-122.801742, 45.48565], [-122.801742, 45.60491], [-122.584762, 45.60491], [-122.584762, 45.48565], [-122.801742, 45.48565]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-122.520217, 45.535693], [-122.64038, 45.553967], [-122.720031, 45.526554], [-122.669906, 45.507309], [-122.723464, 45.446643], [-122.532577, 45.408574], [-122.487258, 45.477466], [-122.520217, 45.535693]]]}}]}' Returns: str: JSON 字符串格式的交集 GeoJSON Feature - 类型: GeoJSON Feature with Polygon or MultiPolygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} 或 null(如果没有交集) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-122.6, 45.5], [-122.5, 45.5], ...]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> featureCollection = '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-122.801742, 45.48565], [-122.801742, 45.60491], [-122.584762, 45.60491], [-122.584762, 45.48565], [-122.801742, 45.48565]]]}}, {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-122.520217, 45.535693], [-122.64038, 45.553967], [-122.720031, 45.526554], [-122.669906, 45.507309], [-122.723464, 45.446643], [-122.532577, 45.408574], [-122.487258, 45.477466], [-122.520217, 45.535693]]]}}]}' >>> result = asyncio.run(intersect(featureCollection)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-122.6, 45.5], [-122.5, 45.5], ...]]}}' Notes: - 输入参数 featureCollection 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 如果没有交集,返回 null - 交集可以是 Point、LineString、Polygon 或 Multi* 几何类型 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_lineOffsetA | 计算线的偏移。 该函数使用 Turf.js 库的 lineOffset 方法,计算给定线的偏移线。 Args: line: GeoJSON LineString 或 MultiLineString 特征或几何图形 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON LineString 或 MultiLineString 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' Returns: str: JSON 字符串格式的偏移线 GeoJSON Feature - 类型: GeoJSON Feature with LineString or MultiLineString geometry - 格式: {"type": "Feature", "geometry": {"type": "LineString", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74.1, 40.1], [-78.1, 42.1], [-82.1, 35.1]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> line = '{"type": "LineString", "coordinates": [[-74, 40], [-78, 42], [-82, 35]]}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(lineOffset(line, 10.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "LineString", "coordinates": [[-74.1, 40.1], [-78.1, 42.1], [-82.1, 35.1]]}}' Notes: - 输入参数 line 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 距离可以为负值,表示相反方向的偏移 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_simplifyA | 简化 GeoJSON 几何。 该函数使用 Turf.js 库的 simplify 方法,简化给定的 GeoJSON 几何图形。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Polygon", "coordinates": [[[-70.603637, -33.399918], [-70.614624, -33.395332], [-70.639343, -33.392466], [-70.659942, -33.394759], [-70.683975, -33.404504], [-70.697021, -33.419406], [-70.701141, -33.434306], [-70.700454, -33.446339], [-70.694274, -33.458369], [-70.682601, -33.465816], [-70.668869, -33.472117], [-70.646209, -33.473835], [-70.624923, -33.472117], [-70.609817, -33.468107], [-70.595397, -33.458369], [-70.587158, -33.442901], [-70.587158, -33.426283], [-70.590591, -33.414248], [-70.594711, -33.406224], [-70.603637, -33.399918]]]}' Returns: str: JSON 字符串格式的简化后的 GeoJSON 对象 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 与输入相同的格式 - 示例: '{"type": "Polygon", "coordinates": [[[-70.603637, -33.399918], [-70.614624, -33.395332], [-70.639343, -33.392466], ...]]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "Polygon", "coordinates": [[[-70.603637, -33.399918], [-70.614624, -33.395332], [-70.639343, -33.392466], [-70.659942, -33.394759], [-70.683975, -33.404504], [-70.697021, -33.419406], [-70.701141, -33.434306], [-70.700454, -33.446339], [-70.694274, -33.458369], [-70.682601, -33.465816], [-70.668869, -33.472117], [-70.646209, -33.473835], [-70.624923, -33.472117], [-70.609817, -33.468107], [-70.595397, -33.458369], [-70.587158, -33.442901], [-70.587158, -33.426283], [-70.590591, -33.414248], [-70.594711, -33.406224], [-70.603637, -33.399918]]]}' >>> options = '{"tolerance": 0.01, "highQuality": true}' >>> result = asyncio.run(simplify(geojson, options)) >>> print(result) '{"type": "Polygon", "coordinates": [[[-70.603637, -33.399918], [-70.614624, -33.395332], [-70.639343, -33.392466], ...]]}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - tolerance 值越小,简化程度越低 - highQuality 为 true 时使用更精确但更慢的算法 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_tesselateA | 将多边形分割为三角形。 该函数使用 Turf.js 库的 tesselate 方法,将给定的多边形分割为三角形集合。 Args: polygon: GeoJSON Polygon 特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 必须符合 GeoJSON Polygon 规范 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]}}' Returns: str: JSON 字符串格式的三角形集合 GeoJSON FeatureCollection - 类型: GeoJSON FeatureCollection with Polygon features - 格式: {"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}}]} - 示例: '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[11, 0], [22, 4], [31, 0], [11, 0]]]}}, ...]}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> polygon = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]}}' >>> result = asyncio.run(tesselate(polygon)) >>> print(result) '{"type": "FeatureCollection", "features": [{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[11, 0], [22, 4], [31, 0], [11, 0]]]}}, ...]}' Notes: - 输入参数 polygon 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 返回的三角形集合覆盖原始多边形的整个区域 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_transformRotateA | 旋转 GeoJSON 对象。 该函数使用 Turf.js 库的 transformRotate 方法,围绕质心或指定枢轴点旋转 GeoJSON 对象。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' Returns: str: JSON 字符串格式的旋转后的 GeoJSON 对象 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 与输入相同的格式 - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.5,29.2],[3.8,29.1],[2.7,32.3],[0.5,29.2]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' >>> options = '{"pivot": [0, 25]}' >>> result = asyncio.run(transformRotate(geojson, 10.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.5,29.2],[3.8,29.1],[2.7,32.3],[0.5,29.2]]]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 角度为十进制度数,顺时针为正 - 默认围绕几何图形的质心旋转 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_transformTranslateA | 平移 GeoJSON 对象。 该函数使用 Turf.js 库的 transformTranslate 方法,沿恒向线移动 GeoJSON 对象。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' Returns: str: JSON 字符串格式的平移后的 GeoJSON 对象 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 与输入相同的格式 - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.6,29.3],[4.1,29.3],[3.1,32.3],[0.6,29.3]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(transformTranslate(geojson, 100.0, 35.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0.6,29.3],[4.1,29.3],[3.1,32.3],[0.6,29.3]]]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 方向从北方向顺时针测量 - 距离可以为负值,表示相反方向移动 - 依赖于 Turf.js 库和 Node.js 环境 |
| transformation_transformScaleA | 缩放 GeoJSON 对象。 该函数使用 Turf.js 库的 transformScale 方法,从给定点缩放 GeoJSON 对象。 Args: geojson: GeoJSON 对象 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' Returns: str: JSON 字符串格式的缩放后的 GeoJSON 对象 - 类型: 与输入相同的 GeoJSON 类型 - 格式: 与输入相同的格式 - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[10.5,29],[7.5,32],[0,29]]]}}' Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常 Example: >>> import asyncio >>> geojson = '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[3.5,29],[2.5,32],[0,29]]]}}' >>> result = asyncio.run(transformScale(geojson, 3.0)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[0,29],[10.5,29],[7.5,32],[0,29]]]}}' Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 缩放因子为 2 表示尺寸加倍 - 默认从几何图形的质心缩放 - 对于 FeatureCollection,为每个特征单独计算原点 - 依赖于 Turf.js 库和 Node.js 环境 |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/es3154/turf-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server