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 வரைபடங்களைப் பதிவிறக்கம் செய்யுங்கள். உடனடி உருவாக்கம், எந்தப் பகுதியும்.