import { OpenAssistantTool } from '@openassistant/utils'; import { z } from 'zod'; import { SpatialToolContext } from '../types'; /** * ## thiessenPolygons Tool * * This tool creates Thiessen polygons (Voronoi diagrams) from a set of points. * Thiessen polygons divide space into regions where each point is closer to its associated polygon than to any other point. * * ### Thiessen Polygons * * The tool creates Thiessen polygons with the following features: * - **Voronoi Diagram**: Divides space into regions based on proximity to input points * - **Spatial Partitioning**: Each polygon contains all locations closest to its associated point * - **Network Analysis**: Useful for service area analysis and spatial modeling * - **Polygon Output**: Returns the Thiessen polygons as polygon features for mapping * * ### Parameters * - `datasetName`: Name of the dataset with point geometries to create Thiessen polygons from (optional) * - `geojson`: GeoJSON string of point geometries to create Thiessen polygons from (optional) * * **Example user prompts:** * - "Create Thiessen polygons from these points" * - "Generate Voronoi diagram for the facility locations" * - "Make service area polygons for these hospitals" * * ### Example * ```typescript * import { thiessenPolygons } from "@openassistant/geoda"; * import { convertToVercelAiTool } from "@openassistant/utils"; * * const thiessenTool = { * ...thiessenPolygons, * context: { * getGeometries: async (datasetName: string) => { * // Implementation to retrieve geometries from your data source * return geometries; * }, * }, * }; * * const result = await generateText({ * model: openai('gpt-4.1', { apiKey: key }), * prompt: 'Create Thiessen polygons from these points', * tools: { thiessenPolygons: convertToVercelAiTool(thiessenTool) }, * }); * ``` */ export declare const thiessenPolygons: OpenAssistantTool; export type ThiessenPolygonsArgs = z.ZodObject<{ datasetName: z.ZodOptional; geojson: z.ZodOptional; }>; export type ThiessenPolygonsLlmResult = { success: boolean; result: string; }; export type ThiessenPolygonsAdditionalData = { datasetName: string; [key: string]: unknown; }; export type ThiessenPolygonsTool = typeof thiessenPolygons;