@ferrybig/cgeodata-reader
    Preparing search index...

    An open locate index file (Section C.4). Opening reads only the header, and each entry() or area() reads just that entry's bytes; only areas(), which a search ranked by area needs, keeps anything (one byte per place), so an idle index otherwise costs an open file handle and no memory.

    Opening does NOT verify the source checksum -- CGeoDataReader's useLocateIndex() does that against the file it's attached to.

    Index
    name?: string

    The index file's name, when its source has one (ByteSource.name).

    sourceChecksum: bigint

    Checksum of the header, directory and place table it was built from (Section C.4); a reader only accepts the index when it matches its own.

    entryWidth: number

    Bytes per entry (Section C.2).

    placeCount: number

    How many places it has an entry for.

    • Opens a locate index file (read on demand, like a .bin). Validates signature, kind, version, entry width and length. Takes ownership of a ByteSource: close() closes it, as does a failed open.

      Parameters

      Returns Promise<LocateIndex>

    • Closes the index's source.

      Returns Promise<void>

    entry

    • entry(id: number): Promise<number>

      Place id's raw entry (Section C.2); 0 means no geometry.

      Parameters

      • id: number

      Returns Promise<number>

    • Place id's area byte (Section C.3); 0 means no area.

      Parameters

      • id: number

      Returns Promise<number>

    • Every place's area byte, by id: one read of placeCount bytes, the first time, then kept -- what ranking a search by area needs.

      Returns Promise<Uint8Array<ArrayBufferLike>>