wkx icon indicating copy to clipboard operation
wkx copied to clipboard

Unable to parse WKT string

Open polizz opened this issue 6 years ago • 1 comments

The wkt POLYGON((-89.31029407 38.72017071,-89.30548017 38.72017071,-89.30421905 38.72418814,-89.31029407 38.72376013,-89.31029407 38.72017071))

causes parse to throw the following error:

_string-trim.js:25 Uncaught RangeError: Maximum call stack size exceeded
    at RegExp.exec (<anonymous>)
    at RegExp.[Symbol.replace] (<anonymous>)
    at String.replace (<anonymous>)
    at ./node_modules/@babel/polyfill/node_modules/core-js/modules/_string-trim.js.exporter.trim (_string-trim.js:25)
    at parseFloat (_parse-float.js:5)
    at WktParser../node_modules/wkx/lib/wktparser.js.WktParser.matchCoordinate (wktparser.js:103)
    at WktParser../node_modules/wkx/lib/wktparser.js.WktParser.matchCoordinates (wktparser.js:112)
    at Function../node_modules/wkx/lib/polygon.js.Polygon._parseWkt (polygon.js:56)
    at Function../node_modules/wkx/lib/geometry.js.Geometry._parseWkt (geometry.js:61)
    at Function../node_modules/wkx/lib/geometry.js.Geometry.parse (geometry.js:26)

via:

wkx.Geometry.parse('POLYGON((-89.31029407 38.72017071,-89.30548017 38.72017071,-89.30421905 38.72418814,-89.31029407 38.72376013,-89.31029407 38.72017071))')

Can you let me know what I'm doing wrong?

polizz avatar Mar 25 '20 14:03 polizz

I've tested your wkt with node 12.x and in Chrome, but couldn't reproduce it.

cschwarz avatar Mar 26 '20 17:03 cschwarz