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

Redesign first byte in twkb #8

Closed
nicklasaven opened this issue Jul 28, 2014 · 1 comment
Closed

Redesign first byte in twkb #8

nicklasaven opened this issue Jul 28, 2014 · 1 comment

Comments

@nicklasaven
Copy link
Contributor

Now in spec the first byte in twkb is used like this:
bit 1: Is ID included in twkb?
bit 2-4: serialization method
bit 5-8: precision, number of decimals in coordinates

I don't think the possibility to use different serialization methods will ever be used. I think the varInt method will be the one and only. So, for that reason I think those bits instead should be used for optional features, the same way as the ID? bit.
The other 2 optional features I can think of is:

  1. size of geometry as discussed in Add size of twkb #7
  2. bounding box of geometry

If totally leaving the idea of different serialization methods we still have one bit left for future optional features.

Then comes the order of those 3 bits with optional features.

Now the ID? bit is the first bit.
I think it wold make sense to have the order

  1. size?
  2. bbox?
  3. id?
  4. unused bit
    5-8) precision, number of decimals.
    because that is the order they would apear later on in the geometry for practical resons.

But I don't know if there is any implementation out there that will break if moving the ID-bit.
I don't think any implementation of twkb is released yet so I guess this is still the right time to changing the design of the initial byte.

This was referenced Jul 28, 2014
@nicklasaven
Copy link
Contributor Author

Ok, it's in spec, implemented in PostGIS trunk and in twkb.js

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

1 participant