Skip to main content
Glama

simplify

Reduce the complexity of geometric shapes by removing unnecessary vertices while preserving essential spatial characteristics, enabling efficient geospatial analysis.

Instructions

Simplify a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes
preserve_topologyNo
toleranceYes

Implementation Reference

  • The handler function implementing the 'simplify' tool. It parses WKT geometry, applies Shapely's simplify with given tolerance and topology preservation, returns simplified WKT or raises error.
    @gis_mcp.tool() def simplify(geometry: str, tolerance: float, preserve_topology: bool = True) -> Dict[str, Any]: """Simplify a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) result = geom.simplify(tolerance=tolerance, preserve_topology=preserve_topology) return { "status": "success", "geometry": result.wkt, "message": "Geometry simplified successfully" } except Exception as e: logger.error(f"Error simplifying geometry: {str(e)}") raise ValueError(f"Failed to simplify geometry: {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