Extension Title

Tile Scaling

Introduction

This extension defines tile scaling behaviors for tile tables. When tiles at a requested zoom level are not present, alternate zoom level tiles may be scaled in place. The extension configures the allowable zoom directions and distance from the requested tile.

Extension Author

National Geospatial-Intelligence Agency, author_name nga

Extension Name or Template

nga_tile_scaling

Extension Type

New Requirement

Applicability

This extension applies to the table names of tile user tables (2.2.8).

Scope

Read-write

Requirements

GeoPackage

Extension Table Entry

The Tile Scaling extension is registered into the gpkg_extensions table as follows:

gpkg_extensions
table_name column_name extension_name definition scope

user tile table name

null

nga_tile_scaling

URL to this extension description

read-write

Tile Scaling Table

The Tile Scaling Table contains tile table names and the desired scaling behavior configurations.

nga_tile_scaling
Column Name Type Description Null Default Key

table_name

TEXT

Tile Table name, foreign key to gpkg_tile_matrix_set

no

PK, FK

scaling_type

TEXT

The scaling behavior type: ('in','out','in_out','out_in','closest_in_out','closest_out_in')

no

zoom_in

INTEGER

Max zoom levels in (higher zoom level) to search from a requested zoom level, null for no limit, ignored when scaling_type is 'out'

yes

zoom_out

INTEGER

Max zoom levels out (lower zoom level) to search from a requested zoom level, null for no limit, ignored when scaling_type is 'in'

yes


CREATE TABLE nga_tile_scaling (
  table_name TEXT PRIMARY KEY NOT NULL,
  scaling_type TEXT NOT NULL,
  zoom_in INTEGER,
  zoom_out INTEGER,
  CONSTRAINT fk_nts_gtms_tn FOREIGN KEY('table_name') REFERENCES gpkg_tile_matrix_set('table_name')
  CHECK (scaling_type in ('in','out','in_out','out_in','closest_in_out','closest_out_in'))
);
Tile Scaling Type

The Tile Scaling Type defines the zoom search directions and order from a requested tile.

scaling_type
Name Description

in

Search for tiles by zooming in

out

Search for tiles by zooming out

in_out

Search for tiles by zooming in first, and then zooming out

out_in

Search for tiles by zooming out first, and then zooming in

closest_in_out

Search for tiles in closest zoom level order, equal zoom level distance prefers zoom in before zoom out

closest_out_in

Search for tiles in closest zoom level order, equal zoom level distance prefers zoom out before zoom in

GeoPackage SQLite Configuration

None

GeoPackage SQLite Extension

None

Examples

The rivers GeoPackage has a rivers_tiles tile table that is configured for tile scaling.

The example GeoPackage has tile tables configured for tile scaling.