/** * GeoParquet to OSM conversion utilities. * * Imports GeoParquet files into Osm indexes, mapping geometry * types to appropriate OSM entity structures. * * @module */ import { Osm, type OsmOptions } from "@osmix/core"; import { type ProgressEvent } from "@osmix/shared/progress"; import type { GeoParquetReadOptions, GeoParquetSource } from "./types.ts"; /** * Create an Osm index from GeoParquet data. * * Accepts various input formats (file path, URL, or buffer) and converts * features to OSM entities: * - Point → Node * - LineString → Way with nodes * - Polygon → Way (simple) or Relation (with holes) * - MultiPolygon → Relation * * Feature IDs are preserved if available; otherwise sequential negative IDs * are assigned. Feature tags become OSM tags. * * @param source - GeoParquet data source (file path, URL, or buffer) * @param options - Osm index options (id, header) * @param readOptions - Options for reading the parquet file * @param onProgress - Progress callback for UI feedback * @returns Populated Osm index with built indexes * * @example * ```ts * import { fromGeoParquet } from "@osmix/geoparquet" * * // From file * const osm = await fromGeoParquet("./roads.parquet") * * // Query the imported data * const highways = osm.ways.search("highway") * ``` */ export declare function fromGeoParquet(source: GeoParquetSource, options?: Partial, readOptions?: GeoParquetReadOptions, onProgress?: (progress: ProgressEvent) => void): Promise; export declare class GeoParquetOsmBuilder { private osm; private readOptions; private onProgress; constructor(osmOptions?: Partial, readOptions?: GeoParquetReadOptions, onProgress?: (progress: ProgressEvent) => void); readParquetRows(source: GeoParquetSource): Promise[]>; /** * Converts GeoParquet rows to OSM entities. */ processGeoParquetRows(rows: Record[]): void; buildOsm(): Osm; private nextNodeId; private nextWayId; private nextRelationId; getNextRelationId(): number; getNextWayId(): number; getNextNodeId(): number; private nodeMap; private getOrCreateNode; private processPoint; private processLineString; private processMultiLineString; private processPolygon; private processMultiPolygon; } //# sourceMappingURL=from-geoparquet.d.ts.map