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
"proto": "\npackage vector_tile;\n\noption optimize_for = LITE_RUNTIME;\n\nmessage Tile {\n\n // GeomType is described in section 4.3.4 of the specification\n enum GeomType {\n UNKNOWN = 0;\n POINT = 1;\n LINESTRING = 2;\n POLYGON = 3;\n }\n // THIS IS NEW\n message NewMessageInValue {\n required string name = 1;\n }\n\n // Variant type encoding\n // The use of values is described in section 4.1 of the specification\n message Value {\n // Exactly one of these values must be present in a valid message\n optional string string_value = 1;\n optional float float_value = 2;\n optional double double_value = 3;\n optional int64 int_value = 4;\n optional uint64 uint_value = 5;\n optional sint64 sint_value = 6;\n optional bool bool_value = 7;\n optional NewMessageInValue custom_value = 8; // THIS IS NEW\n }\n\n // Features are described in section 4.2 of the specification\n message Feature {\n optional uint64 id = 1 [ default = 0 ];\n\n // Tags of this feature are encoded as repeated pairs of\n // integers.\n // A detailed description of tags is located in sections\n // 4.2 and 4.4 of the specification\n repeated uint32 tags = 2 [ packed = true ];\n\n // The type of geometry stored in this feature.\n optional GeomType type = 3 [ default = UNKNOWN ];\n\n // Contains a stream of commands and parameters (vertices).\n // A detailed description on geometry encoding is located in\n // section 4.3 of the specification.\n repeated uint32 geometry = 4 [ packed = true ];\n }\n\n // Layers are described in section 4.1 of the specification\n message Layer {\n // Any compliant implementation must first read the version\n // number encoded in this message and choose the correct\n // implementation for this version number before proceeding to\n // decode other parts of this message.\n required uint32 version = 15 [ default = 1 ];\n\n required string name = 1;\n\n // The actual features in this tile.\n repeated Feature features = 2;\n\n // Dictionary encoding for keys\n repeated string keys = 3;\n\n // Dictionary encoding for values\n repeated Value values = 4;\n\n // Although this is an \"optional\" field it is required by the specification.\n // See https://github.com/mapbox/vector-tile-spec/issues/47\n optional uint32 extent = 5 [ default = 4096 ];\n\n extensions 16 to max;\n }\n\n repeated Layer layers = 3;\n\n extensions 16 to 8191;\n}\n"
.
But the ./scripts/dump currently hardcodes to .proto used to decode the tile at
. This hardcoding means that if a custom .proto where to add a new field, the scripts/dump would not be able to display the correct field name.
So, to improve this we should enhance scripts/dump to find a way to read the .proto via the info.json. Perhaps the ./scripts/dump could be changed to simply:
accept an argument of a number (to denote a fixture id) rather than the path to the tile.mvt
then it would find both the tile.mvt and the info.json for a given fixture and dump the data using the correct, potentially custom, .proto string.
The text was updated successfully, but these errors were encountered:
It is possible to use a custom
.proto
when generating new fixtures, like fixture 11 does:mvt-fixtures/src/011.js
Line 116 in d015ae5
It is also possible to later reference this custom .proto since it is embedded into the
info.json
likemvt-fixtures/fixtures/011/info.json
Line 9 in d015ae5
But the
./scripts/dump
currently hardcodes to.proto
used to decode the tile atmvt-fixtures/scripts/dump
Line 23 in d015ae5
scripts/dump
would not be able to display the correct field name.So, to improve this we should enhance
scripts/dump
to find a way to read the .proto via theinfo.json
. Perhaps the./scripts/dump
could be changed to simply:The text was updated successfully, but these errors were encountered: