Skip to main content
Glama

get_geod_info

Retrieve geodetic calculation parameters like ellipsoid dimensions and flattening for accurate coordinate transformations in GIS analysis.

Instructions

Get information about a geodetic calculation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ellpsNoWGS84
aNo
bNo
fNo

Implementation Reference

  • The handler function for the 'get_geod_info' tool, decorated with @gis_mcp.tool(). It creates a pyproj.Geod object and returns ellipsoid parameters (a, b, f, es, e).
    @gis_mcp.tool()
    def get_geod_info(ellps: str = "WGS84", a: Optional[float] = None,
                    b: Optional[float] = None, f: Optional[float] = None) -> Dict[str, Any]:
        """Get information about a geodetic calculation."""
        try:
            import pyproj
            geod = pyproj.Geod(ellps=ellps, a=a, b=b, f=f)
            # Calculate e (eccentricity) from es (first eccentricity squared)
            e = (geod.es ** 0.5) if geod.es >= 0 else None
            
            return {
                "status": "success",
                "ellps": ellps,  # Return the parameter, not attribute
                "ellipsoid": ellps,  # Also include as ellipsoid for compatibility
                "a": geod.a,
                "b": geod.b,
                "f": geod.f,
                "es": geod.es,
                "e": e,
                "message": "Geodetic information retrieved successfully"
            }
        except Exception as e:
            logger.error(f"Error getting geodetic info: {str(e)}")
            raise ValueError(f"Failed to get geodetic info: {str(e)}")
  • Import of pyproj_functions.py in the main entry point, which executes the @gis_mcp.tool() decorators to register the 'get_geod_info' tool with the FastMCP instance.
    from . import (
        geopandas_functions,
        shapely_functions,
        rasterio_functions,
        pyproj_functions,
        pysal_functions,
    )
  • GIS resource that lists 'get_geod_info' as one of the available geodetic operations for discovery.
    @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"
            ]
        }

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