d3.js - Difference between GeoJSON and TopoJSON -
what difference between geojson , topojson , when utilize 1 on other?
the description of topojson on github implies topojson files 80% smaller. why not utilize topojson time?
if care file size or topology, utilize topojson. if don’t care either, utilize geojson simplicity’s sake.
the primary advantage of topojson size. eliminating redundancy , using more efficent fixed-precision integer encoding of coordinates, topojson files order of magnitude smaller geojson files. secondary advantage of topojson files encoding topology has useful applications, such topology-preserving simplification (similar mapshaper) , automatic mesh generation (as in state-state boundaries in this illustration choropleth).
these advantages come @ cost: more complex file format. in javascript, example, you’d typically utilize topojson client library convert topojson geojson utilize standard tools such d3.geo.path. (in python, can utilize topojson.py.) also, topojson’s integer format requires quantizing coordinates, means can introduce rounding error if you’re not careful. (see documentation topojson -q
.)
for server-side manipulation of geometries not require topology, geojson simpler choice. otherwise, if need topology or want send geometry on wire client, utilize topojson.
d3.js gis geojson
No comments:
Post a Comment