get_utm_zone
Determine the UTM zone for specific geographic coordinates to facilitate accurate geospatial analysis and coordinate transformations using GIS operations.
Instructions
Get UTM zone for given coordinates.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| coordinates | Yes |
Implementation Reference
- src/gis_mcp/pyproj_functions.py:217-239 (handler)The handler function implementing the 'get_utm_zone' tool. It computes the UTM zone for given longitude and latitude coordinates using pyproj's database query.@gis_mcp.tool() def get_utm_zone(coordinates: List[float]) -> Dict[str, Any]: """Get UTM zone for given coordinates.""" try: import pyproj lon, lat = coordinates zone = pyproj.database.query_utm_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_authority()[1] return { "status": "success", "zone": zone, "message": "UTM zone retrieved successfully" } except Exception as e: logger.error(f"Error getting UTM zone: {str(e)}") raise ValueError(f"Failed to get UTM zone: {str(e)}")
- src/gis_mcp/pyproj_functions.py:19-30 (registration)Resource listing that registers 'get_utm_zone' as an available operation under gis://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" ] }