You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I stumbled upon an error while trying to use d3.geoBounds, and while trying to understand the cause of it I found something that is most likely a bug in area.js
Here's the part of the code I think is causing the error
exportvarareaRingSum;varareaSum,lambda00,phi00,lambda0,cosPhi0,sinPhi0;exportvarareaStream={point: noop,lineStart: noop,lineEnd: noop,polygonStart: function(){areaRingSum.reset();// <<< areaRingSum was never initializedareaStream.lineStart=areaRingStart;areaStream.lineEnd=areaRingEnd;},polygonEnd: function(){varareaRing=+areaRingSum;areaSum.add(areaRing<0 ? tau+areaRing : areaRing);this.lineStart=this.lineEnd=this.point=noop;},sphere: function(){areaSum.add(tau);}}
And here's the error
Cannot read property 'reset' of undefined
at Object.areaStream.polygonStart (...\node_modules\d3-geo\build\d3-geo.js:169:18)
at Object.boundsStream.polygonStart (...\node_modules\d3-geo\build\d3-geo.js:278:18)
at streamPolygon (...\node_modules\d3-geo\build\d3-geo.js:143:12)
at Object.streamGeometryType.MultiPolygon (...\node_modules\d3-geo\build\d3-geo.js:126:23)
at streamGeometry (...\node_modules\d3-geo\build\d3-geo.js:88:40)
at Object.streamObjectType.Feature (...node_modules\d3-geo\build\d3-geo.js:94:7)
at geoStream (...\node_modules\d3-geo\build\d3-geo.js:150:36)
at Object.bounds [as geoBounds] (...\node_modules\d3-geo\build\d3-geo.js:400:5)
I think it's worth noting that d3.geoCentroid and d3.geoLength all work on the same GeoJson object that causes the error when passed to d3.geoBounds
Also, d3.geoBounds returns [NaN, NaN] when a point is passed instead of a multipolygon, but I don't know the cause of this.
The text was updated successfully, but these errors were encountered:
I stumbled upon an error while trying to use d3.geoBounds, and while trying to understand the cause of it I found something that is most likely a bug in area.js
Here's the part of the code I think is causing the error
And here's the error
I think it's worth noting that d3.geoCentroid and d3.geoLength all work on the same GeoJson object that causes the error when passed to d3.geoBounds
Also, d3.geoBounds returns [NaN, NaN] when a point is passed instead of a multipolygon, but I don't know the cause of this.
The text was updated successfully, but these errors were encountered: