get_geocentric_crs
Convert specified coordinates to a geocentric coordinate reference system (CRS) using the GIS MCP Server, enabling accurate geospatial data transformation and analysis.
Instructions
Get geocentric CRS for given coordinates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coordinates | Yes |
Implementation Reference
- src/gis_mcp/pyproj_functions.py:265-287 (handler)The handler function implementing the get_geocentric_crs tool. It uses pyproj to query the geocentric CRS based on provided coordinates and returns the CRS in WKT format.@gis_mcp.tool() def get_geocentric_crs(coordinates: List[float]) -> Dict[str, Any]: """Get geocentric CRS for given coordinates.""" try: import pyproj lon, lat = coordinates crs = pyproj.database.query_geocentric_crs_info( datum_name="WGS84", area_of_interest=pyproj.aoi.AreaOfInterest( west_lon_degree=lon, south_lat_degree=lat, east_lon_degree=lon, north_lat_degree=lat ) )[0].to_wkt() return { "status": "success", "crs": crs, "message": "Geocentric CRS retrieved successfully" } except Exception as e: logger.error(f"Error getting geocentric CRS: {str(e)}") raise ValueError(f"Failed to get geocentric CRS: {str(e)}")
- src/gis_mcp/pyproj_functions.py:19-30 (registration)MCP resource that lists available CRS information operations, registering 'get_geocentric_crs' as one of them.@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" ] }