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

Clarify 'propertyName' behaviour in dissolve #1806

Open
stevage opened this issue Dec 17, 2019 · 1 comment
Open

Clarify 'propertyName' behaviour in dissolve #1806

stevage opened this issue Dec 17, 2019 · 1 comment
Labels

Comments

@stevage
Copy link
Collaborator

@stevage stevage commented Dec 17, 2019

Currently .dissolve() supports a property option which is a pretty limited way of saying "apply the dissolve to these polygons, but not those ones".

A more flexible approach would be a filter function:

var dissolved = turf.dissolve(features, { filter: f => f.properties.id === 47 } );

This way you're less likely to have to pre-massage the polygons to get the dissolve you want.

@stevage
Copy link
Collaborator Author

@stevage stevage commented Dec 17, 2019

Oh, actually I think it does do what I want, the documentation could just be clearer.

Replace:

features with equals 'propertyName' in

with

features with the same propertyName value will be dissolved.

@stevage stevage changed the title Support filter function for dissolve Clarify 'propertyName' behaviour in dissolve Dec 17, 2019
@rowanwins rowanwins added the docs label Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.