Skip to main content
Glama

normalize_geometry

Standardize the orientation and order of geometric data in WKT format for consistent analysis and processing within the GIS MCP Server environment.

Instructions

Normalize the orientation/order of a geometry using shapely.normalize. Args: geometry: WKT string of the geometry. Returns: Dictionary with status, message, and normalized geometry as WKT.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometryYes

Implementation Reference

  • The main execution handler for the 'normalize_geometry' tool. It takes a WKT geometry string, normalizes it using Shapely's normalize function, and returns the result as WKT with status.
    @gis_mcp.tool() def normalize_geometry(geometry: str) -> Dict[str, Any]: """ Normalize the orientation/order of a geometry using shapely.normalize. Args: geometry: WKT string of the geometry. Returns: Dictionary with status, message, and normalized geometry as WKT. """ try: from shapely import wkt, normalize geom = wkt.loads(geometry) normalized = normalize(geom) return { "status": "success", "geometry": normalized.wkt, "message": "Geometry normalized successfully" } except Exception as e: logger.error(f"Error in normalize_geometry: {str(e)}") return {"status": "error", "message": str(e)}
  • Resource registration that lists 'normalize_geometry' among available Shapely utility operations for discovery.
    @gis_mcp.resource("gis://operations/shapely_util") def get_shapely_util_operations() -> Dict[str, List[str]]: """List available Shapely utility/advanced operations.""" return { "operations": [ "snap_geometry", "nearest_point_on_geometry", "normalize_geometry", "geometry_to_geojson", "geojson_to_geometry" ] }
  • Specific entry registering 'normalize_geometry' in the list of available operations.
    "normalize_geometry",

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