Skip to main content

visible_tiles_flat_view

Function visible_tiles_flat_view 

Source
pub fn visible_tiles_flat_view(
    bounds: &WorldBounds,
    zoom: u8,
    view: &FlatTileView,
) -> Vec<TileId>
Expand description

Return visible flat raster tiles for a pitched perspective view.

This is the production tile-selection path for flat tile quads. It preserves complete coverage while reducing the extreme overfetch that occurs when a steeply pitched view uses only an axis-aligned Mercator AABB.

ยงAlgorithm

  1. Compute the conservative AABB tile set with visible_tiles.
  2. For sufficiently pitched views, sample the full screen border against the ground plane to build a world-space footprint polygon.
  3. Keep only tiles whose bounds intersect that sampled footprint.

Low-pitch and small tile sets bypass the extra filtering step.