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

Add an option to get centroids #371

Merged
merged 3 commits into from
Sep 19, 2019
Merged

Add an option to get centroids #371

merged 3 commits into from
Sep 19, 2019

Conversation

manthey
Copy link
Member

@manthey manthey commented Sep 19, 2019

When there are too many elements to load all of them due to complexity, this loads all element centroids (actually the center of their bounding boxes) along with the element size (the diagonal of the bounding box). If an element has not been loaded, a circle is shown at the centroid with an adjusted diameter that is related to the bounding box size.

This doesn't actually load all element centroids, just the first 2,000,000. This number should be empirically determined based on GPU memory (something like half the memory divided by (16 or 17) * 4 * vpf would be appropriate).

Other improvements would be to (a) add hover events for centroid elements -- we know the ID and the center position, but not much else, (b) determine if any point's radius would be bigger than the webgl maximum point size, and, if so, render using a different primitive shape; otherwise, very large points render incorrectly, (c) if zoomed-out fully there seems to be an extra fetch of data on initial load, (d) compute a better centroid and size that the bounding box center and diagonal; this could be done on ingest.

This PR will benefit from a GeoJS release -- small points are rendered poorly in master.

When annotation centroids are retrieved, the response is a json-like object with a binary payload in the center. If there are a large number of distinct styles in the annotation, this can become inefficient (for instance, if every element has a distinct fill and stroke color).

The format for how source files are mentioned changed between version
2.5.x and 2.6; follow along.
When there are too many elements to load all of them due to complexity,
this loads all element centroids (actually the center of their bounding
boxes) along with the element size (the diagonal of the bounding box).
If an element has not been loaded, a circle is shown at the centroid
with an adjusted diameter that is related to the bounding box size.

This doesn't actually load *all* element centroids, just the first
2,000,000.  This number should be empirically determined based on GPU
memory (something like half the memory divided by (16 or 17) * 4 * vpf
would be appropriate).

Other improvements would be to (a) add hover events for centroid
elements -- we know the ID and the center position, but not much else,
(b) determine if any point's radius would be bigger than the webgl
maximum point size, and, if so, render using a different primitive
shape; otherwise, very large points render incorrectly, (c) if
zoomed-out fully there seems to be an extra fetch of data on initial
load, (d) compute a better centroid and size that the bounding box
center and diagonal; this could be done on ingest.

This PR will benefit from a GeoJS release -- small points are rendered
poorly in master.

When annotation centroids are retrieved, the response is a json-like
object with a binary payload in the center.  If there are a large number
of distinct styles in the annotation, this can become inefficient (for
instance, if every element has a distinct fill and stroke color).
@kheffah kheffah assigned kheffah and unassigned kheffah Sep 19, 2019
@manthey
Copy link
Member Author

manthey commented Sep 19, 2019

Since #369 was approved, I'm merging this as well.

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

Successfully merging this pull request may close these issues.

2 participants