Cesium projected space

Hello,

Our team at Oslandia is currently working on a 3D city viewer and we are
interested in using the Cesium framework to benefit from all its features.

However, there is an issue that is still holding us back. Cesium expects
all its data to be given in lat/long coordinates. While there are
built-in functions to project to Cesium's geocentric system,
we do not want to pay the projection overhead on each feature point,
as we expect to have a lot of 3D data.

One option to solve this problem would be to work directly in a cartesian
(projected) space. Hence, we are considering enhancing Cesium to allow the
use of any planar referential as the native coordinate system of Cesium.

This way, we can stay in the original referential of our data and avoid any
time-consuming reprojection. Avoiding an unnecessary reprojection would also
ensure that the data precision is kept and the visualization is exactly the
raw data. This could be useful for data at (very) small-scale.

The use of a flag similar to 3DSceneOnly would prevent any unnecessary projections.

We started a first Proof of Concept implementation and are making good progress
towards our objectives.

It locks the user in a 2.5D Colombus view and uses the referential of the data
that is received. The majority of the modifications consists in providing an
alternative way of processing the data (on a plane instead of an ellipsoid). The
quadtree's tile provider has been modified as to tile a planar area. The height
maps are also handled differently to create suitable meshes.

Main parts of the Cesium framework which have been modified to support this :
* HeightMapTerrainData.js
* HeightMapTesselator.js
* GlobeTilingScheme.js
* Rectangle.js
* Terrain providers
* Scene.js
* GlobeSurfaceTile.js
* GlobeSurfaceTileProvider.js
* CesiumWidget.js

The current draft code is available here :
* https://github.com/Jeremy-Gaillard/cesium

Now we would like the advice of the community on this matter :
- Do you think there is an easier/alternate way to achieve the same goal ?
- Is there an interest in supporting this feature for the Cesium Framework ?
- Are there other parties interested in joining the effort to achieve this task ?

Since this is a deep modification, we would like to get it right from the start,
and only pursue the efforts if there is a common interest. We do think this feature
would allow Cesium to be adapted to more use cases, especially for specific and local usage.

Regards

Hi Jeremy,

Nice to meet you. We worked a bit with your colleague, Vincent, at the OSGeo code sprint.

Cesium expects all its data to be given in lat/long coordinates.

This is not exactly true. The renderer generally works with WGS84 Cartesian coordinates.

Do you think there is an easier/alternate way to achieve the same goal ?

Yes, convert from the local space to WGS84 translated with RTC as described here: AGI: AGI News

This is how Cesium renders terrain. This supports very high precision and keeps the client lightweight.

Is there an interest in supporting this feature for the Cesium Framework ?

It sounds like a lot of complexity and special case handling for something that can be done offline. Kevin wrote most of the code you mentioned. If he has time to look at your changes, perhaps he can chime in.

Patrick

I agree with Patrick. I would think it would be easier to add something in your process to convert your buildings to either WGS84, or leave them all in their local coordinates, but insert them at the 0,0 coordinate of the local coordinate system (you may have to adjust the 0,0 coordinate location to adjust for some distortion with a basic x/y translation).