get_geometry_type
Determine the geometry type from a given geometry string to enable accurate geospatial analysis and classification within GIS workflows.
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-296 (handler)The handler function decorated with @gis_mcp.tool() that implements the get_geometry_type tool. It takes a WKT geometry string, loads it with Shapely, and returns the geometry type (e.g., 'Point', 'LineString') along 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)}")