You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Leaving some notes here regarding conversions from GeoJSON to TopoJSON, which in a recent real world test reduced file size by 4x with no perceptible change in appearance. This is a huge win when making data to serve over the wire (e.g. in any web application), so we should absolutely figure out how to incorporate it into any of our toolchains that generate GeoJSONs.
Starting with a GeoJSON called shape.json, the specific steps are:
json('shape.json').then((data) => {
// ...do stuff with data
}
with
import { feature } from 'topojson-client'
json('shape-topo-quantized.json').then((topology) => {
const data = feature(topology, topology.objects.shape)
// ...do stuff with data
}
And we can use the data exactly as we normally would (including getting access to all properties).
Surely there is a way to do this in Python? Might be cumbersome to rely on these CLI tools, but we should definitely be taking advantage of the reduction in file size.
The text was updated successfully, but these errors were encountered:
Leaving some notes here regarding conversions from GeoJSON to TopoJSON, which in a recent real world test reduced file size by 4x with no perceptible change in appearance. This is a huge win when making data to serve over the wire (e.g. in any web application), so we should absolutely figure out how to incorporate it into any of our toolchains that generate GeoJSONs.
Starting with a GeoJSON called
shape.json
, the specific steps are:Via the CLI tools from
topojson-server
andtopojson-client
.Then, in Javascript, we simply replace
with
And we can use the data exactly as we normally would (including getting access to all properties).
Surely there is a way to do this in Python? Might be cumbersome to rely on these CLI tools, but we should definitely be taking advantage of the reduction in file size.
The text was updated successfully, but these errors were encountered: