Skip to content

Parser breaks on MultiPoint #12

@JaZo

Description

@JaZo

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions