Skip to main content
Glama

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
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • 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)}")

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mahdin75/gis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server