TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON és una extensió de GeoJSON sensible a la topologia. Utilitza la codificació d'arcs compartits (els límits entre polígons s'emmagatzemen una sola vegada) i la quantització entera de les coordenades: el fitxer resultant és un 60-80% més petit que el GeoJSON equivalent. Entrada estàndard per a D3.js, Mapshaper i Observable; ideal per a mapes coroplètics interactius i atles web.

Exporta TopoJSON ara ✨ Beta oberta — gratuït, sense límits

Característiques clau

Codificació d'arcs compartits (60-80% més petit que GeoJSON)
Quantització entera de les coordenades
Simplificació que preserva la topologia
Propietats d'entitat conservades

Sobre el format TopoJSON

TopoJSON was invented by Mike Bostock, the author of D3.js, to solve a simple problem: in GeoJSON neighboring polygons store their shared border twice. TopoJSON moves all the lines into a common array of arcs that the objects then refer to. On top of that, coordinates are rounded to an integer grid and written as increments — the file gets sharply lighter.

The format is taken for web graphics and analytics: choropleths in D3, interactive atlases, boundary maps in Observable, lightweight layers for offline applications. The second motive is simplification: during generalization the shared borders move together, and no gaps appear between neighboring districts.

The output is a single document: every layer becomes a separate object inside it — roads, buildings, water and so on — and object attributes are preserved. Coordinates are in WGS84, up to 100,000 objects per layer. The topology is built by our own code, with no external dependencies.

The price of compactness is the rounding of coordinates. The grid step depends on the size of the area: for a district it is on the order of a meter, for a country hundreds of meters. For a web map that is invisible; for precise measurements take GeoJSON or GeoPackage.

Quin programa obre els fitxers TopoJSON

Els programes i les aplicacions següents poden obrir, editar i treballar amb fitxers TopoJSON (Topology-Aware JSON) (.topojson) exportats des d'OSM2CDR:

💻D3.js 💻Mapshaper 💻topojson-server 💻topojson-client 💻Observable 💻ndjson-cli

Format specifications

Qui utilitza els mapes TopoJSON

🏗
Mapes coroplètics interactius amb D3.js
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Atles web i publicacions basades en mapes
A web atlas and cartographic publications where page weight matters.
📊
Mapes lleugers de límits administratius
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Aplicacions web fora de línia (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Analítica i visualització (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

Com exportar TopoJSON

1
Selecciona l'àrea
Dibuixa un rectangle o un polígon al mapa interactiu d'osm2cdr.ru
2
Tria TopoJSON
Tria TopoJSON (Topology-Aware JSON) de la llista de 127 formats d'exportació disponibles
3
Exporta
Fes clic a Exporta i rep el fitxer .topojson en 1-5 minuts
4
Descarrega
Descarrega el fitxer TopoJSON llest i obre'l amb D3.js

Com obrir el fitxer després de l'exportació

Mapes populars en TopoJSON

Free

Obtingues exportacions de mapes TopoJSON (Topology-Aware JSON)

Descarrega mapes TopoJSON professionals d'OpenStreetMap. Generació instantània, qualsevol àrea.

Gratuït / exportació
Exporta TopoJSON ara →

Preguntes freqüents

En què es diferencia el TopoJSON del GeoJSON?
Puc tornar a convertir el TopoJSON a GeoJSON?
Per què D3.js prefereix el TopoJSON?
El TopoJSON admet 3D?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Convert to TopoJSON and back

Formats relacionats

Sovint exportats junts

Related Articles