-
Notifications
You must be signed in to change notification settings - Fork 19
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
Exceeded Call Stack #7
Comments
Thanks for the report. Looks like adaptive subsampling algorithm I reused uses recursion and for some reason dove too deep on a particular path. The If you have the time, I'd appreciate it if you can either share the SVG that caused this issue, or (if its proprietary) pare it down to find the path in question causing the issue. |
When executing a svg the following error appears below, how can I fix it: (node:9140) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded svg: <style type="text/css"> .st0{fill:none;stroke:#000000;stroke-width:0.8504;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;} </style> [svg.txt](https://github.com/Phrogz/svg-path-to-polygons/files/4582163/svg.txt) |
Hello, I was able to detect the path that causes this issue:
I hope it can help you find the issue :) |
@Phrogz for us this is usually curves where the start and end points are the same. |
773k world.svg
When running i get the following:
svg2geojson --layers -m world.svg
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
Ignoring unhandled element text
events.js:187
throw er; // Unhandled 'error' event
^
RangeError: Maximum call stack size exceeded
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:55:28)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
at sampleCubicBézier (/usr/local/lib/node_modules/svg2geojson/node_modules/svg-path-to-polygons/svg-path-to-polygons.js:79:5)
Emitted 'error' event on Parser instance at:
at Parser.exports.Parser.Parser.parseString (/usr/local/lib/node_modules/svg2geojson/node_modules/xml2js/lib/parser.js:327:16)
at Parser.parseString (/usr/local/lib/node_modules/svg2geojson/node_modules/xml2js/lib/parser.js:5:59)
at loadFromString (/usr/local/lib/node_modules/svg2geojson/lib/svg2geojson.js:21:3)
at loadFromFile (/usr/local/lib/node_modules/svg2geojson/lib/svg2geojson.js:15:2)
at Object. (/usr/local/lib/node_modules/svg2geojson/bin/svg2geojson:41:1)
The text was updated successfully, but these errors were encountered: