Skip to main content
Glama

minimum_rotated_rectangle

Calculate the minimum rotated rectangle enclosing a given geometry using GIS MCP Server, enabling precise geospatial analysis for efficient boundary estimation and spatial modeling.

Instructions

Get minimum rotated rectangle of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The main handler function for the 'minimum_rotated_rectangle' tool. It parses input WKT geometry, computes the minimum rotated rectangle using Shapely.geometry.minimum_rotated_rectangle, and returns the result as WKT in a success dictionary.
    @gis_mcp.tool() def minimum_rotated_rectangle(geometry: str) -> Dict[str, Any]: """Get minimum rotated rectangle of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) result = geom.minimum_rotated_rectangle return { "status": "success", "geometry": result.wkt, "message": "Minimum rotated rectangle created successfully" } except Exception as e: logger.error(f"Error creating minimum rotated rectangle: {str(e)}") raise ValueError(f"Failed to create minimum rotated rectangle: {str(e)}")
  • MCP resource listing geometric operations available, including 'minimum_rotated_rectangle', serving as a discovery/schema for tool availability.
    @gis_mcp.resource("gis://operations/geometric") def get_geometric_properties() -> Dict[str, List[str]]: """List available geometric property operations.""" return { "operations": [ "convex_hull", "envelope", "minimum_rotated_rectangle", "get_centroid", "get_bounds", "get_coordinates", "get_geometry_type" ] }

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/mahdin75/gis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server