TopoJSON 📊

TopoJSON (Topology-Aware JSON)

Open Beta
.topojson · application/json

TopoJSON là một phần mở rộng của GeoJSON có nhận biết topology. Nó dùng cách mã hóa cung dùng chung (ranh giới giữa các đa giác chỉ lưu một lần) và lượng tử hóa tọa độ về số nguyên — tệp kết quả nhỏ hơn 60-80% so với GeoJSON tương đương. Là đầu vào chuẩn cho D3.js, Mapshaper và Observable; lý tưởng cho bản đồ choropleth tương tác và các tập bản đồ web.

Xuất TopoJSON ngay ✨ Open Beta — miễn phí, không giới hạn

Tính năng chính

Mã hóa cung dùng chung (nhỏ hơn GeoJSON 60-80%)
Lượng tử hóa số nguyên cho tọa độ
Đơn giản hóa giữ nguyên cấu trúc liên kết
Giữ nguyên thuộc tính đối tượng

Giới thiệu về định dạng 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.

Chương trình nào mở được tệp TopoJSON

Các chương trình và ứng dụng sau có thể mở, chỉnh sửa và làm việc với tệp TopoJSON (Topology-Aware JSON) (.topojson) được xuất từ OSM2CDR:

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

Format specifications

Ai sử dụng bản đồ TopoJSON

🏗
Bản đồ choropleth tương tác trong D3.js
A choropleth in D3.js draws fast: shared district borders are stored and rendered once.
💻
Tập bản đồ web và ấn phẩm dựa trên bản đồ
A web atlas and cartographic publications where page weight matters.
📊
Bản đồ ranh giới hành chính gọn nhẹ
Administrative boundary layers that can be simplified without gaps between neighbors.
🎨
Ứng dụng web ngoại tuyến (PWA)
An offline application or a PWA: the map takes several times less space than in GeoJSON.
🗺
Phân tích và trực quan hóa (Observable)
Exploratory analysis in Observable and notebooks — the data loads as a single small file.

Cách xuất TopoJSON

1
Chọn khu vực
Vẽ một hình chữ nhật hoặc đa giác trên bản đồ tương tác tại osm2cdr.ru
2
Chọn TopoJSON
Chọn TopoJSON (Topology-Aware JSON) từ danh sách 127 định dạng xuất khả dụng
3
Xuất
Nhấn Xuất và nhận tệp .topojson của bạn trong 1-5 phút
4
Tải xuống
Tải tệp TopoJSON đã sẵn sàng và mở trong D3.js

Cách mở tệp sau khi xuất

Bản đồ phổ biến ở định dạng TopoJSON

Miễn phí

Nhận bản đồ xuất ở định dạng TopoJSON (Topology-Aware JSON)

Tải bản đồ TopoJSON chuyên nghiệp từ OpenStreetMap. Tạo tức thì, bất kỳ khu vực nào.

Miễn phí / lần xuất
Xuất TopoJSON ngay →

Câu hỏi thường gặp

TopoJSON khác GeoJSON như thế nào?
Tôi có thể chuyển TopoJSON ngược lại thành GeoJSON không?
Vì sao D3.js ưa dùng TopoJSON?
TopoJSON có hỗ trợ 3D không?
How are the layers arranged inside the file?
What is quantization and what does it affect?

Định dạng liên quan

Thường được xuất cùng nhau

Related Articles