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

    Interface QueryResult

    query()'s result: lookup()'s, with the place and its ancestors named. A level that doesn't apply is null: city for a point resolved only to a region, all three where nothing resolved.

    interface QueryResult {
        placeId: number | null;
        boundingBox: BoundingBox;
        chunkIndex: number;
        country: PlaceRef | null;
        region: PlaceRef | null;
        city: PlaceRef | null;
    }

    Hierarchy (View Summary)

    Index
    placeId: number | null

    The global id (Section 7.5) of the finest place resolved -- the city, else the region, else the country -- or null where nothing resolved. Two results with the same id have the same names, so a caller doing many lookups can key per-place work (a color, a label) on it instead of on the names.

    boundingBox: BoundingBox

    The lat/lon rectangle this result is valid for -- every coordinate in this box resolves to the exact same result as the one just queried. Callers doing many nearby lookups (e.g. a tile renderer sampling a grid of pixels) can cache on this to skip repeat queries that would land in the same underlying cell. It's as tight as the cell that produced the result when one was matched; for "unknown" results it's the whole empty chunk when possible, otherwise the single finest-grain cell containing the query point (always correct, just not maximal -- the actual empty region in a gap between records isn't generally a plain rectangle, so this doesn't try to find its full extent).

    chunkIndex: number

    Index of the chunk the query point falls in (Section 6.1's r * W + c), whether or not that chunk holds any records. Useful for narrowing a rebuild to one chunk with the compressor's --only-chunks when a query resolves unexpectedly.

    country: PlaceRef | null

    The country the point lies in.

    region: PlaceRef | null

    The region (province, state, ...) the point lies in.

    city: PlaceRef | null

    The city -- or whatever finest division the country has; see the README -- the point lies in.