Skip to main content
Glama
es3154
by es3154

measurement_envelope

Convert geographic objects into bounding box polygons for spatial analysis and geometric operations using GeoJSON data.

Instructions

将地理对象转换为边界框多边形。

此功能计算给定地理对象的边界框,并将其转换为完整的多边形几何图形,便于进行多边形操作。

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

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geojsonYes

Other Tools

Latest Blog Posts

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