Skip to main content
Glama

voronoi

Generate Voronoi diagrams from point data to visualize spatial proximity and territory allocation for geospatial analysis.

Instructions

Create a Voronoi diagram from points.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The handler function for the 'voronoi' tool. It takes a WKT string of points, computes the Voronoi diagram using shapely.ops.voronoi_diagram, and returns the result as WKT.
    def voronoi(geometry: str) -> Dict[str, Any]:
        """Create a Voronoi diagram from points."""
        try:
            from shapely import wkt
            from shapely.ops import voronoi_diagram
            geom = wkt.loads(geometry)
            result = voronoi_diagram(geom)
            return {
                "status": "success",
                "geometry": result.wkt,
                "message": "Voronoi diagram created successfully"
            }
        except Exception as e:
            logger.error(f"Error creating Voronoi diagram: {str(e)}")
            raise ValueError(f"Failed to create Voronoi diagram: {str(e)}")
  • Resource listing that registers 'voronoi' as an available advanced GIS operation.
    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