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
}
We use
wkxto 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 noPOINTTTTin WKT.But, parsing
wkx.Geometry.parse("POINT(a b)")will not fail, instead it will return a point with NaN for numbers: