envelope
Calculate the bounding box for any geometry to define its spatial extent for mapping and analysis.
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 core handler function for the 'envelope' MCP tool, which computes the bounding box (envelope) of an input geometry provided as WKT string using Shapely library and returns the result as WKT with status information.@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)}")