terriajs
terriajs copied to clipboard
multiple polygon features are picked in the 3D mode
I have a simple square mesh polygon layer like below. When I picked one polygon, multiple polygons were selected. This won't happen in the 2D mode as well as when a camera look directly below in the 3D mode.
I made a short video clip to explain what I mean. https://app.screencast.com/PZdpkBU7d9fM8
Does someone know how to avoid this behavior?
Here is a sample data. sample.json
Yeah that is very strange. This only happens when using cesium primitives (instead of the new protomaps/geojson-vt renderer).
Definitely a bug here, not sure what is causing it. It might be a bug in cesium, as we let it do heavy lifting with feature picking. We will look into it 🙂
I'm able to reproduce selecting multiple features getting picked using the sample.json provided, I can also reproduce it with other data sources i.e. https://www.nationalmap.gov.au/#share=s-gpC6cPOcnSVtAEo3HW1cV3ZxKK6 by zooming out and clicking near where multiple features meet.
As @nf-s mentioned above this is handled at the cesium level so without further modifications of cesium itself we can't configure this behaviour. Ideally multiple features would be ordered by distance from the pick point, that's not currently the case.
imakihi: In your video it looks like the selected feature is quite far from the cell being clicked, is that the case or is it a latency with the screen capture?
@ljowen Sorry for my super slow response. I haven't checked your posting. In my case, the selected feature and clicked feature are far from each other. There was no latency with the screen capture. Thank you.
I believe this is a bug with cesiums picking when the features are clamped to ground, I've reproduced it here
This issue looks related https://github.com/CesiumGS/cesium/issues/10091 .
In the meantime you can try having forceCesiumPrimitives: false
to use the protomaps vector renderer although you would lose styling, see: https://docs.terria.io/guide/connecting-to-data/catalog-type-details/geojson/
@ljowen Thank you for the tip and the posting. It is very good information. While I wait a parmanetn fix, I am going to test a few settings suggested.
Thank you again.