-
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
Complex Properties Overhaul #121
Changes from 3 commits
7217923
fe9139a
736b0ec
5f954d6
66e465c
5bd6daa
d5d96e5
af1d5d9
3f262a4
522bca8
001e3ed
2f95642
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,46 @@ message Tile { | |
// A detailed description on geometry encoding is located in | ||
// section 4.3 of the specification. | ||
repeated uint32 geometry = 4 [ packed = true ]; | ||
|
||
// Properties replace existing tags field and | ||
// uses the properties field instead. This would only be used if version | ||
// for a layer is 3 or greater and tags should not be used at that point | ||
// | ||
// The properties field is much like the tags value in the it is two integers | ||
// pairs that reference key and value pairs however, it is broken out into a | ||
// "key_index" and an "complex_value". | ||
// | ||
// The "key_index" is much like the key index in the use for tags, but instead | ||
// of pointing to "keys" field in the Layers, it points to the "string_values". | ||
// This is the same value store as strings for use in values, so duplicates here | ||
// will be pointing to the same indexed position. | ||
// | ||
// An complex value has two parts, the first 3 bits are the type bits | ||
// and the remaining bits are the parameter bits. What is stored in the parameter | ||
// bits is dependant on what the type bit is selected. For example for inline values, | ||
// the parameter field is not an index but simply a value. For other types it might | ||
// be an index position into a value storage of the layer. | ||
// | ||
// uint64t type = complex_value & 0x7; // First 3 Bits | ||
// uint64t parameter = complex_value >> 3; | ||
// | ||
// Type | Id | Parameter | ||
// --------------------------------- | ||
// inline int | 0 | value of integer ( values between -2^60+1 to 2^60-1 ) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
// inline uint | 1 | value of unsigned integer ( values between 0 to 2^61-1 ) | ||
// bool/null | 2 | value of 0 = false, 1 = true, 2 = null | ||
// float | 3 | index to float_values in layer | ||
// double | 4 | index to double_values in layer | ||
// string | 5 | index to string_values in layer | ||
// int | 6 | index to int_values in layer | ||
// uint | 7 | index to uint_values in layer | ||
// list / map | 8 | (if 4th bit is 0 is list) | ||
// | | remaining bits are length of the list where | ||
// | | each item in the list is a complex value | ||
// | | (if 4th bit is 1 is map) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a bit confusing — the id 8 is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was attempting to get away with just using 3 bits so that we could represent higher int values with out having to using the int index system. I am not against 4 bits. |
||
// | | remaining bits are the number of key_index and | ||
// | | complex_value pairs to follow (same as properties) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we simply make these There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me, since we have enough type fields to spare. I think they were combined only because it looked like the types would fit in 3 bits. |
||
repeated uint64 properties = 5 [ packed = true ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will try an experimental implementation of this so we can see if it actually makes the tiles significantly smaller. |
||
} | ||
|
||
// Layers are described in section 4.1 of the specification | ||
|
@@ -69,6 +109,12 @@ message Tile { | |
// See https://github.com/mapbox/vector-tile-spec/issues/47 | ||
optional uint32 extent = 5 [ default = 4096 ]; | ||
|
||
repeated string string_values = 7; | ||
repeated double double_values = 8 [ packed = true ]; | ||
repeated float float_values = 9 [ packed = true ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we try to keep the types ordered consistently throughout the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sounds good to me. I'll make that edit. |
||
repeated int64 int64_values = 10 [ packed = true ]; | ||
repeated uint64 uint64_values = 11 [ packed = true ]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use |
||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suggest these should get "logical" names like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also fine with me. |
||
extensions 16 to max; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: had to read many times to understand the sentence.
the
->that
? also,;
before "however" would help