Skip to main content
Glama

translate_geometry

Shift geometries by specified offsets in X, Y, and Z dimensions to reposition or align spatial data within a GIS environment using the GIS MCP Server.

Instructions

Translate a geometry.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes
xoffYes
yoffYes
zoffNo

Implementation Reference

  • The core handler function for the 'translate_geometry' MCP tool. It parses WKT input geometry, applies translation using shapely.affinity.translate with xoff, yoff, zoff offsets, and returns the resulting WKT geometry wrapped in a success dict.
    @gis_mcp.tool() def translate_geometry(geometry: str, xoff: float, yoff: float, zoff: float = 0.0) -> Dict[str, Any]: """Translate a geometry.""" try: from shapely import wkt from shapely.affinity import translate geom = wkt.loads(geometry) result = translate(geom, xoff=xoff, yoff=yoff, zoff=zoff) return { "status": "success", "geometry": result.wkt, "message": "Geometry translated successfully" } except Exception as e: logger.error(f"Error translating geometry: {str(e)}") raise ValueError(f"Failed to translate geometry: {str(e)}")
  • Helper resource that lists available geometric transformation operations, including 'translate_geometry', accessible at gis://operations/transformations.
    @gis_mcp.resource("gis://operations/transformations") def get_transformations() -> Dict[str, List[str]]: """List available geometric transformations.""" return { "operations": [ "rotate_geometry", "scale_geometry", "translate_geometry" ] }
  • The @gis_mcp.tool() decorator registers the translate_geometry function as an MCP tool.
    @gis_mcp.tool()

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