Skip to main content
Glama

Turf-MCP

by es3154

feature_conversion_combine

Combine GeoJSON point, line, or polygon feature collections into composite MultiPoint, MultiLineString, or MultiPolygon geometries for simplified spatial data management.

Instructions

将特征集合合并为复合几何图形。

此功能将点、线或多边形特征集合分别合并为多点、多线或多边形复合几何图形。

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

Input Schema

NameRequiredDescriptionDefault
feature_collectionYes

Input Schema (JSON Schema)

{ "properties": { "feature_collection": { "type": "string" } }, "required": [ "feature_collection" ], "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