This class exports utility functions for slippy map (XYZ) tile calculations.

Hierarchy

  • TileBoundingBoxUtils

Constructors

Methods

boundWebMercatorBoundingBox boundWgs84BoundingBoxWithWebMercatorLimits getBoundingBox getBoundingBoxWGS84 getBoundingBoxWithTileGrid getBoundingBoxWithTileMatrix getBoundingBoxWithTileMatrixAndTileGrid getBoundingBoxWithTotalBoundingBox getFloatRectangle getLatitudeFromPixel getLatitudeFromPixelWithTileBoundingBox getLongitudeFromPixel getLongitudeFromPixelWithTileBoundingBox getPixelXSize getPixelYSize getProjectedBoundingBox getProjectedBoundingBoxFromTileGrid getProjectedBoundingBoxFromWGS84 getProjectedBoundingBoxFromWGS84FromTileGrid getProjectedBoundingBoxFromWGS84WithProjection getProjectedBoundingBoxFromWGS84WithProjectionFromTileGrid getProjectedBoundingBoxWithProjection getProjectedBoundingBoxWithProjectionFromTileGrid getRectangle getTileBounds getTileBoundsWithWGS84 getTileBoundsWithWebMercator getTileColumn getTileGrid getTileGridFromBoundingBox getTileGridFromWGS84 getTileGridFromWebMercator getTileGridWGS84 getTileGridWGS84FromWebMercator getTileGridWGS84WithPoint getTileGridWGS84WithWGS84Point getTileGridWithBoundingBoxAndZoom getTileGridWithPoint getTileRow getWGS84BoundingBox getWGS84BoundingBoxWithTileGridAndZoom getWGS84TileBounds getWGS84TileBoundsWithWGS84 getWGS84TileBoundsWithWebMercator getWebMercatorBoundingBox getWebMercatorBoundingBoxWithTileGrid getXPixel getYAsOppositeTileFormat getYPixel getZoomLevel isPointInBoundingBox overlap tileGridMaxZoomDecrease tileGridMaxZoomIncrease tileGridMinZoomDecrease tileGridMinZoomIncrease tileGridZoom tileGridZoomDecrease tileGridZoomIncrease tileHeightDegrees tileSize tileSizeLatPerWGS84Side tileSizeLonPerWGS84Side tileSizeWithZoom tileWidthDegrees tilesPerSide tilesPerWGS84LatSide tilesPerWGS84LonSide toWebMercator toleranceDistance toleranceDistanceWithLength union zoomFromTilesPerSide zoomLevelOfTileSize

Constructors

Methods

  • Get the tile bounding box from the XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the bounding box of the tile grid in the tile width and height bounds using the total bounding box with constant units

    Returns

    bounding box

    Parameters

    • totalBox: BoundingBox

      total bounding box

    • tileMatrixWidth: number

      matrix width

    • tileMatrixHeight: number

      matrix height

    • tileGrid: TileGrid

      tile grid

    Returns BoundingBox

  • Get the bounding box of the tile column and row in the tile width and height bounds using the total bounding box with constant units

    Returns

    bounding box

    Parameters

    • totalBox: BoundingBox

      total bounding box

    • tileMatrixWidth: number

      matrix width

    • tileMatrixHeight: number

      matrix height

    • tileColumn: number

      tile column

    • tileRow: number

      tile row

    Returns BoundingBox

  • Get a rectangle with floating point boundaries using the tile width, height, bounding box, and the bounding box section within the outer box to build the rectangle from

    Returns

    floating point rectangle

    Parameters

    • width: number

      width

    • height: number

      height

    • boundingBox: BoundingBox

      full bounding box

    • boundingBoxSection: BoundingBox

      rectangle bounding box section

    Returns ImageRectangle

  • Get the latitude from the pixel location, bounding box, and image height

    Returns

    latitude

    Parameters

    • height: number

      height

    • boundingBox: BoundingBox

      bounding box

    • pixel: number

      pixel

    Returns number

  • Get the latitude from the pixel location, bounding box, tile bounding box (when different from bounding box), and image height

    Returns

    latitude

    Parameters

    • height: number

      height

    • boundingBox: BoundingBox

      bounding box

    • tileBoundingBox: BoundingBox

      tile bounding box

    • pixel: number

      pixel

    Returns number

  • Get the longitude from the pixel location, bounding box, and image width

    Returns

    longitude

    Parameters

    • width: number

      width

    • boundingBox: BoundingBox

      bounding box

    • pixel: number

      pixel

    Returns number

  • Get the longitude from the pixel location, bounding box, tile bounding box (when different from bounding box), and image width

    Returns

    longitude

    Parameters

    • width: number

      width

    • boundingBox: BoundingBox

      bounding box

    • tileBoundingBox: BoundingBox

      tile bounding box

    • pixel: number

      pixel

    Returns number

  • Get the pixel x size for the bounding box with matrix width and tile width

    Returns

    pixel x size

    Parameters

    • webMercatorBoundingBox: BoundingBox

      web mercator bounding box

    • matrixWidth: number

      matrix width

    • tileWidth: number

      tile width

    Returns number

  • Get the pixel y size for the bounding box with matrix height and tile height

    Returns

    pixel y size

    Parameters

    • webMercatorBoundingBox: BoundingBox

      web mercator bounding box

    • matrixHeight: number

      matrix height

    • tileHeight: number

      tile height

    Returns number

  • Get the Projected tile bounding box from the XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • authority: string = ProjectionConstants.AUTHORITY_EPSG

      projection authority

    • code: number

      projection code

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the XYZ tile tileGrid and zoom level

    Returns

    bounding box

    Parameters

    • authority: string = ProjectionConstants.AUTHORITY_EPSG

      projection authority

    • code: number

      projection code

    • tileGrid: TileGrid

      tile grid

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • authority: string = ProjectionConstants.AUTHORITY_EPSG

      projection authority (default is EPSG)

    • code: number

      projection code

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the WGS84 XYZ tile tileGrid and zoom level

    Returns

    bounding box

    Parameters

    • authority: string = ProjectionConstants.AUTHORITY_EPSG

      projection authority (default is EPSG)

    • code: number

      projection code

    • tileGrid: TileGrid

      tile grid

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • projection: Projection

      projection

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the WGS84 XYZ tile grid and zoom level

    Returns

    bounding box

    Parameters

    • projection: Projection

      projection

    • tileGrid: TileGrid

      tile grid

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • projection: Projection

      projection

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Projected tile bounding box from the XYZ tile grid and zoom level

    Returns

    bounding box

    Parameters

    • projection: Projection

      projection

    • tileGrid: TileGrid

      tile grid

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the bounds of the XYZ tile at the point and zoom level

    Returns

    bounding box

    Parameters

    • projection: Projection

      point and bounding box projection

    • point: Point

      point location

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the web mercator bounds of the XYZ tile at the web mercator point and zoom level

    Returns

    web mercator bounding box

    Parameters

    • point: Point

      web mercator point

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the tile column of the longitude in constant units

    Returns

    tile column if in the range, -1 if before, () if after

    Parameters

    • totalBox: BoundingBox

      total bounding box

    • matrixWidth: number

      matrix width

    • longitude: number

      in constant units

    Returns number

  • Get the WGS84 tile grid for the point specified as web mercator

    Returns

    tile grid

    Parameters

    • point: Point

      point

    • zoom: number

      zoom level

    Returns TileGrid

  • Get the WGS84 tile grid for the point specified as the projection

    Returns

    tile grid

    Parameters

    • point: Point

      point

    • zoom: number

      zoom level

    • projection: Projection

      projection

    Returns TileGrid

  • Get the tile grid for the location specified as the projection

    Returns

    tile grid

    Parameters

    • point: Point

      point

    • zoom: number

      zoom level

    • projection: Projection

      projection

    Returns TileGrid

  • Get the tile row of the latitude in constant units

    Returns

    tile row if in the range, -1 if before, () if after

    Parameters

    • totalBox: BoundingBox

      total bounding box

    • matrixHeight: number

      matrix height

    • latitude: number

      in constant units

    Returns number

  • Get the WGS84 tile bounding box from the WGS84 XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the bounds of the WGS84 tile at the point and zoom level

    Returns

    bounding box

    Parameters

    • projection: Projection

      point and bounding box projection

    • point: Point

      point location

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the WGS84 bounds of the WGS84 tile at the WGS84 point and zoom level

    Returns

    WGS84 bounding box

    Parameters

    • point: Point

      WGS84 point

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the web mercator bounds of the WGS84 tile at the web mercator point and zoom level

    Returns

    web mercator bounding box

    Parameters

    • point: Point

      web mercator point

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the Web Mercator tile bounding box from the XYZ tile coordinates and zoom level

    Returns

    bounding box

    Parameters

    • x: number

      x coordinate

    • y: number

      y coordinate

    • zoom: number

      zoom level

    Returns BoundingBox

  • Get the X pixel for where the longitude fits into the bounding box

    Returns

    x pixel

    Parameters

    • width: number

      width

    • boundingBox: BoundingBox

      bounding box

    • longitude: number

      longitude

    Returns number

  • Get the standard y tile location as TMS or a TMS y location as standard

    Returns

    opposite tile format y

    Parameters

    • zoom: number

      zoom level

    • y: number

      y coordinate

    Returns number

  • Get the Y pixel for where the latitude fits into the bounding box

    Returns

    y pixel

    Parameters

    • height: number

      height

    • boundingBox: BoundingBox

      bounding box

    • latitude: number

      latitude

    Returns number

  • Get the zoom level of where the web mercator bounding box fits into the complete world

    Returns

    zoom level

    Parameters

    • webMercatorBoundingBox: BoundingBox

      web mercator bounding box

    Returns number

  • Determine if the point is within the bounding box

    Returns

    true if within the bounding box

    Parameters

    • point: Point

      bounding box

    • boundingBox: BoundingBox

      bounding box

    • maxLongitude: number = null

      max longitude of the world for the current bounding box units

    Returns boolean

  • Get the overlapping bounding box between the two bounding boxes adjusting the second box to an Anti-Meridian complementary version based upon the max longitude

    Returns

    bounding box

    Parameters

    • boundingBox: BoundingBox

      bounding box

    • boundingBox2: BoundingBox

      bounding box 2

    • allowEmpty: boolean = false

      allow empty latitude and/or longitude ranges when determining

    • maxLongitude: number

      max longitude of the world for the current bounding box units overlap

    Returns BoundingBox

  • Get the new tile grid max value starting from the tile grid max and zooming out / decreasing the number of levels

    Returns

    tile grid max value at new zoom level

    Parameters

    • max: number

      tile grid max value

    • zoomLevels: number

      number of zoom levels to decrease by

    Returns number

  • Get the new tile grid max value starting from the tile grid max and zooming in / increasing the number of levels

    Returns

    tile grid max value at new zoom level

    Parameters

    • max: number

      tile grid max value

    • zoomLevels: number

      number of zoom levels to increase by

    Returns number

  • Get the new tile grid min value starting from the tile grid min and zooming out / decreasing the number of levels

    Returns

    tile grid min value at new zoom level

    Parameters

    • min: number

      tile grid min value

    • zoomLevels: number

      number of zoom levels to decrease by

    Returns number

  • Get the new tile grid min value starting from the tile grid min and zooming in / increasing the number of levels

    Returns

    tile grid min value at new zoom level

    Parameters

    • min: number

      tile grid min value

    • zoomLevels: number

      number of zoom levels to increase by

    Returns number

  • Get the tile grid starting from the tile grid and current zoom to the new zoom level

    Returns

    tile grid at new zoom level

    Parameters

    • tileGrid: TileGrid

      current tile grid

    • fromZoom: number

      current zoom level

    • toZoom: number

      new zoom level

    Returns TileGrid

  • Get the tile grid starting from the tile grid and zooming out / decreasing the number of levels

    Returns

    tile grid at new zoom level

    Parameters

    • tileGrid: TileGrid

      current tile grid

    • zoomLevels: number

      number of zoom levels to decrease by

    Returns TileGrid

  • Get the tile grid starting from the tile grid and zooming in / increasing the number of levels

    Returns

    tile grid at new zoom level

    Parameters

    • tileGrid: TileGrid

      current tile grid

    • zoomLevels: number

      number of zoom levels to increase by

    Returns TileGrid

  • Get the tile height in degrees

    Returns

    tile height degrees

    Parameters

    • tilesPerSide: number

      tiles per side

    Returns number

  • Get the tile size in length units (meters by default)

    Returns

    tile size

    Parameters

    • tilesPerSide: number

      tiles per side total length

    • totalLength: number = ...

      total length

    Returns number

  • Get the tile height in degrees latitude

    Returns

    degrees

    Parameters

    • tilesPerLat: number

      tiles per latitude side

    Returns number

  • Get the tile height in degrees longitude

    Returns

    degrees

    Parameters

    • tilesPerLon: number

      tiles per longitude side

    Returns number

  • Get the tile size in length units at the zoom level

    Returns

    tile size in units

    Parameters

    • zoom: number

      zoom level

    • Optional totalLength: number

      total length

    Returns number

  • Get the tile width in degrees

    Returns

    tile width degrees

    Parameters

    • tilesPerSide: number

      tiles per side

    Returns number

  • Get the tiles per side, width and height, at the zoom level

    Returns

    tiles per side

    Parameters

    • zoom: number

      zoom level

    Returns number

  • Get the tiles per latitude side at the zoom level

    Returns

    tiles per latitude side

    Parameters

    • zoom: number

      zoom level

    Returns number

  • Get the tiles per longitude side at the zoom level

    Returns

    tiles per longitude side

    Parameters

    • zoom: number

      zoom level

    Returns number

  • Get the tolerance distance in meters for the zoom level and pixels length

    Returns

    tolerance distance in meters

    Parameters

    • zoom: number

      zoom level

    • pixelWidth: any

      pixel width

    • pixelHeight: any

      pixel height

    Returns number

  • Get the tolerance distance in meters for the zoom level and pixels length

    Returns

    tolerance distance in meters

    Parameters

    • zoom: number

      zoom level

    • pixels: number

      pixel length

    Returns number

  • Get the zoom level from the tiles per side

    Returns

    zoom level

    Parameters

    • tilesPerSide: number

      tiles per side

    Returns number

  • Get the zoom level from the tile size in length units (default is meters)

    Returns

    zoom level

    Parameters

    • tileSize: number

      tile size in units total length

    • totalLength: number = ...

    Returns number

Generated using TypeDoc