transformation_buffer
Create buffer zones around GeoJSON features with specified radius to define spatial boundaries and proximity areas for geographic analysis.
Instructions
为 GeoJSON 特征创建缓冲区。
此功能为输入的 GeoJSON 特征创建指定半径的缓冲区多边形。
Args: geojson: GeoJSON 特征 - 类型: str (JSON 字符串格式的 GeoJSON) - 格式: 任何有效的 GeoJSON 对象 - 坐标系: WGS84 (经度在前,纬度在后) - 示例: '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-90.548630, 14.616599]}}'
Returns: str: JSON 字符串格式的缓冲区 GeoJSON Polygon 特征 - 类型: GeoJSON Feature with Polygon geometry - 格式: {"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [...]}} - 示例: '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-90.55, 14.62], ...]]}}'
Raises: Exception: 当 JavaScript 执行失败、超时或输入数据格式错误时抛出异常
Example: >>> import asyncio >>> geojson = '{"type": "Feature", "geometry": {"type": "Point", "coordinates": [-90.548630, 14.616599]}}' >>> options = '{"units": "miles"}' >>> result = asyncio.run(buffer(geojson, 500.0, options)) >>> print(result) '{"type": "Feature", "geometry": {"type": "Polygon", "coordinates": [[[-90.55, 14.62], ...]]}}'
Notes: - 输入参数 geojson 和 options 必须是有效的 JSON 字符串 - 坐标顺序为 [经度, 纬度] (WGS84 坐标系) - 可以为点、线、多边形等几何类型创建缓冲区 - 依赖于 Turf.js 库和 Node.js 环境
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geojson | Yes | ||
| options | No | ||
| radius | Yes |