visgl / deck.gl

WebGL2 powered visualization framework
https://deck.gl
MIT License
11.89k stars 2.06k forks source link

ESRI DeckRenderer and ground elevation #4483

Open mogmog opened 4 years ago

mogmog commented 4 years ago

I have been experimenting with the ESRI DeckRenderer in /deck.gl/examples/get-started/pure-js/arcgis/

It works really nicely. One thing i have found is that when you set ESRI to use elevation data by setting the 'ground' parameter (https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html) , the deckgl layers float above the ESRI world in an incorrect way - see here.

image

ezgif com-video-to-gif

Pessimistress commented 4 years ago

@damix911 Is there a way to access ArcGIS's camera elevation in this case? We can use the position viewState to add an offset to deck's camera.

llwinner commented 4 years ago

@damix911 Is there a way to access ArcGIS's camera elevation in this case? We can use the position viewState to add an offset to deck's camera.

I encountered the same problem. I tried to modify viewState's zoom bearing pitch in code , but no change. And i read the code of deck-renderer.js, there have been modifications to the zoom bearing pitch property.

damix911 commented 4 years ago

I think it could be done by somehow getting a reference to the ground layer and creating an elevation sampler https://developers.arcgis.com/javascript/latest/api-reference/esri-Ground.html#createElevationSampler . I don't think it can be done by using the camera only. I'll try to do it and also get in touch with the 3D team.

DeckRenderer is still ~undocumented~ documented as experimental because we are actually working to solve some camera positioning issues. Even when there is no ground layer you may get a slighly misaligned overlay, so be careful and I would definitely not recommend it for production yet.

Thank you for your report and for trying this out!

I am out typing from my phone, I will give it a shot as soon as I get home.

damix911 commented 4 years ago

Here is a repro: https://codepen.io/dawken/pen/ZEQLjEp

Here is a sample on how to use the elevation sampler: https://codepen.io/dawken/pen/xxZgzyd?editors=1000 (click on the map to sample a value in meters that will appear in the upper right corner of the screen).

I am going to try to apply a correction computed with the sampler and see if the parallax effect goes away.

charunik commented 3 weeks ago

I'm experiencing the same issue. Has there been any progress on this? Any updates or workarounds would be greatly appreciated.