TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON är en topologimedveten utökning av GeoJSON. Använder delad bågkodning (gränser mellan polygoner lagras endast en gång) och heltalskvantisering av koordinater – den resulterande filen blir 60–80 % mindre än motsvarande GeoJSON. Standardindata för D3.js, Mapshaper och Observable; idealiskt för interaktiva koroplet-kartor och webbatlaser.

Exportera TopoJSON nu ✨ Öppen beta — gratis, inga begränsningar

Viktiga funktioner

Kodning med delade bågar (60–80 % mindre än GeoJSON)
Heltalskvantisering av koordinater
Topologibevarande förenkling
Objektegenskaper bevaras

Om formatet 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.

Vilket program öppnar TopoJSON-filer

Följande program och applikationer kan öppna, redigera och arbeta med TopoJSON (Topology-Aware JSON)-filer (.topojson) som exporterats från OSM2CDR:

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

Format specifications

Vem använder TopoJSON-kartor

🏗
Interaktiva koropletkartor i D3.js
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Webbatlaser och kartbaserade publikationer
A web atlas and cartographic publications where page weight matters.
📊
Lättviktskartor över administrativa gränser
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Offline-webbapplikationer (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Analys och visualisering (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

Så exporterar du TopoJSON

1
Välj område
Rita en rektangel eller polygon på den interaktiva kartan på osm2cdr.ru
2
Välj TopoJSON
Välj TopoJSON (Topology-Aware JSON) från listan med 127 tillgängliga exportformat
3
Exportera
Klicka på Exportera och få din .topojson-fil på 1–5 minuter
4
Ladda ner
Ladda ner den färdiga TopoJSON-filen och öppna den i D3.js

Så öppnar du filen efter exporten

Populära kartor i TopoJSON

Free

Hämta kartexporter i TopoJSON (Topology-Aware JSON)

Ladda ner professionella TopoJSON-kartor från OpenStreetMap. Direktgenerering, valfritt område.

Gratis / export
Exportera TopoJSON nu →

Vanliga frågor

Hur skiljer sig TopoJSON från GeoJSON?
Kan jag konvertera TopoJSON tillbaka till GeoJSON?
Varför föredrar D3.js TopoJSON?
Stöder TopoJSON 3D?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Relaterade format

Ofta exporterade tillsammans

Related Articles