get_crs_info
Retrieve coordinate reference system details to understand spatial data projections and transformations for accurate geospatial analysis.
Instructions
Get information about a CRS.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| crs | Yes |
Implementation Reference
- src/gis_mcp/pyproj_functions.py:86-107 (handler)The primary handler function for the 'get_crs_info' tool. It takes a CRS identifier as input and returns detailed information about the CRS using the pyproj library, including name, type, axis info, geographic/projected status, datum, ellipsoid, prime meridian, and area of use.@gis_mcp.tool() def get_crs_info(crs: str) -> Dict[str, Any]: """Get information about a CRS.""" try: import pyproj crs_obj = pyproj.CRS(crs) return { "status": "success", "name": crs_obj.name, "type": crs_obj.type_name, "axis_info": [axis.direction for axis in crs_obj.axis_info], "is_geographic": crs_obj.is_geographic, "is_projected": crs_obj.is_projected, "datum": str(crs_obj.datum), "ellipsoid": str(crs_obj.ellipsoid), "prime_meridian": str(crs_obj.prime_meridian), "area_of_use": str(crs_obj.area_of_use) if crs_obj.area_of_use else None, "message": "CRS information retrieved successfully" } except Exception as e: logger.error(f"Error getting CRS info: {str(e)}") raise ValueError(f"Failed to get CRS info: {str(e)}")
- src/gis_mcp/pyproj_functions.py:19-30 (registration)MCP resource endpoint that lists the available CRS-related tool operations under 'gis://crs/info', explicitly including 'get_crs_info'.@gis_mcp.resource("gis://crs/info") def get_crs_info_operations() -> Dict[str, List[str]]: """List available CRS information operations.""" return { "operations": [ "get_crs_info", "get_available_crs", "get_utm_zone", "get_utm_crs", "get_geocentric_crs" ] }