GeoLeaf Core API - v3.0.0
    Preparing search index...

    Variable ConfigNormalizerConst

    ConfigNormalizer: {
        isPoiStructNormalized(poi: unknown): poi is PoiLike;
        mapRawPoiToNormalized(
            rawPoi: Record<string, unknown>,
            mappingDef: Record<string, string>,
        ):
            | {
                id: string;
                title: string;
                location: { lat: number; lng: number };
                attributes: Record<string, unknown>;
            }
            | null;
        _resolveMappingDef(
            mappingConfig: MappingConfig | null,
            sourceKey?: string,
        ): Record<string, string> | null;
        normalizePoiWithMapping(
            rawPoiArray: PoiLike[],
            mappingConfig: MappingConfig | null,
            sourceKey?: string,
        ): PoiLike[];
    } = NormalizationModule

    Type Declaration

    • isPoiStructNormalized: function
      • Type guard: does this object already satisfy the normalized POI structure? Requires a non-empty string id, a non-empty title OR label, and valid coordinates in either latlng or location.

        Parameters

        • poi: unknown

          Candidate object.

        Returns poi is PoiLike

        true when no mapping pass is needed for this item.

    • mapRawPoiToNormalized: function
      • Applies a flat field-map to one raw item, producing a normalized POI.

        Parameters

        • rawPoi: Record<string, unknown>

          Raw source record (e.g. a GBIF occurrence or an OurAirports row).

        • mappingDef: Record<string, string>

          Flat map of targetPath -> sourcePath, both dotted.

        Returns
            | {
                id: string;
                title: string;
                location: { lat: number; lng: number };
                attributes: Record<string, unknown>;
            }
            | null

        The normalized POI, or null when the mapping is unusable. Numeric ids are coerced to string, and a non-object attributes is reset to {}.

        Target paths come from a profile file — see the note on the write loop.

    • _resolveMappingDef: function
      • Resolves the flat field-map to apply from a mapping.json config. The config is ALWAYS an object of named per-source blocks { <sourceId>: { mapping } }. (ANO-083 — per-source contract.)

        Resolution:

        • exactly one source block → auto-selected;
        • several blocks + explicit sourceKey matching one → that block;
        • zero, or several without a sourceKey → null (no applicable mapping → no-op).

        Parameters

        • mappingConfig: MappingConfig | null
        • OptionalsourceKey: string

        Returns Record<string, string> | null

    • normalizePoiWithMapping: function
      • Normalizes an array of raw items using a mapping.json config. Items already satisfying the POI structure are passed through untouched; the others go through the field-map. Items still invalid afterwards are dropped with a warning.

        Parameters

        • rawPoiArray: PoiLike[]

          Raw items. A non-array yields [].

        • mappingConfig: MappingConfig | null

          mapping.json content: named per-source blocks (ANO-083).

        • OptionalsourceKey: string

          Selects a block when several are declared; optional with exactly one.

        Returns PoiLike[]

        The normalized POIs. Returns the input as-is when no mapping applies.