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

RangeError: Maximum call stack size exceeded #59

Closed
mfogel opened this issue Jan 11, 2019 · 1 comment
Closed

RangeError: Maximum call stack size exceeded #59

mfogel opened this issue Jan 11, 2019 · 1 comment
Assignees
Labels
bug Something isn't working
Milestone

Comments

@mfogel
Copy link
Owner

mfogel commented Jan 11, 2019

Performing a union on these two shapes results in a series of recursive calls that goes too deep (infinitely deep? TBD)

First few lines of the error backtrace

(node:42015) UnhandledPromiseRejectionWarning: RangeError: Maximum call stack size exceeded
    at Segment.ringsAfter (webpack://polygon-clipping/./src/segment.js?:368:31)
    at Segment._ringsBefore (webpack://polygon-clipping/./src/segment.js?:364:50)
    at Segment.ringsBefore (webpack://polygon-clipping/./src/segment.js?:357:77)
    at Segment._ringsAfter (webpack://polygon-clipping/./src/segment.js?:376:24)
    at Segment.ringsAfter (webpack://polygon-clipping/./src/segment.js?:370:77)
    at Segment._ringsBefore (webpack://polygon-clipping/./src/segment.js?:364:50)
    at Segment.ringsBefore (webpack://polygon-clipping/./src/segment.js?:357:77)
    at Segment._ringsAfter (webpack://polygon-clipping/./src/segment.js?:376:24)
    at Segment.ringsAfter (webpack://polygon-clipping/./src/segment.js?:370:77)
    ...
@mfogel mfogel added the bug Something isn't working label Jan 11, 2019
@mfogel mfogel added this to the v0.11 milestone Jan 11, 2019
@mfogel
Copy link
Owner Author

mfogel commented Jan 11, 2019

A minimal set of input coordinates that generate this error (derived from the above linked shapes):

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": null,
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [-122.495, 37.969],
            [-122.4955412, 37.9686859],
            [-122.4953267, 37.9681039],
            [-122.495, 37.969]
          ]
        ]
      }
    },
    {
      "type": "Feature",
      "properties": null,
      "geometry": {
        "type": "Polygon",
        "coordinates": [
          [
            [-122.4953, 37.9686],
            [-122.4955412, 37.9686859],
            [-122.49552796881444, 37.96865],
            [-122.4953, 37.9686]
          ]
        ]
      }
    }
  ]
}
Loading

@mfogel mfogel self-assigned this Jan 11, 2019
@mfogel mfogel closed this as completed in 5e5459f Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant