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

Points and polygons without elevation are drawn underneath terrain #702

Open
meh9 opened this issue May 20, 2015 · 10 comments
Open

Points and polygons without elevation are drawn underneath terrain #702

meh9 opened this issue May 20, 2015 · 10 comments

Comments

@meh9
Copy link
Contributor

meh9 commented May 20, 2015

When you load polygon or point data with no associated elevation set, these features are drawn by Cesium on the geoid underneath any 3D terrain. This isn't a problem as long as you keep the view looking straight down, but as soon as you tilt the view the points/polygons "move" across the landscape due to the parallax effect.

For points with no elevation might it be possible to find the terrain elevation at the point and draw it "clamped to ground"?

I can see that things might be a bit trickier with polygon data, which I guess would essentially have to be projected on top of the terrain.

@kring
Copy link
Member

kring commented May 22, 2015

I wrote some hacky code in KmlCatalogItem to put polygons on terrain. We could apply that code to other types of catalog items if desired.

The actual solution is a complicated Cesium feature, and it is in the works:
CesiumGS/cesium#2618

@kring
Copy link
Member

kring commented Oct 4, 2016

Cesium now has built-in support for polygons and billboards on terrain. We just need to do some things to make it work in TerriaJS. Specifically, I believe we need to pass a Cesium Scene into data sources with on-terrain features, which is a hassle because we sometimes create data sources before the Scene is even created. Plus the Scene can come and go during the lifetime of the DataSource. Oh and even then, polygons on terrain have hardware and browser requirements, so it won't work on every system. So this is still tricky, but we're closer.

@axman6 axman6 added the P-AREMI label Oct 31, 2016
@RacingTadpole
Copy link
Contributor

Here's an example of it - in NationalMap, select ACT Govt -> Land admin -> Class B Units. When you click on a polygon, the highlighted region appears too small and to the side.
image

This does not happen in 2D or 3D smooth mode.

@AnaBelgun
Copy link
Member

AnaBelgun commented Feb 28, 2018

ANU Stored data (high value to renewables market) will use this demo in a conference to showcase reservoirs elevation and dam walls; the issue has high impact on this data viz

image

@geoffrowland
Copy link
Contributor

geoffrowland commented Jul 4, 2018

Has there been any recent progress with this in TerriaJS?. Would be nice if KML and GeoJSON lines and polygons were 'clamped-to-ground' in 3D by default.

@kring
Copy link
Member

kring commented Jul 5, 2018

No progress yet, sorry @geoffrowland. It's probably not terribly hard to make Cesium's support work in TerriaJS, though even Cesium's support has lots of caveats.

@meh9
Copy link
Contributor Author

meh9 commented Mar 23, 2019

@kring we should just disable drawing selected polygons when in terrain mode, because it looks pretty terrible. What do you think?

@kring
Copy link
Member

kring commented Mar 23, 2019

I fixed this for the digital twin project, just need to merge it. It might be in one of the pull requests I've already opened actually.

@geoffrowland
Copy link
Contributor

Does this mean KML and GeoJSON lines and polygons will be 'clamped-to-ground' in 3D?
If so, brilliant!

At the moment, I have reverted to using CesiumJS to support this, but miss all the other lovely features of TerriaJS.

@geoffrowland
Copy link
Contributor

Just noticed that the latest releases have a clampToGround property for GeoJSON CatalogItem.
All working for me for GeoJSON polygons.
So, from my perspective, this issue can be closed.
Brilliant job!

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

No branches or pull requests

7 participants