Skip to main content

Geospatial database module

@loaders.gl/geospatial/geopackage

GeoPackage is a SQLite-based container for vector features, tiles, and metadata. The loader reads one selected table, while the source path handles discovery and multi-table access.

GeoPackage map example

Container discovery

Open the package. Choose the layer. Read the table.

A GeoPackage can hold several feature tables in one SQLite file. Discovery keeps the container visible while the application selects one useful layer.

01

GeoPackage file

SQLite container

tablesmetadata

02

Layer catalog

names · geometry · bounds

discoverinspect

03

Selected feature table

one layer for this task

choosefilter

04

Arrow feature table

geometry + typed attributes

reuserender

The package organizes the data; the application-facing table remains a focused, reusable result.

The GeoPackage path

Load one table, or explore the container.

A GeoPackage can hold several tables and geometry layers. The loader resolves one selected table into the common Arrow path; the source exposes discovery and multi-table access.

Container

SQLite database with OGC-defined tables

Discovery

Layers, columns, geometry types, and metadata

Output

One Arrow feature table or GeoJSON table

Runtime

Local parsing with explicit CRS and layer information

Detailed guide

GeoPackage module details

The sections below cover installation, loaders, sources, layers, tables, and attribution.

The @loaders.gl/geospatial/geopackage module handles the OGC GeoPackage format.

Installation​

npm install @loaders.gl/geospatial sql.js

SQL.js is an optional peer dependency. Applications using the grouped package should install @loaders.gl/geospatial sql.js; other geospatial formats do not require SQL.js. The existing geopackage.sqlJsCDN option controls WASM asset resolution and does not replace the JavaScript peer dependency.

Loaders and Writers​

Loader / SourceDescription
GeoPackageLoaderLoads one selected GeoPackage vector table.
GeoPackageSourceDiscovers and queries feature tables, exposes tile grids, and reads bounded encoded tile payloads.

Reprojection​

Reprojection uses the math.gl TypeScript projection engine. Legacy WKT1 Web Mercator definitions with a PROJ4 extension use the declared EPSG:3857 identifier. WKT2 definitions remain preferred when supplied. Unsupported projection operations raise an error.

Attribution​

The GeoPackage loaders and source use SQL.js under the MIT license.