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
| Name | Required | Description | Default |
|---|---|---|---|
| feature_collection | Yes |