Skip to main content
Glama

buffer

Generate a buffer zone around a specified geometry to analyze spatial relationships. Define distance, resolution, join style, mitre limit, and single-sided options for precise geospatial calculations.

Instructions

Create a buffer around a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
distanceYes
geometryYes
join_styleNo
mitre_limitNo
resolutionNo
single_sidedNo

Implementation Reference

  • The handler function for the 'buffer' MCP tool. It takes a WKT geometry string and parameters to create a buffer using Shapely's buffer method and returns the buffered geometry as WKT.
    @gis_mcp.tool() def buffer(geometry: str, distance: float, resolution: int = 16, join_style: int = 1, mitre_limit: float = 5.0, single_sided: bool = False) -> Dict[str, Any]: """Create a buffer around a geometry.""" try: from shapely import wkt geom = wkt.loads(geometry) buffered = geom.buffer( distance=distance, resolution=resolution, join_style=join_style, mitre_limit=mitre_limit, single_sided=single_sided ) return { "status": "success", "geometry": buffered.wkt, "message": "Buffer created successfully" } except Exception as e: logger.error(f"Error creating buffer: {str(e)}") raise ValueError(f"Failed to create buffer: {str(e)}")
  • Resource listing that includes 'buffer' as one of the basic geometric operations available.
    @gis_mcp.resource("gis://operations/basic") def get_basic_operations() -> Dict[str, List[str]]: """List available basic geometric operations.""" return { "operations": [ "buffer", "intersection", "union", "difference", "symmetric_difference" ] }
  • Function signature providing the input schema (type hints) and output type for the buffer tool.
    def buffer(geometry: str, distance: float, resolution: int = 16, join_style: int = 1, mitre_limit: float = 5.0, single_sided: bool = False) -> Dict[str, Any]:

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