Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid LineString is not reported and breaks further #118

Open
ghost opened this issue Mar 19, 2021 · 0 comments
Open

Invalid LineString is not reported and breaks further #118

ghost opened this issue Mar 19, 2021 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 19, 2021

One of our GeoJSON features violates https://tools.ietf.org/html/rfc7946#section-3.1.4:

For type "LineString", the "coordinates" member is an array of two or more positions.

Our feature looks like this:

{
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "LineString",
    "coordinates": []
  }
}

We normally generate the coordinates from a list of recorded locations, so if there aren't enough recorded locations, we violate the spec. Similar to this mapbox sample, which also runs into the same issue: https://docs.mapbox.com/mapbox-gl-js/example/animate-a-line/

However, mapbox-gl-js (internally geojson-vt) happily accepts this GeoJSON.

When we run geobuf on this, the generated feature looks like this:

{
  "type": "Feature",
  "properties": {},
  "geometry": {
    "type": "LineString"
  }
}

So the entire coordinates field is removed.

Suddenly mapbox-gl-js (internally geojson-vt) trips on this.
It's assumed to exist here and then accessed during conversion, which leads to errors.

I did not check if a similar issue exists for other types, but I'd assume so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants