Skip to content

Null values should be allowed #62

Open

Description

@jfirebaugh

2.1 specifies:

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."

Activity

  1. flippmoke commented on Feb 23, 2016

    @flippmoke
    Member

    @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!

  2. lucaswoj commented on Feb 23, 2016

    @lucaswoj

    What is the semantic difference between a null value and a missing key in a vector tile feature?

  3. flippmoke commented on Feb 25, 2016

    @flippmoke
    Member

    @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.

  4. springmeyer commented on Feb 25, 2016

    @springmeyer
    Contributor

    @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.

  5. jfirebaugh commented on Feb 25, 2016

    @jfirebaugh
    ContributorAuthor

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

  6. fosskers commented on Jun 28, 2016

    @fosskers

    Must compatibility with GeoJSON be maintained? null gets a lot of bad press, and for good reason. I'd prefer the idea of null being left out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions