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

Closed
stevage opened this issue Dec 17, 2019 · 1 comment · Fixed by #2008
Closed

Clarify 'propertyName' behaviour in dissolve #1806

stevage opened this issue Dec 17, 2019 · 1 comment · Fixed by #2008
Labels

Comments

@stevage
Copy link
Collaborator

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 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
rowanwins added a commit that referenced this issue Jan 18, 2021
mfedderly added a commit that referenced this issue Jul 6, 2021
* Overhaul approach for dissolve module

* Update docs. Resolves #1806

* More tests

* run prettier

* remove es6 and update yarn lock

* Fix trailing bracket

* rerun prettier

* Ditch spread operator

* prettier

* remove let

* Finally found remaining build dodginess

* add test for properties

* convert multipolys to polys to avoid breaking changes

* run prettier

* update package versions

* fix use of hasOwnProperty

* run prettier

* remove changes to yarn

* add empty line end yarnlock

* try update yarn lock again

Co-authored-by: mfedderly <mdfedderly@mdfedderly.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants