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

Support preclustering filtering #11

Closed
lucaswoj opened this issue May 23, 2016 · 4 comments
Closed

Support preclustering filtering #11

lucaswoj opened this issue May 23, 2016 · 4 comments

Comments

@lucaswoj
Copy link

Allow users to filter features before they are clustered.

cc @lyzidiamond @mourner

@mourner
Copy link
Member

mourner commented May 23, 2016

I don't think this should be done on the supercluster side — you can just do geojson.features.filter(function () { ... }) before passing the result to supercluster. If we need this on the GL JS side, let's open a ticket there.

@lucaswoj
Copy link
Author

Agreed. Bringing in feature-filter as a dep of supercluster doesn't make much sense. I opened an upstream ticket.

@strech345
Copy link

strech345 commented Feb 23, 2017

so how does it the filtering for clusters from geojson works?
Please give a example

I need to filter dynamiclally (on user interactions). so it would be nice to use the standard filter functionality in mapbox

@Nogginboink
Copy link

I'm not a Javascript expert, but I'm curious about the ramifications of filtering geoJSON points before passing the result to supercluster.

Let's say I want my user to be able to filter results in the GUI. If I have to filter before passing the results to SC, does that mean I need to keep two copies of my data? I'd need to keep one copy of the full dataset (so that I can apply filters to it each time the user changes filtering criteria), and then a second copy of just the filtered data that I pass to supercluster. For a dataset of hundreds of thousands or millions of points, that's a lot of memory spent on two copies of data, isn't it?

If supercluster did the filtering internally with a filter() property, then only one copy of the data would have to be kept in memory. (Although clusters would of course have to be recomputed when filters are applied.)

I may be misunderstanding how Javascript manages memory in this scenario. If I am, I apologize.

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