envelope
Calculate the bounding box of a geometry using the GIS MCP Server, enabling precise geospatial analysis and integration with AI-driven workflows.
Instructions
Get bounding box of a geometry.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geometry | Yes |
Implementation Reference
- src/gis_mcp/shapely_functions.py:205-219 (handler)The handler function for the "envelope" MCP tool. It takes a WKT geometry string, loads it with Shapely, computes the envelope (bounding box), and returns the result as WKT in a success dictionary.@gis_mcp.tool() def envelope(geometry: str) -> Dict[str, Any]: """Get bounding box of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) result = geom.envelope return { "status": "success", "geometry": result.wkt, "message": "Envelope created successfully" } except Exception as e: logger.error(f"Error creating envelope: {str(e)}") raise ValueError(f"Failed to create envelope: {str(e)}")