get_geometry_type
Identify the geometry type (e.g., point, line, polygon) of a given geospatial shape. Enables precise geospatial analysis by determining the structure of input geometries for GIS operations.
Instructions
Get the type of a geometry.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| geometry | Yes |
Implementation Reference
- src/gis_mcp/shapely_functions.py:283-297 (handler)The handler function decorated with @gis_mcp.tool(), which parses WKT input geometry using Shapely, retrieves its geom_type, and returns it in a structured dictionary with status and message.@gis_mcp.tool() def get_geometry_type(geometry: str) -> Dict[str, Any]: """Get the type of a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) return { "status": "success", "type": geom.geom_type, "message": "Geometry type retrieved successfully" } except Exception as e: logger.error(f"Error getting geometry type: {str(e)}") raise ValueError(f"Failed to get geometry type: {str(e)}")