-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
QuadkeyLayer implementation & tests #6678
Conversation
const [topLeft, bottomRight] = quadkeyToWorldBounds(quadkey); | ||
const [w, n] = worldToLngLat(topLeft); | ||
const [e, s] = worldToLngLat(bottomRight); | ||
return new Float64Array([e, n, e, s, w, s, w, n, e, n]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not necessary to convert the coordinates to a typed array. It only adds performance overheads because of extra GC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Is there a reason why a Float64Array
is created in s2-utils.js
?
https://github.com/visgl/deck.gl/blob/master/modules/geo-layers/src/s2-layer/s2-utils.js#L42
I've added the following example to the layer-browser and the documentation The test data is synthetic and needs to be uploaded to deck.gl-data: https://github.com/visgl/deck.gl/pull/6678/files#diff-202bd1a464188d5c7bfadc858bca0e579de2527f08217648e28aba7c31bef569 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is already pretty large and I think it's ok to merge as is.
Follow up, the GeoCellLayer needs to handle update trigger changes of the index accessor, and ideally avoid passing the expensive index to geo bounds conversion to getPolygon
- it will be called twice for each object in the tessellator. This is an existing perf issue in some of the current layers and not introduced by this PR.
For #6677
Change List
GeoCellLayer
to share common code betweenH3ClusterLayer
&S2Layer
QuadkeyLayer
(also based onGeoCellLayer
)QuadkeyLayer
added to layer-browser