TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON er en topologibevidst udvidelse af GeoJSON. Den bruger delt buekodning (grænser mellem polygoner gemmes kun én gang) og heltalskvantisering af koordinater — den resulterende fil er 60-80 % mindre end den tilsvarende GeoJSON. Standardinput til D3.js, Mapshaper og Observable; ideel til interaktive koroplet-kort og webatlas.

Eksportér TopoJSON nu ✨ Open Beta — gratis, ingen begrænsninger

Vigtigste funktioner

Kodning med delte buer (60-80 % mindre end GeoJSON)
Heltalskvantisering af koordinater
Topologibevarende forenkling
Feature-egenskaber bevares

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.

Hvilket program åbner TopoJSON-filer

Følgende programmer og applikationer kan åbne, redigere og arbejde med TopoJSON (Topology-Aware JSON)-filer (.topojson), der er eksporteret fra OSM2CDR:

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

Format specifications

Hvem bruger TopoJSON-kort

🏗
Interaktive koroplet-kort i D3.js
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Webatlas og kortbaserede publikationer
A web atlas and cartographic publications where page weight matters.
📊
Lette kort over administrative grænser
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Offline webapplikationer (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Analyse og visualisering (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

Sådan eksporterer du TopoJSON

1
Vælg område
Tegn et rektangel eller en polygon på det interaktive kort på osm2cdr.ru
2
Vælg TopoJSON
Vælg TopoJSON (Topology-Aware JSON) fra listen over 127 tilgængelige eksportformater
3
Eksportér
Klik på Eksportér, og modtag din .topojson-fil på 1-5 minutter
4
Download
Download den færdige TopoJSON-fil, og åbn den i D3.js

Sådan åbner du filen efter eksporten

Populære kort i TopoJSON

Free

Få korteksport i TopoJSON (Topology-Aware JSON)

Download professionelle TopoJSON-kort fra OpenStreetMap. Øjeblikkelig generering, ethvert område.

Gratis / eksport
Eksportér TopoJSON nu →

Ofte stillede spørgsmål

Hvordan adskiller TopoJSON sig fra GeoJSON?
Kan jeg konvertere TopoJSON tilbage til GeoJSON?
Hvorfor foretrækker D3.js TopoJSON?
Understøtter TopoJSON 3D?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Relaterede formater

Ofte eksporteret sammen

Related Articles