mapbox / mapbox/vt-pbf

Fix invalid multipoint geometry encoding

Open
#30 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
206
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Multipoint geometries are currently encoded as multiple 1-length `MoveTo` commands. The `vector-tile-js` library decodes this fine, but it's incorrect according to the spec:

> 4.3.4.2. Point Geometry Type
> The POINT geometry type encodes a point or multipoint geometry. The geometry command sequence for a point geometry MUST consist of a single MoveTo command with a command count greater than 0.
>
> If the MoveTo command for a POINT geometry has a command count of 1, then the geometry MUST be interpreted as a single point; otherwise the geometry MUST be interpreted as a multipoint geometry, wherein each pair of ParameterIntegers encodes a single point.

https://github.com/mapbox/vector-tile-spec/blob/master/2.1/README.md#4342-point-geometry-type

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the multipoint geometry encoder in the JavaScript library and compare its command sequence with the linked vector-tile specification. Verify that a multipoint is represented by one MoveTo command with a count greater than 1, then run the relevant existing tests or add coverage showing the encoded geometry follows the specification.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.