/** * Relation kind detection and geometry building. * * Determines the semantic type of OSM relations (area, line, point, logic, super) * based on their type tag and member structure. Also provides utilities for * building geometries from relation members. * * @module */ import type { LonLat, OsmRelation, OsmWay, RelationKind, RelationKindMetadata } from "./types.ts"; /** * Get the semantic kind of a relation based on its type tag. * Based on [OSM relation documentation](https://wiki.openstreetmap.org/wiki/Relation): * - Areas: multipolygon, boundary, site * - Lines: route, waterway, multilinestring, canal * - Points: multipoint * - Logic: restriction, route_master, network, collection * - [Super: relations that contain other relations](https://wiki.openstreetmap.org/wiki/Super-relation) */ export declare function getRelationKind(relation: OsmRelation): RelationKind; /** * Get metadata about a relation kind. */ export declare function getRelationKindMetadata(relation: OsmRelation): RelationKindMetadata; /** * Check if a relation is an area relation. */ export declare function isAreaRelation(relation: OsmRelation): boolean; /** * Check if a relation is a line relation. */ export declare function isLineRelation(relation: OsmRelation): boolean; /** * Check if a relation is a point relation. */ export declare function isPointRelation(relation: OsmRelation): boolean; /** * Check if a relation is a super-relation (contains other relations). */ export declare function isSuperRelation(relation: OsmRelation): boolean; /** * Check if a relation is a logical relation (non-geometric). */ export declare function isLogicRelation(relation: OsmRelation): boolean; /** * Build MultiLineString geometry from a line relation by connecting way members. * Orders way members using their refs and handles role-based reversal. * Returns an array of LineString coordinates (each LineString is an array of LonLat). */ export declare function buildRelationLineStrings(relation: OsmRelation, getWay: (wayId: number) => OsmWay | null, getNodeCoordinates: (nodeId: number) => LonLat | undefined): LonLat[][]; /** * Collect point coordinates from a point relation. * Returns an array of LonLat coordinates from node members. */ export declare function collectRelationPoints(relation: OsmRelation, getNodeCoordinates: (nodeId: number) => LonLat | undefined): LonLat[]; /** * Resolve nested relation members, flattening the hierarchy with cycle detection. * Returns all nodes, ways, and relations that are members (directly or indirectly). * @param relation - The relation to resolve * @param getRelation - Function to get a relation by ID * @param maxDepth - Maximum recursion depth (default: 10) * @param visited - Set of relation IDs already visited (for cycle detection) */ export declare function resolveRelationMembers(relation: OsmRelation, getRelation: (relationId: number) => OsmRelation | null, maxDepth?: number, visited?: Set): { nodes: number[]; ways: number[]; relations: number[]; }; //# sourceMappingURL=relation-kind.d.ts.map