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

Parser breaks on MultiPoint #12

Open
JaZo opened this issue Jan 10, 2019 · 0 comments
Open

Parser breaks on MultiPoint #12

JaZo opened this issue Jan 10, 2019 · 0 comments

Comments

@JaZo
Copy link

JaZo commented Jan 10, 2019

Detailed description

MultiPoint ((10 10), (20 20))

CrEOF \ Geo \ WKT \ Exception \ UnexpectedValueException
[Syntax Error] line 0, col 12: Error: Expected CrEOF\Geo\WKT\Lexer::T_INTEGER, got "(" in value "MultiPoint ((10 10), (20 20))"

MultiPoint (10 10, 20 20) (no parenthesis around individual points)

Ok

Context

The WKT specification states that the first WKT string is valid, while the second isn't: http://www.opengeospatial.org/standards/sfa (version 1.2.1, section 7.2.2, page 55), but this package has a test that explicitly defines that the first WKT string is invalid: https://github.com/creof/wkt-parser/blob/master/tests/CrEOF/Geo/WKT/Tests/ParserTest.php#L461.

Possible implementation

The multiPoint method should be modified to comply with the spec, but this can be experienced as a breaking change. The parenthesis can also be made optional to make sure spec-compliant MultiPoints can be parsed, but also allow the variant without extra parenthesis.

If we agree on a solution, I can make you a PR.

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