Skip to content
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

Closed
timrobertson100 opened this issue Jan 9, 2015 · 3 comments
Closed

Improve point documentaion #29

timrobertson100 opened this issue Jan 9, 2015 · 3 comments
Milestone

Comments

@timrobertson100
Copy link

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 ;)

@timrobertson100
Copy link
Author

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.

@springmeyer
Copy link

Thanks for raising this - def need to doc this out in more detail and fully explain how single vs multigeometries are handled.

Is it a moveTo with repetition, followed by a series of coords?

Yes

Or a moveTo and then a lineTo the same spot?

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: directive,x,y,x,y,x,y,x,y,x,y,x,y.

@flippmoke flippmoke added this to the v2.0 milestone Nov 18, 2015
@flippmoke
Copy link
Member

This should be addressed in version 2!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants