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

Unable to Buffer on FeatureCollection of MultiPolygons #22

Open
alukach opened this issue Apr 4, 2015 · 3 comments
Open

Unable to Buffer on FeatureCollection of MultiPolygons #22

alukach opened this issue Apr 4, 2015 · 3 comments

Comments

@alukach
Copy link

alukach commented Apr 4, 2015

When trying to buffer on a FeatureCollection of MultiPolygons(this file), the current Buffer code (turf-buffer v1.0.1 used by turf v2.0.2) prepares the data by running it through combine. If the FeatureCollection's first feature's geometry type (fc.features[0].geometry.type) is "MultiPolygon", no geometry property is appended to the FeatureCollection during the combine operation. When the bufferOp later passes a stringified version of feature.geometry (which is undefined) to an instance of jsts.io.GeoJSONReader, the error Uncaught 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 a FeatureCollection object to not have a geometry 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:

  1. It can be logged as a known issue for users of turf v2.0.2 and any other turf versions relying on turf-buffer v.1.0.1.
  2. Propose that a subset of that test file make it's way into a test fixture (likely within turf-combine)
  3. Enquire as to when turf-buffer >v1.0.1 (the repo appears to be at v1.0.4 at this moment) will be rolled into a main version of turf.
@morganherlocker
Copy link
Member

@alukach I added your data as a test fixture 2ce85b2

I will get a new turf version rolled out next week and close this issue then. Thanks!

@MichaelMarkieta
Copy link

Any progress>?

@k-mahoney
Copy link

Ran into this issue, any further progress getting the fix incorporated into turf?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants