Skip to main content
Glama

difference

Calculate the difference between two geometric shapes to analyze spatial relationships and identify variations in GIS data using the GIS MCP Server.

Instructions

Find difference between geometries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometry1Yes
geometry2Yes

Implementation Reference

  • The main handler function for the MCP 'difference' tool. It takes two WKT geometry strings, computes their set difference using Shapely.geometry.difference, and returns the result as WKT with status and message.
    @gis_mcp.tool() def difference(geometry1: str, geometry2: str) -> Dict[str, Any]: """Find difference between geometries.""" try: from shapely import wkt geom1 = wkt.loads(geometry1) geom2 = wkt.loads(geometry2) result = geom1.difference(geom2) return { "status": "success", "geometry": result.wkt, "message": "Difference created successfully" } except Exception as e: logger.error(f"Error creating difference: {str(e)}") raise ValueError(f"Failed to create difference: {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