You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to support values of varying string, boolean, integer, and floating point types, the protobuf encoding of the value field consists of a set of optional fields. A value MUST contain exactly one of these optional fields.
The text "MUST contain exactly one" effectively prohibits null values. I think this was unintended, and the text should read "MUST contain either zero of these optional fields, in which case the value shall be interpreted as an untyped "null" value, or exactly one of them."
@jfirebaugh I think this would be acceptable within a minor bump, but I do have some reserves about doing so. Currently mapnik-vector-tile is the only encoder/decoder that has become v2 compatible I think it would okay to update this as a minor bump, but I don't want to be changing too much as times goes on like this as it could break backwards compatibility!
@lucaswoj it would really depend on what someone was trying to represent, it might have a different meaning. I do not see any harm in allowing this as an option.
@jfirebaugh the original design intention was that null values would not be encoded to gain the space savings. So, a missing key is intended to be a substitute for a null value.
Thanks for clarifying the design intent @springmeyer.
To me, the main motivation for supporting null values is one less GeoJSON mismatch. I.e., in a GeoJSON Feature you can have:
"properties": {}
and
"properties": {
"foo": null
}
The current VT spec cannot distinguish these two, or round trip the latter.
(Non-scalar GeoJSON property values also can't be losslessly VT-encoded, but supporting null would be a lot lower cost for the specification and implementations than supporting non-scalar values.)
Activity
flippmoke commentedon Feb 23, 2016
@jfirebaugh I think this would be acceptable within a minor bump, but I do have some reserves about doing so. Currently mapnik-vector-tile is the only encoder/decoder that has become v2 compatible I think it would okay to update this as a minor bump, but I don't want to be changing too much as times goes on like this as it could break backwards compatibility!
lucaswoj commentedon Feb 23, 2016
What is the semantic difference between a null value and a missing key in a vector tile feature?
flippmoke commentedon Feb 25, 2016
@lucaswoj it would really depend on what someone was trying to represent, it might have a different meaning. I do not see any harm in allowing this as an option.
springmeyer commentedon Feb 25, 2016
@jfirebaugh the original design intention was that null values would not be encoded to gain the space savings. So, a missing key is intended to be a substitute for a null value.
jfirebaugh commentedon Feb 25, 2016
Thanks for clarifying the design intent @springmeyer.
To me, the main motivation for supporting null values is one less GeoJSON mismatch. I.e., in a GeoJSON Feature you can have:
and
The current VT spec cannot distinguish these two, or round trip the latter.
(Non-scalar GeoJSON property values also can't be losslessly VT-encoded, but supporting null would be a lot lower cost for the specification and implementations than supporting non-scalar values.)
fosskers commentedon Jun 28, 2016
Must compatibility with GeoJSON be maintained?
nullgets a lot of bad press, and for good reason. I'd prefer the idea of null being left out.