Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty wkt multipolygon does not roundtrip #38

Open
senritsu opened this issue Nov 5, 2019 · 0 comments
Open

empty wkt multipolygon does not roundtrip #38

senritsu opened this issue Nov 5, 2019 · 0 comments

Comments

@senritsu
Copy link

senritsu commented Nov 5, 2019

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
@senritsu senritsu changed the title empty wkt geometries do not roundtrip empty wkt multipolygon does not roundtrip Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant