mapbox / mapbox/geobuf

json2geobuf doesn't encode altitude properly if a coordinate is missing altitude value

Open
#78 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
1k
Forks
86
PR merge metrics
No merged PRs in 30d

Description

Given a MULTIPOINT set like:

```
{
"type": "MultiPoint",
"coordinates": [
[-112.021, 46.58, 1400],
[-112.045, 46.6],
[-112.0331, 46.5901, 1342]
]
}
```
The resulting set, after being converted to a PBF using json2geobuf and decoded with geobuf2json (or other decoders) shows the same (first occurring) altitude for all points in the set:

```
{
"type": "MultiPoint",
"coordinates": [
[-112.021, 46.58, 1400],
[-112.045, 46.6, 1400],
[-112.0331, 46.5901, 1400]
]
}
```
The issue does not occur if the point in the sample set is given an altitude of 0 or another value.

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 reproducing the reported MULTIPOINT conversion through json2geobuf and geobuf2json using the coordinates shown in the issue. Trace how altitude values are encoded when one coordinate omits altitude, and verify that the missing altitude is not replaced by the first point's value.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.