CesiumGS / CesiumGS/cesium

Retrieve point cloud point positions on click

Open
#7,953 7 comments 8 reactions 0 assignees View on GitHub
category - 3d tiles type - enhancement
Dominant language
JavaScript
Stars
15.7k
Forks
3.9k
Avg merge
4d 6h
Merged PRs (30d)
34

Description

This is something that's come up a few times recently on the forum. There's some good discussion on it in these threads:

* [how to get exact point location of a point cloud data](https://groups.google.com/forum/#!topic/cesium-dev/O988-WDy82I)
* [Snapping to closest point in a point cloud](https://groups.google.com/forum/#!msg/cesium-dev/miFO7Fux1HY/FCk_en1pAwAJ)

> Yes we have the same issue. Our solution was to use a spatialite database to do a spatial query on the point cloud as this was able to bypass the screen-space inaccuracies and the fact that there's no GPU-CPU transfer of point cloud data. Obviously not ideal for many reasons, but it enabled us to show details for the exact location of a point.
Omar, it's the definition of "exact" that's the issue. The buffer will get *very* close, but when dealing with point clouds with an accuracy of 1/10mm, the buffer isn't good enough. Plus it sometimes gives wildly inaccurate values if you're on the very edge of a point (in the order of hundreds of metres inaccurate).

Some notes from @lilleyse about how we could go about implementing this:

* Does the data need to reside on the CPU or is it fast enough to do GPU copy with gl.bufferSubData? All point data is stored in vertex buffers.
* If going with CPU approach, add an option that controls whether the data stays on the CPU. This is the line that normally deletes it: https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Scene/PointCloud.js#L1323.
* Add an API for retrieving point data . Something imilar to Cesium3DTileFeature. The problem is we don't want to create a Cesium3DTileFeature per point, so we'll need something leaner.

Contributor guide

Open the contributing guide

Research direction

Start with Source/Scene/PointCloud.js around the cleanup at line 1323, then review the linked forum discussions and the notes about CPU versus GPU point data. Define an API that can retrieve the clicked point's position accurately without creating a Cesium3DTileFeature per point; done means point positions are available reliably through that API.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, computer-graphics
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.