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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat] GPU filter and brush for GeoJson layer #4

Open
wants to merge 3 commits into
base: xli-add-polylabel
Choose a base branch
from

Conversation

lixun910
Copy link
Member

@lixun910 lixun910 commented Sep 28, 2023

In a previous pull request #3, the use of a spatial index reduced the time required to query the geometries within the selection polygon to only 3 to 4 milliseconds over ~1 million polygons. When the selection polygon is moved, geometries that fall within the polygon should be highlighted, and geometries that fall outside the polygon should be hidden. This process is also known as brushing.

Brushing the geometries in a GeoJsonLayer should be a straightforward process of hiding geometries that have not been selected. Since all the vertices of geometries have already been loaded in GPU, there should be a fast way to implement brushing in a GeoJson layer.

This PR is trying to add a new Deck.gl Layer extension to brush geojson layer

Super fast GPU brushing over ~1 million polygons: 馃殌
fast-brush

  • an instanced attribute instanceHighlighted is added to the layer to indicate whether the feature is highlighted
  • the shader module is modified to discard the feature in fragment shader if instanceHighlighted is 0
  • the accessor getHighlighted() is used to get the value of instanceHighlighted based on the search result in GeoJsonlayer

Performance:

deck: Updated attributes for 7314969 instances in azfyr45-polygons-fill in 162ms

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