-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve point documentaion #29
Comments
I see the readme has a point example and it is a moveTo. I'd still suggest an example in the proto, which is all I copied into my project. |
Thanks for raising this - def need to doc this out in more detail and fully explain how single vs multigeometries are handled.
Yes
No, a point geometry is not going to need a lineTo To answer your question more detail: all geometry types are encoded the same: First the command (moveTo), then the first delta-encoded and zigzagged coordinate pair (x,y). Next (say with a multipoint or linestring) the next command and coordinates are processed. If the command has not changed (if it is still a moveTo) then it is not encoded directly but rather the count of repeated commands is collected. When a different command is encountered (like lineTo or close) or no more coordinates are found then the first command is updated and we pack the number of repeated coordinates into the bytes that encoded the command: let's call this combined value the "directive". So in the final encoding the "directives" store both the command (moveTo or lineTo) but also the length of repeated commands. This means that when finally encoded a multipoint geometry could look very similar to a linestring: |
This should be addressed in version 2! |
The documentation for a layer containing only points is lacking. Is it a moveTo with repetition, followed by a series of coords? Or a moveTo and then a lineTo the same spot? The spec appears incomplete for this scenario. A worthwhile addition would be an example for a layer containing points. (A brief answer here would be very gratefully received too ;)
The text was updated successfully, but these errors were encountered: