The parser is forgiving unbalanced parens, missing commas, and invalid object names
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 281
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
Those three strings, when parsed, result in a valid GeoJSON output:
```
MULTIPOLYGON(40 40,20 45,45 30,40 40)),((20 35,10 30,10 10,30 5,45 20,20 35)))
MULTIPOLYGON(((40 40,20 45,45 30,40 40))((20 35,10 30,10 10,30 5,45 20,20 35)))
MULTIPOLYGONN(((40 40,20 45,45 30,40 40)),((20 35,10 30,10 10,30 5,45 20,20 35)))
```
I'd expect a `null` instead.
Otherwise, in our use case, the invalid WKT passes the browser-side validation and makes it through to a Postgres/PostGIS DB. PostGIS then rejects anything like the three examples above.
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 by running the three malformed WKT strings through the parser entry point and checking the generated GeoJSON. Add regression coverage showing that unbalanced parentheses, missing commas, and the invalid object name produce null, then verify valid WKT parsing remains unchanged.
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
- 35/100