Skip to main content
Glama

transform-coordinates

Convert spatial coordinates between systems using WKT geometry, source SRID, and target SRID for accurate mapping and analysis with the PostGIS MCP Server.

Instructions

Koordinat sistemini dönüştür

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
geometry_wktYesWKT formatında geometri
source_sridYesKaynak koordinat sistemi SRID
target_sridYesHedef koordinat sistemi SRID

Implementation Reference

  • Executes the transform-coordinates tool: validates input using TransformCoordinatesSchema, runs PostGIS ST_Transform query to convert geometry from source_srid to target_srid, returns transformed WKT and GeoJSON.
    case "transform-coordinates": { const { geometry_wkt, source_srid, target_srid } = TransformCoordinatesSchema.parse(args); const result = yield client.query(` SELECT ST_AsText(ST_Transform(ST_GeomFromText($1, $2), $3)) as transformed_wkt, ST_AsGeoJSON(ST_Transform(ST_GeomFromText($1, $2), $3)) as transformed_geojson, $2 as source_srid, $3 as target_srid `, [geometry_wkt, source_srid, target_srid]); const response = { original_geometry: geometry_wkt, source_srid: source_srid, target_srid: target_srid, transformed_wkt: result.rows[0].transformed_wkt, transformed_geojson: JSON.parse(result.rows[0].transformed_geojson), }; return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
  • Zod schema defining input parameters for the transform-coordinates tool: geometry_wkt (string), source_srid (number), target_srid (number).
    const TransformCoordinatesSchema = zod_1.z.object({ geometry_wkt: zod_1.z.string(), source_srid: zod_1.z.number(), target_srid: zod_1.z.number(), });
  • server.js:145-157 (registration)
    Registers the transform-coordinates tool in the ListTools response, including name, description, and input schema matching the Zod schema.
    { name: "transform-coordinates", description: "Koordinat sistemini dönüştür", inputSchema: { type: "object", properties: { geometry_wkt: { type: "string", description: "WKT formatında geometri" }, source_srid: { type: "number", description: "Kaynak koordinat sistemi SRID" }, target_srid: { type: "number", description: "Hedef koordinat sistemi SRID" }, }, required: ["geometry_wkt", "source_srid", "target_srid"], }, },

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/receptopalak/postgis-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server