mapbox / mapbox/csv2geojson

Error or null geometry when lng,lat not detected?

Open
#50 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
373
Forks
80
PR merge metrics
No merged PRs in 30d

Description

In previous versions, this module threw an error when lng,lat were not detected. The documentation suggests this still should happen:

Err is non-falsy if latitude and longitude values cannot be detected or if there are invalid rows in the file.

However, I think commit https://github.com/mapbox/csv2geojson/commit/ee8d854540c5733bbc79c1f7678228988b850dc5 changed this behavior. The module now returns a null geometry. However, that commit did not update the documentation, and it left the relevant test in a strange place, where its description no longer matches its outcome.

So @tmcw I'm wondering which route you think would be best for this module. Should we document and clearly test the actual current behavior — not erroring, instead returning null geometry — or go back to the way things were — erroring?

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

Compare the current behavior with the documentation and inspect the relevant test identified in commit ee8d854540c5733bbc79c1f7678228988b850dc5. First determine whether missing lng,lat values should produce an error or null geometry. Done means the chosen behavior, documentation, and test description agree.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.