calculate_geodetic_point
Calculate a new geographic point from a starting location using distance and direction for geospatial analysis and mapping applications.
Instructions
Calculate point at given distance and azimuth.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| start_point | Yes | ||
| azimuth | Yes | ||
| distance | Yes | ||
| ellps | No | WGS84 |
Implementation Reference
- src/gis_mcp/pyproj_functions.py:202-220 (handler)The core handler function for the 'calculate_geodetic_point' MCP tool. It is decorated with @gis_mcp.tool(), which registers it as an MCP tool. The function computes a new geodetic point using pyproj.Geod.fwd given a starting point, azimuth, distance, and ellipsoid parameters.@gis_mcp.tool() def calculate_geodetic_point(start_point: List[float], azimuth: float, distance: float, ellps: str = "WGS84") -> Dict[str, Any]: """Calculate point at given distance and azimuth.""" try: import pyproj geod = pyproj.Geod(ellps=ellps) lon, lat = start_point lon2, lat2, back_azimuth = geod.fwd(lon, lat, azimuth, distance) return { "status": "success", "point": [lon2, lat2], "back_azimuth": back_azimuth, "ellps": ellps, "message": "Geodetic point calculated successfully" } except Exception as e: logger.error(f"Error calculating geodetic point: {str(e)}") raise ValueError(f"Failed to calculate geodetic point: {str(e)}")
- src/gis_mcp/pyproj_functions.py:33-42 (registration)Resource listing that advertises the availability of the 'calculate_geodetic_point' tool under the 'gis://crs/geodetic' namespace, aiding in tool discovery.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" ] }