I think you briefly talked about using heading change and distance for encoding your polyline. So if I understand correctly, something like:
[forwardDistance1, angleDelta1, forwardDistance2, angleDelta2, ...]
Then are you using it kinda like a kd-tree (filter everything within a threshold of forwardDistance1, then angleDelta1, then next dimension and so on)? But then how do you handle the initial scaling? What about cumulative error in heading or distance?
Congrats on the amazing work by the way!