Skip to main content
Glama

triangulate_geometry

Generate triangulated mesh from geometry for geospatial analysis, enabling precise modeling and spatial measurements in GIS operations via the MCP server.

Instructions

Create a triangulation of a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The core handler function for the 'triangulate_geometry' tool. It parses WKT input, uses shapely.ops.triangulate to generate triangles, and returns their WKT representations.
    @gis_mcp.tool() def triangulate_geometry(geometry: str) -> Dict[str, Any]: """Create a triangulation of a geometry.""" try: from shapely import wkt from shapely.ops import triangulate geom = wkt.loads(geometry) triangles = triangulate(geom) return { "status": "success", "geometries": [tri.wkt for tri in triangles], "message": "Triangulation created successfully" } except Exception as e: logger.error(f"Error creating triangulation: {str(e)}") raise ValueError(f"Failed to create triangulation: {str(e)}")
  • Helper resource that lists 'triangulate_geometry' among available advanced GIS operations.
    @gis_mcp.resource("gis://operations/advanced") def get_advanced_operations() -> Dict[str, List[str]]: """List available advanced operations.""" return { "operations": [ "triangulate_geometry", "voronoi", "unary_union_geometries" ] }

Other Tools

Related Tools

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