Per the newsgroups and my research, there is not currently a polar projection, but since I already have the code written for OpenLayers I have ported that over to CesiumJS.
Unfortunately it is not behaving as expected. The image renders as a curved swath, instead of filling the bounds of the rectangle.
What I have done is created a MapProjection which implements the conversions I need to go to/from either north or south polar stereographic projection. I have then created a TilingScheme which extends the WebMercatorTilingScheme, but sets the projection to be the polar projection I am interested in. In the constructor of my TilingScheme, I do this:
// the base class used the web mercator projection to figure out the rectangle. Redo that work.
this._projection = options.projection;
let southwest = this._projection.unproject(options.rectangleSouthwestInMeters);
let northeast = this._projection.unproject(options.rectangleNortheastInMeters);
this._rectangle = new Cesium.Rectangle(southwest.longitude, southwest.latitude,
northeast.longitude, northeast.latitude);
console.log('projection rectangle in radians');
console.log(this._rectangle);
I have a hunch that the problem lies in determining what is a 'hit' in the imagery provider, that is when going from geodetic coordinates to the native rectangle it is not correct. I can correctly render a bounding rectangle defined in lat/long coordinates via kml.
Any nudges in the right direction will be greatly appreciated. Once I get this working I can also contribute it back to Cesium codebase.
thanks
Tamar
OSX, Chrome, Cesium 1.40.0
--
You received this message because you are subscribed to a topic in the Google Groups "cesium-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cesium-dev/e_osjMgHD4E/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cesium-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I'm still working this issue and I'm coming back to the geometry of the globe. Here is what I think, and why:
The documentation in here:
https://cesiumjs.org/Cesium/Build/Documentation/UrlTemplateImageryProvider.html
includes tiling scheme, specifying how the ellipsoidal surface is broken into tiles.
Therefore I have created my own EllipsoidTerrainProvider using my polar stereographic tiling scheme:
viewerOptions['terrainProvider'] = new Cesium.EllipsoidTerrainProvider({tilingScheme: tilingScheme});
When I run the code with this tiling scheme, I see a gray-colored globe missing the ends.
I'm also getting the following stack trace:
CesiumWidget.js?5b05:657 An error occurred while rendering. Rendering has stopped.
undefined
DeveloperError: Rectangle height must be between 0 and pi
Error
at new DeveloperError (webpack-internal:///1:43:19)
at Function.OrientedBoundingBox.fromRectangle (webpack-internal:///107:279:19)
at new TileBoundingRegion (webpack-internal:///206:126:57)
at createTileBoundingRegion (webpack-internal:///755:247:16)
at Function.GlobeSurfaceTile.processStateMachine (webpack-internal:///755:267:46)
at GlobeSurfaceTileProvider.loadTile (webpack-internal:///754:473:26)
at processSinglePriorityLoadQueue (webpack-internal:///763:743:26)
at processTileLoadQueue (webpack-internal:///763:734:9)
at QuadtreePrimitive.endFrame (webpack-internal:///763:324:9)
at Globe.endFrame (webpack-internal:///749:612:27)
I'm thinking that I might have to build a hybrid tiling scheme to handle the northern hemisphere in north pole projection and the southern hemisphere in south pole projection since we are building the entire globe. Are there any other suggestions as to what might be causing this error? Is there something else I should be doing in my Ellipsoid Terrain Provider? I get no indication that my map projection code is even being called.
Thanks
Tamar