TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON je proširenje GeoJSON-a svjesno topologije. Koristi kodiranje dijeljenih lukova (granice između poligona pohranjene su samo jednom) i cjelobrojnu kvantizaciju koordinata — rezultirajuća je datoteka 60–80 % manja od istovrijednog GeoJSON-a. Standardni ulaz za D3.js, Mapshaper i Observable; idealan za interaktivne koropletne karte i web atlase.

Izvezi TopoJSON sada ✨ Otvorena beta — besplatno, bez ograničenja

Ključne značajke

Kodiranje dijeljenih lukova (60–80 % manje od GeoJSON-a)
Cjelobrojna kvantizacija koordinata
Pojednostavljivanje uz očuvanje topologije
Svojstva objekata sačuvana

O formatu 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.

Koji program otvara datoteke TopoJSON

Sljedeći programi i aplikacije mogu otvoriti, uređivati i raditi s datotekama TopoJSON (Topology-Aware JSON) (.topojson) izvezenima iz OSM2CDR-a:

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

Format specifications

Tko koristi karte TopoJSON

🏗
Interaktivne koropletne karte u D3.js-u
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Web atlasi i publikacije temeljene na kartama
A web atlas and cartographic publications where page weight matters.
📊
Lagane karte administrativnih granica
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Izvanmrežne web aplikacije (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Analitika i vizualizacija (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

Kako izvesti TopoJSON

1
Odaberite područje
Nacrtajte pravokutnik ili poligon na interaktivnoj karti na osm2cdr.ru
2
Odaberite TopoJSON
Odaberite TopoJSON (Topology-Aware JSON) s popisa od 127 dostupnih formata izvoza
3
Izvoz
Kliknite Izvoz i primite svoju .topojson datoteku za 1 – 5 minuta
4
Preuzimanje
Preuzmite gotovu datoteku TopoJSON i otvorite je u D3.js

Kako otvoriti nakon izvoza

Popularne karte u formatu TopoJSON

Besplatno

Nabavite izvoze karata u formatu TopoJSON (Topology-Aware JSON)

Preuzmite profesionalne karte u formatu TopoJSON iz OpenStreetMapa. Trenutno generiranje, bilo koje područje.

Besplatno / izvoz
Izvezi TopoJSON sada →

Često postavljana pitanja

Po čemu se TopoJSON razlikuje od GeoJSON-a?
Mogu li pretvoriti TopoJSON natrag u GeoJSON?
Zašto D3.js daje prednost TopoJSON-u?
Podržava li TopoJSON 3D?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Convert to TopoJSON and back

Povezani formati

Često se izvoze zajedno

Related Articles