Turns out json isn't so good at transporting binary data. But with HTML5, XHR2 is now capable of transferring blobs cleanly. I'm looking to transfer binary geometry (to save bandwidth) and decode it on the client.
To no avail, I've scoured the web for a javascript-based WKB (Well-known Binary) to WKT (Well-known Text) function. Before I re-invent the wheel — is anyone aware of any open-source solutions?
Best Answer
It looks like a new and better supported JS WKB parsing library has since appeared.
https://github.com/cschwarz/wkx
I've been able to use it to convert WKB directly from postgres into JS objects that can be mapped in the browser. You'll need to include https://github.com/cschwarz/wkx/blob/master/dist/wkx.js in your webpage for this to work.