If you start with
const wkt = 'MULTIPOLYGON EMPTY'
and then try to roundtrip it using
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
If you start with
and then try to roundtrip it using
you end up with
MULTIPOLYGON (). which in turn parses tonull(which cannot be stringified anymore).So in summary:
MULTIPOLYGON EMPTYparses just fine, to a geometry with empty coordinates arrayMULTIPOLYGON ()instead ofMULTIPOLYGON EMPTY, and is treated as invalid syntax when re-parsing it, resulting in anullparsing result