TopoJSON은 위상 정보를 인식하는 GeoJSON의 확장입니다. 공유 아크 인코딩(폴리곤 사이의 경계를 한 번만 저장)과 좌표의 정수 양자화를 사용하여, 결과 파일이 동등한 GeoJSON보다 60-80% 작습니다. D3.js, Mapshaper, Observable의 표준 입력 형식이며, 대화형 단계구분도와 웹 아틀라스에 이상적입니다.
주요 기능
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.
TopoJSON 파일을 여는 프로그램
다음 프로그램과 애플리케이션으로 OSM2CDR에서 내보낸 TopoJSON (Topology-Aware JSON)(.topojson) 파일을 열고 편집하고 작업할 수 있습니다:
Format specifications
- Open standard
- 2D only
- Lossless (no quality loss)
- Stores feature attributes
- Output: 1 file
- TopoJSON (open spec). Topologically encoded GeoJSON: shared borders stored once, file size 30-80% smaller. Used by D3.js.
TopoJSON 지도 사용자
TopoJSON 내보내기 방법
내보낸 뒤 여는 방법
- D3.js — include topojson-client and unpack the layer you need: topojson.feature(topology, topology.objects.buildings), then the usual d3.geoPath.
- Mapshaper — drag the file onto mapshaper.org: objects and attributes are visible, and simplification and export to SHP or GeoJSON are right there.
- QGIS — opens .topojson as an ordinary vector layer through GDAL; handy for checking the geometry with your own eyes.
- Converting to GeoJSON — topo2geo buildings=buildings.geojson < map.topojson from the topojson-client package, or ogr2ogr.
- Leaflet and MapLibre — they do not understand the format directly: unpack it into GeoJSON on the client with the topojson-client library and feed it on as usual.
TopoJSON 형식의 인기 지도
TopoJSON (Topology-Aware JSON) 지도 내보내기 받기
OpenStreetMap에서 전문가용 TopoJSON 지도를 다운로드하세요. 즉시 생성, 모든 영역 지원.