mapbox / mapbox/vector-tile-spec
Extension for per-node attributes
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 1k
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
It would sometimes be useful to have per-node attributes within a LineString, MultiLineString, Polygon, or MultiPolygon feature, for example to link these nodes back to the OSM IDs that they came from.
I'm thinking this could look in GeoJSON something like this:
{ "type": "Feature", "properties": { ... }, "geometry": " { ... },
"linear-attributes": [ null, null, { "node": 12345 }, { "node": 56789, "way": 66 }, null, { "node": 55 }, null ] }
where there the linear-attributes array has the same structure as the geometry.coordinates array, and each element is either null if there is no attribute, or a set of key-value pairs if there are attributes. (Or some other syntax if anybody has any better idea.)
In the vector tile, it could be part of the Feature:
repeated sint linear_attributes = 5 [ packed = true ];
where each positive number represents a key or value in the layer attributes, like in the keys, and each negative number represents (forward) motion through the geometry, so the above would be encoded as:
-2 (move 2),
0 (node), 0 (12345), -1 (move 1),
0 (node), 1 (56789), 1 (way), 2 (66), -2 (move 2),
0 (node), 3 (55), -2 (move 2)
Alternately we could define new geometry types where each position contains x and y coordinates followed by a count of attributes and a set of key-value references, since the parallel arrays might be awkward to maintain.
Any opinions on this idea?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the proposed GeoJSON linear-attributes structure and the vector-tile linear_attributes encoding described in the issue. Compare the alternatives and determine whether the specification has enough consensus to define a concrete extension; done would require an agreed design rather than only an implementation preference.
Written by the indexing model from the issue text.
Assessment
- Domain
- data, documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100