Open alukach opened 9 years ago
@alukach I added your data as a test fixture https://github.com/Turfjs/turf-buffer/commit/2ce85b201d6e2f1f512123818763e387cc8b7118
I will get a new turf version rolled out next week and close this issue then. Thanks!
Any progress>?
Ran into this issue, any further progress getting the fix incorporated into turf?
When trying to buffer on a
FeatureCollection
ofMultiPolygons
(this file), the current Buffer code (turf-buffer
v1.0.1
used byturf
v2.0.2
) prepares the data by running it throughcombine
. If theFeatureCollection
's first feature's geometry type (fc.features[0].geometry.type
) is"MultiPolygon"
, nogeometry
property is appended to theFeatureCollection
during thecombine
operation. When thebufferOp
later passes a stringified version offeature.geometry
(which isundefined
) to an instance ofjsts.io.GeoJSONReader
, the errorUncaught TypeError: Cannot read property 'type' of undefined
is thrown. Based on my reading of the GeoJSON Feature Collection Objects spec, it is not invalid for aFeatureCollection
object to not have ageometry
property on the root of the object.This bug appears to have been fixed with this committed change, so this issue can likely be tagged
wont fix
. I'm more interested in created this issue so that:turf
v2.0.2
and any otherturf
versions relying onturf-buffer
v.1.0.1
.turf-combine
)turf-buffer
>v1.0.1
(the repo appears to be atv1.0.4
at this moment) will be rolled into a main version ofturf
.