-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Crash: JavaScript heap out of memory #85
Comments
Getting the same with: const {intersection} = require('martinez-polygon-clipping');
const polyA = { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [[[180.60987101280907, 22.943242898435663], [280.6098710128091, 22.943242898435663], [280.6098710128091, 62.94324289843566], [180.60987101280907, 62.94324289843566], [180.60987101280907, 22.943242898435663]]] } };
const polyB = { "type": "Feature", "properties": {}, "geometry": { "type": "Polygon", "coordinates": [[[-5.65625, 110.828125], [-7.53125, 202.234375], [366.0625, 202.234375], [356.6875, 65.828125], [260.125, 59.265625], [253.09375, 40.984375], [189.34375, 19.890625], [141.0625, 36.765625], [111.53125, 6.765625], [73.5625, 36.765625], [67.46875, 10.984375], [41.21875, 10.515625], [36.0625, 42.390625], [65.59375, 53.171875], [-5.65625, 110.828125]]] } };
intersection(polyA.geometry.coordinates, polyB.geometry.coordinates); |
If it helps, when scaling all coordinates by Here's another failing case, if it is of any relevance (numbers scaled to also appear as proper GeoJSON coordinates): const {intersection} = require('martinez-polygon-clipping');
const polyA = {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[3.846028904999335,7.51285572161238],[13.846028904999335,7.51285572161238],[13.846028904999335,11.512855721612379],[3.846028904999335,11.512855721612379],[3.846028904999335,7.51285572161238]]]}};
const polyB = {"type":"Feature","properties":{},"geometry":{"type":"Polygon","coordinates":[[[-0.565625,11.0828125],[-0.753125,20.2234375],[36.60625,20.2234375],[35.66875,6.5828125],[26.0125,5.9265625],[25.309375,4.0984375],[18.934375,1.9890625],[14.10625,3.6765625],[11.153125,0.6765625],[7.35625,3.6765625],[6.746875,1.0984375],[4.121875,1.0515625],[3.60625,4.2390625],[6.559375,5.3171875],[-0.565625,11.0828125]]]}};
intersection(polyA.geometry.coordinates, polyB.geometry.coordinates); |
Suggestion from w8r/martinez#85 (comment)
Resolved in 0.6.0 by #111 |
Wasn't resolved by #111 - the demo site was a bit dodgy :( |
Both resolved by 0.7.3. |
Stack trace is from 0.4.1:
Geometry being intersected:
The larger geometry is China from Natural Earth, so they're both in this gist: https://gist.github.com/mojodna/4a98b2c0bb44e0224a3bce52aebb5000
The text was updated successfully, but these errors were encountered: