create-point
Generate point geometries from coordinates using PostGIS MCP Server. Input longitude and latitude to create spatial data with an optional SRID for custom projection.
Instructions
Koordinatlardan nokta geometrisi oluştur
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| latitude | Yes | Enlem koordinatı | |
| longitude | Yes | Boylam koordinatı | |
| srid | No | Spatial Reference System ID (varsayılan: 4326) |
Implementation Reference
- server.js:250-271 (handler)Handler for 'create-point' tool: validates input using CreatePointSchema, executes PostGIS query with ST_MakePoint to create point geometry, returns WKT, GeoJSON, coordinates, and SRID.case "create-point": { const { longitude, latitude, srid } = CreatePointSchema.parse(args); const result = yield client.query(` SELECT ST_AsText(ST_SetSRID(ST_MakePoint($1, $2), $3)) as wkt, ST_AsGeoJSON(ST_SetSRID(ST_MakePoint($1, $2), $3)) as geojson `, [longitude, latitude, srid]); const response = { wkt: result.rows[0].wkt, geojson: JSON.parse(result.rows[0].geojson), coordinates: [longitude, latitude], srid: srid, }; return { content: [ { type: "text", text: JSON.stringify(response, null, 2), }, ], }; }
- server.js:21-25 (schema)Zod validation schema for 'create-point' tool inputs: requires longitude and latitude (numbers), optional srid (default 4326).const CreatePointSchema = zod_1.z.object({ longitude: zod_1.z.number(), latitude: zod_1.z.number(), srid: zod_1.z.number().optional().default(4326), });
- server.js:81-102 (registration)Registration of 'create-point' tool in ListTools handler: specifies name, description, and input schema matching the Zod schema.{ name: "create-point", description: "Koordinatlardan nokta geometrisi oluştur", inputSchema: { type: "object", properties: { longitude: { type: "number", description: "Boylam koordinatı", }, latitude: { type: "number", description: "Enlem koordinatı", }, srid: { type: "number", description: "Spatial Reference System ID (varsayılan: 4326)", }, }, required: ["longitude", "latitude"], }, },