TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON é uma extensão de GeoJSON com consciência topológica. Usa codificação de arcos partilhados (as fronteiras entre polígonos são armazenadas apenas uma vez) e quantização inteira das coordenadas — o ficheiro resultante é 60-80% mais pequeno do que o GeoJSON equivalente. Entrada padrão para D3.js, Mapshaper e Observable; ideal para mapas coropléticos interativos e atlas web.

Exportar TopoJSON agora ✨ Beta Aberta — gratuito, sem limites

Principais características

Codificação por arcos partilhados (60-80% menor que GeoJSON)
Quantização inteira das coordenadas
Simplificação preservando a topologia
Propriedades de feição preservadas

Sobre o formato 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.

Que programa abre ficheiros TopoJSON

Os seguintes programas e aplicações podem abrir, editar e trabalhar com ficheiros TopoJSON (Topology-Aware JSON) (.topojson) exportados do OSM2CDR:

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

Format specifications

Quem utiliza mapas TopoJSON

🏗
Mapas coropléticos interativos em D3.js
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Atlas web e publicações baseadas em mapas
A web atlas and cartographic publications where page weight matters.
📊
Mapas leves de limites administrativos
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Aplicações web offline (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Análise e visualização (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

Como exportar para TopoJSON

1
Selecionar área
Desenhe um retângulo ou polígono no mapa interativo em osm2cdr.ru
2
Escolher TopoJSON
Selecione TopoJSON (Topology-Aware JSON) na lista de 127 formatos de exportação disponíveis
3
Exportar
Clique em Exportar e receba o seu ficheiro .topojson em 1-5 minutos
4
Descarregar
Descarregue o ficheiro TopoJSON pronto e abra-o no D3.js

Como abrir depois da exportação

Mapas populares em TopoJSON

Free

Obtenha exportações de mapas em TopoJSON (Topology-Aware JSON)

Descarregue mapas profissionais em TopoJSON a partir do OpenStreetMap. Geração instantânea, qualquer área.

Gratuito / exportação
Exportar TopoJSON agora →

Perguntas frequentes

Em que difere o TopoJSON do GeoJSON?
Posso converter TopoJSON de volta para GeoJSON?
Porque é que o D3.js prefere TopoJSON?
O TopoJSON suporta 3D?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Formatos relacionados

Frequentemente exportados em conjunto

Related Articles