deck.gl icon indicating copy to clipboard operation
deck.gl copied to clipboard

Support ArcGIS globe

Open zakjan opened this issue 4 years ago • 7 comments

Background

ArcGIS supports rendering a globe with SceneView.viewingMode = global. This PR tries to add support for ArcGIS globe to @deck.gl/arcgis.

viewState computation is not correct yet. I welcome any advise about how to compute deck viewState from ArcGIS camera.

Change List

  • compute viewState depending on view.viewingMode in @deck.gl/arcgis/deck-renderer
  • add new example arcgis-globe

zakjan avatar Jul 01 '21 08:07 zakjan

Coverage Status

Coverage decreased (-0.09%) to 82.312% when pulling a0bf1f2f228a18c434848d8a114e145e41e805dc on zakjan:arcgis-globe into 2398eda6e20556e788070a587fead8ce2fdab9ba on visgl:master.

coveralls avatar Jul 01 '21 08:07 coveralls

Can you give more details on how the view state is incorrect? I'm doing some work on syncing the Google Maps view state and will be writing up a doc on this soon. Perhaps it'll be useful for your case also

felixpalmer avatar Jul 01 '21 10:07 felixpalmer

It's incorrect on my side, I haven't figured out yet the correct computation from ArcGIS globe camera to deck globe viewState. ArcGIS globe camera x/y/z is in meters. See the four TODOs at https://github.com/zakjan/deck.gl/blob/e423ea56836eaa80ee048d49f42f04f5ac418c53/modules/arcgis/src/deck-renderer.js#L44-L56

There is a new example arcgis-globe, where it can be tested.

zakjan avatar Jul 01 '21 10:07 zakjan

Current state: deck.gl globe overlay matches roughly with ArcGIS globe. ArcGIS globe features disabled in demo: tilt, rotation, sun.

It's still incorrect though, I haven't found out the correct calculations yet. The main challenge is computing deck.gl altitude and zoom from ArcGIS altitude in meters. I'm not sure why deck.gl requires separate altitude and zoom.

Also, for a precise match there might be an issue that Earth radiuses are different, not configurable. deck.gl uses 6370972, ArcGIS uses 6378137.

Screen Shot 2021-07-06 at 13 09 13 Screen Shot 2021-07-06 at 13 09 36 Screen Shot 2021-07-06 at 13 08 55

zakjan avatar Jul 06 '21 11:07 zakjan

Altitude is used both for the projection (think of it as another way to specify FOV) and the view matrix. A similar approach is taken by Mapbox, but this isn't always what other libraries do. For background, you might want to take a look at:

https://github.com/visgl/deck.gl/blob/felix/google-vector/docs/developer-guide/base-map-viewport-alignment.md

https://github.com/visgl/deck.gl/pull/5930

felixpalmer avatar Jul 06 '21 12:07 felixpalmer

Thanks for the fresh new guide, I'll go through it! Because ArcGIS altitude is in meters, it seems that it serves both purposes, defining FOV and map zoom level.

zakjan avatar Jul 06 '21 13:07 zakjan

HI, is there any progress on this issue

GemT27 avatar Oct 26 '23 07:10 GemT27