Incorrect encoding of LineStrings when using fromGeojsonVt
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 206
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
When using geojsonvt to create tilesets I found that some layers were incorrectly rendered.
Examining what happened I found that the geometry that comes from _geojsonvt_ contains all the LineString geometry on a single array: instead of having [[x0, y0], [x1, y1], ..., [xN, yN]] it's all flattened as [x0, y0, x1, y1, ... xN, yN].
When using _fromGeojsonVT_ this is not correctly interpreted in _FeatureWrapper::loadGeometry_ so the geometry contains an array of Points with undefined coordinates.
Should something be implemented in _vt-pbf::fromGeojsonVt_ to correctly interpret this case?
I was thinking about modifying GeoJSONWrapper to also store the feature type so when geometry is loaded from a LineString it checks wether the geometry comes as a single array or an array of arrays.
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
Start at FeatureWrapper::loadGeometry and inspect how GeoJSONWrapper represents LineString geometry from geojsonvt. Reproduce the issue with a flattened LineString, then ensure fromGeojsonVt produces points with valid coordinates for both flattened and nested geometry forms.
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
- 45/100