empty wkt multipolygon does not roundtrip
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 281
- Forks
- 47
- PR merge metrics
- No merged PRs in 30d
Description
If you start with
```js
const wkt = 'MULTIPOLYGON EMPTY'
```
and then try to roundtrip it using
```js
const newWkt = stringify(parse(wkt))
```
you end up with `MULTIPOLYGON ()`. which in turn parses to `null` (which cannot be stringified anymore).
So in summary:
- `MULTIPOLYGON EMPTY` parses just fine, to a geometry with empty coordinates array
- a multipolygon geometry with empty coordinates array stringifies to `MULTIPOLYGON ()` instead of `MULTIPOLYGON EMPTY`, and is treated as invalid syntax when re-parsing it, resulting in a `null` parsing result
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 JavaScript parse/stringify example from the issue and inspect how empty multipolygon coordinates are handled by both entry points. Done means `MULTIPOLYGON EMPTY` parses and stringifies back to valid WKT that parses again without producing `null`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100