Skip to main content
Glama

Turf-MCP

by es3154

transformation_concave

Calculate concave hulls from point sets to identify natural boundaries and spatial clusters in geographic data using Turf.js geospatial analysis.

Instructions

计算点集的凹包。

该函数使用 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]}}, ...]}'

options: 可选参数配置 - 类型: str (JSON 字符串) 或 None - 可选字段: - maxEdge: 凹包边缘的最大长度 (默认: Infinity) - units: 距离单位 (默认: 'kilometers') - 有效值: 'miles', 'nauticalmiles', 'kilometers', 'meters', 'yards', 'feet', 'inches' - 示例: '{"maxEdge": 1, "units": "miles"}'

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 环境

Input Schema

NameRequiredDescriptionDefault
optionsNo
pointsYes

Input Schema (JSON Schema)

{ "properties": { "options": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null }, "points": { "type": "string" } }, "required": [ "points" ], "type": "object" }

Other Tools from Turf-MCP

Related Tools

    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