Skip to content

Can we also have a chapter about tile-based rendering engine? #56

@videni

Description

@videni

I’ve tried out the Google Maps Pyramid-Based Tile System. The concepts themselves don’t seem hard to grasp, but there are some subtle details that end up making the stroke really blurry even though the zoom level is set to 1.

Google Maps Pyramid-Based Tile System

Core Concept

  1. Pyramid Structure

Zoom 0: 1×1 tile (entire world)
Zoom 1: 2×2 tiles
Zoom 2: 4×4 tiles
...
Zoom n: 2^n × 2^n tiles

  1. Coordinate System
  • X coordinate: West to East (left to right), 0 to 2^zoom-1
  • Y coordinate: North to South (top to bottom), 0 to 2^zoom-1
  • Zoom levels: 0 (furthest out) to 18-22 (closest in)
  1. Tile Properties
  • Standard size: 256×256 pixels
  • World coverage: Geographic area covered by each tile varies by zoom level
  • Relationship: tileWorldSize = earthCircumference / (2^zoom)

How It Works

Level of Detail (LOD)

  • Zoom 0: One tile covers the entire world (low detail)
  • Zoom 10: 1024×1024 tiles, each covering ~153km
  • Zoom 18: 262,144×262,144 tiles, each covering ~0.6m

Coordinate Transformation

// Tile coordinates → World coordinates
let minX = Double(x) * tileSize - earthCircumference / 2
let maxY = earthCircumference / 2 - Double(y) * tileSize

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions