Skip to content

Incorrect encoding of LineStrings when using fromGeojsonVt #35

@ibesora

Description

@ibesora

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions