springmeyer/geojsonp — pull request #4 by tmcw (2014-07-11 02:01:44+00:00)
Title: Packed array version.

This implements a slimmer geojson encoding in protobuf:

* feature.type is assumed by context, not saved as a string
* geometry.type is an enum
* coordinates are flat and packed
* coordinates are e6 encoded, rather than doubles

Comparison of geojson, geojsonp, and geojsonp-packed: http://bl.ocks.org/anonymous/3026dab639b365bfdfe4

---

Room for improvement:

* Would packed coordinate arrays be more compact if they were stored in dimension order rather than as pairs? like `[x1, x2, x3, y1, y2, y3]`. If they're delta-encoded, the deltas between the same dimension are likely to be smaller than across.
* I had a though that using snappy compression could be a cheap win. It is not: http://bl.ocks.org/anonymous/d750426d2494e25a0606
* I don't see much win coming from msgpack/capnp other serializations - they aim for flexibility or speed of decoding rather than compactness.