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

Parsing with illegal numbers should fail #47

Open
tm-slavik57 opened this issue Jun 30, 2021 · 0 comments
Open

Parsing with illegal numbers should fail #47

tm-slavik57 opened this issue Jun 30, 2021 · 0 comments

Comments

@tm-slavik57
Copy link

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
}
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