Skip to main content
Glama

calculate_geodetic_area

Use geodetic calculations to determine the area of a polygon, accounting for Earth’s curvature. Ideal for precise geospatial analysis in GIS workflows.

Instructions

Calculate area of a polygon using geodetic calculations.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ellpsNoWGS84
geometryYes

Implementation Reference

  • The core handler function for the 'calculate_geodetic_area' tool. It takes a WKT geometry string and ellipsoid name (default WGS84), parses the polygon with shapely, computes the geodetic area using pyproj.Geod.geometry_area_perimeter, and returns the area in square meters along with status and message.
    @gis_mcp.tool() def calculate_geodetic_area(geometry: str, ellps: str = "WGS84") -> Dict[str, Any]: """Calculate area of a polygon using geodetic calculations.""" try: import pyproj from shapely import wkt geod = pyproj.Geod(ellps=ellps) polygon = wkt.loads(geometry) area = abs(geod.geometry_area_perimeter(polygon)[0]) return { "status": "success", "area": float(area), "ellps": ellps, "message": "Geodetic area calculated successfully" } except Exception as e: logger.error(f"Error calculating geodetic area: {str(e)}") raise ValueError(f"Failed to calculate geodetic area: {str(e)}")
  • GIS MCP resource 'gis://crs/geodetic' that lists 'calculate_geodetic_area' as one of the available geodetic operations, providing tool discovery and implicit schema information.
    @gis_mcp.resource("gis://crs/geodetic") def get_geodetic_operations() -> Dict[str, List[str]]: """List available geodetic operations.""" return { "operations": [ "get_geod_info", "calculate_geodetic_distance", "calculate_geodetic_point", "calculate_geodetic_area" ] }

Other Tools

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

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