Skip to content

Allow non-string properties #3

@vincentsarago

Description

@vincentsarago

The vtzero docs says we could pass any value to feature.add_property but right now when doing it, the module set the value to true

tile = Tile()
points = Layer(tile, b'points')
feature = Point(points)
feature.set_id(1)
feature.add_points(1)
feature.set_point(10, 10)
feature.add_property(b'foo', b'bar')
feature.add_property(b'x', 1)
feature.add_property(b'y', 1.5)
feature.commit()
$ vt2geojson test.pbf -z 17 -x 38754 -y 46891
{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "geometry": {
        "type": "Point",
        "coordinates": [
          -73.55895325541496,
          45.50056724165691
        ]
      },
      "properties": {
        "foo": true,
        "x": true,
        "y": true
      },
      "id": 1
    }
  ]
}

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