Skip to content

Parsing with illegal numbers should fail #47

@tm-slavik57

Description

@tm-slavik57

We use wkx to validate and parse WKX strings coming as variables in HTTP requests.
We've noticed that it validates the general structure of the WKT when parsing but doesn't validate the numbers.

For example, wkx.Geometry.parse("POINTTTT(1 2)") will fail because there is no POINTTTT in WKT.
But, parsing wkx.Geometry.parse("POINT(a b)") will not fail, instead it will return a point with NaN for numbers:

Point {
  srid: undefined,
  hasZ: false,
  hasM: false,
  x: NaN,
  y: NaN,
  z: undefined,
  m: undefined
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions