Live Online ConverterChannel: topojsongeopackage

TopoJSON to GeoPackage Converter

Import compressed TopoJSON layers into indexable databases.

Extract lightweight topologies and organize them into structured databases. This converter will expand shared line systems into individual database records within a GeoPackage, complete with spatial indexes.

Drag file here to convert, or select file

Supported file extension: .geojson, .json • Max 50MB

Channel: Direct Stream ModeGDAL Driver Operational

Specification Rules

  • Import space-saving web topologies back into active GIS projects
  • Save compressed map datasets in indexable local databases
  • Run offline spatial queries on TopoJSON boundaries
  • Decompressing shared boundaries increases overall database size
  • Requires custom format drivers to parse topology structures
  • Conversion processes are more CPU-intensive for large layers

GDAL Direct Equivalent Terminal Command

sh — gdalready
$ogr2ogr -f GPKG output.gpkg input.topojson

When to use this conversion

Convert when a TopoJSON dataset (often from a D3 example or a published boundary dataset) needs to enter a desktop GIS workflow with full attribute editing. GeoPackage is the right target because it preserves all features as separate rows with full attribute access.

Technical Details

GDAL's TopoJSON support decompresses arcs into full geometries, then writes them to SQLite with GeoPackage metadata. Shared boundaries become duplicated coordinate sequences in the output (no longer shared). Quantisation is reversed via the transform metadata. CRS is assumed WGS 84.
Output file size

GeoPackage is typically 2–4× the size of the source TopoJSON because shared boundaries become duplicated. Compared to the equivalent decompressed GeoJSON, GeoPackage is 20–40% of the size.

Common Errors & Fixes

  • Multiple objects in source: only one converted by default. Fix: list all object names with -lco LAYER_NAME or convert one at a time.
  • Quantisation visible after import: source had aggressive quantisation. Fix: nothing to do at conversion time; ask the source publisher for higher precision.
  • Properties missing: the TopoJSON had no per-feature properties. Fix: check the source build pipeline.
  • Coordinate precision lost: floating-point reconstruction errors. Fix: use mapshaper for the conversion with --precision flag.

Alternative Tools

  • topojson-client + ogr2ogr two-step: first convert to GeoJSON, then to GeoPackage
  • mapshaper.org: drag .topojson in, export as GeoPackage
  • QGIS: open .topojson, export as GeoPackage
  • ogr2ogr CLI direct: ogr2ogr -f GPKG output.gpkg input.topojson

Frequently Asked Questions

What happens during decompression?

Compressed boundary tracks expand into individual vector boundaries within the SQLite database.

Is spatial search performance optimized?

Yes. The generated files are structured with spatial index columns inside the database tables.

Are multiple layers supported?

Yes, different topologies convert into separate, organized tables within the database.

Related Transformations Map