Skip to main content
Glama

unary_union_geometries

Merge multiple geometries into a single unified shape using the GIS MCP Server, enabling efficient geospatial analysis and simplifying complex spatial datasets.

Instructions

Create a union of multiple geometries.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometriesYes

Implementation Reference

  • The handler function for the 'unary_union_geometries' tool. It takes a list of WKT geometry strings, loads them using shapely.wkt.loads, computes the unary union using shapely.ops.unary_union, and returns the result as WKT in a success dict. Registered via @gis_mcp.tool() decorator.
    @gis_mcp.tool() def unary_union_geometries(geometries: List[str]) -> Dict[str, Any]: """Create a union of multiple geometries.""" try: from shapely import wkt from shapely.ops import unary_union geoms = [wkt.loads(g) for g in geometries] result = unary_union(geoms) return { "status": "success", "geometry": result.wkt, "message": "Union created successfully" } except Exception as e: logger.error(f"Error creating union: {str(e)}") raise ValueError(f"Failed to create union: {str(e)}")
  • Resource handler listing 'unary_union_geometries' among advanced operations available via gis://operations/advanced.
    @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" ] }

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