Summarize tile sizes in a PMTiles archive.

Return the same dict as `tylertoo stats --json`.
Tile sizes come from the archive directory alone
and measure stored compressed bytes per addressed tile. Run
members and deduplicated tiles each count individually.

Args:
    archive: PMTiles archive to summarize.
    largest: Number of largest tiles to return, or 0 for none.
        Defaults to {default:largest}.
    layers: Decode each distinct stored tile body once and include
        per-layer statistics. Defaults to `False`.

Returns:
    A dict with `per_zoom` entries containing `z`, `tile_count`,
    `total_bytes`, `mean_bytes`, `p50_bytes`, `p99_bytes`, and
    `max_bytes` for each zoom's tile count and stored-size statistics.

    `largest` entries contain `z`, `x`, `y`, and `bytes`.
    They list tiles by stored size, largest first.

    With `layers=True`, `per_layer` entries contain `z`, `layer`,
    `feature_count`, `bytes`, and `geometry_types` for each zoom and
    layer. `bytes` measures the layer's uncompressed encoded size.
    `geometry_types` counts features per `Point`, `LineString`,
    `Polygon`, or `Unknown`. These totals count each addressed tile.
    The dict omits `per_layer` otherwise.

Raises:
    ConfigError: An unknown keyword or a bad value.
    RuntimeError: Not a PMTiles archive, a damaged tile, a raster
        archive with `layers=True`, or reading failed.

Example:
    >>> report = stats("buildings.pmtiles", layers=True)
    >>> report["per_layer"][0]["layer"]
    'overview'
