mapbox / mapbox/geojson.io

Rendering Issue with Empty MultiLineString in GeoJSON

Open
#873 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs-repro
Dominant language
TypeScript
Stars
2.3k
Forks
640
PR merge metrics
No merged PRs in 30d

Description

When loading a GeoJSON with an empty MultiLineString geometry into geojson.io, subsequent valid geometries were not rendered. However, these geometries rendered correctly when the empty MultiLineString was removed. This behaviour seems inconsistent with the GeoJSON specification.

Relevant Standard Excerpt (RFC 7946, https://datatracker.ietf.org/doc/html/rfc7946):

"GeoJSON processors MAY interpret Geometry objects with empty 'coordinates' arrays as null objects."

What ever way they are interpreted, it's seems logical to just plot nothing and move on.

(An empty coordinates array arises naturally from code that doesn't yield certain results.)

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 issue in geojson.io with a GeoJSON MultiLineString whose coordinates array is empty, followed by valid geometries. Trace the geometry rendering path and verify that the empty geometry is skipped without preventing subsequent valid geometries from rendering; confirm the behavior against the RFC 7946 guidance cited in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.