Options
All
  • Public
  • Public/Protected
  • All
Menu

Namespace TileKeyUtils

Index

Functions

extractOffsetAndMortonKeyFromKey

  • extractOffsetAndMortonKeyFromKey(key: number, bitshift?: number): { mortonCode: number; offset: number }
  • Extracts the offset and morton key from the given key (must be created by: getKeyForTileKeyAndOffset)

    Note, we can't use bitshift operators in Javascript because they work on 32-bit integers, and would truncate the numbers, hence using powers of two.

    Parameters

    • key: number

      Key to extract offset and morton key.

    • Default value bitshift: number = 4

      How many bits to shift by, must be the same as was used when creating the key.

    Returns { mortonCode: number; offset: number }

    • mortonCode: number
    • offset: number

geoCoordinatesToTileKey

geoRectangleToTileKeys

getKeyForTileKeyAndOffset

  • getKeyForTileKeyAndOffset(tileKey: TileKey, offset: number, bitshift?: number): number
  • Creates a unique key based on the supplied parameters. Note, the uniqueness is bounded by the bitshift. The [[TileKey.mortonCode()]] supports currently up to 26 levels (this is because 26*2 equals 52, and 2^52 is the highest bit that can be set in an integer in Javascript), the bitshift reduces this accordingly, so given the default bitshift of four, we support up to 24 levels. Given the current support up to level 19 this should be fine.

    Parameters

    • tileKey: TileKey

      The unique {@link @here/harp-geoutils#TileKey} from which to compute the unique key.

    • offset: number

      How much the given {@link @here/harp-geoutils#TileKey} is offset

    • Default value bitshift: number = 4

      How much space we have to store the offset. The default of 4 means we have enough space to store 16 unique tiles in a single view.

    Returns number

getParentKeyFromKey

  • getParentKeyFromKey(calculatedKey: number, bitshift?: number): number

worldCoordinatesToTileKey

Generated using TypeDoc