cartographic boundary of current field of view (to support geo-spatial query limits)

My goal is to define the cartographic limits for a geospatial query – something that many here have probably done already. When the horizon is not in view, a center-radius query may work, although returns outside of the inscribed screen field of view must be discarded. A bounding “rectangular” query has potential north-up issues. A polygon with more sampled screen edge points may be the best answer. But what is puzzling me right now is the best approach when the horizon is visible – ranging from the “home” camera position to any zoom that still retains some amount of visible horizon.

Do any examples demonstrate the best way to find the cartographic boundary points, including horizons? (while still permitting the user to tip the camera from orthographic to perspective)

Thanks for any example pointers.


Cesium doesn’t have officials support for streaming vector data, but there’s a low-level, undocumented private interface called the QuadTreePrimitive you can use to do what you want. Search this forum and you should find some recent posts that go into details on the subject. It’s undocumented because when we have real streaming vectors it will most likely use a different approach.

you can get the size of the cesium container using viewer.container

then i would use

var cartesian =, ellipsoid);

  • or if using terrain

var ray =,

cartesian = scene.globe.pick(ray, scene);

to get the coordinates from the middle of the screen and the lower corners, if any of the three is null your view is up in the air or rolled over

if all three are valid use the three points to calculate a bounding box

Thanks for your suggestions; my effective solution was very similar to what Berwyn described. I use two complementary queries; the choice between them depends upon whether or not any “sky” is in the view. That is, if the cartographic conversion of the upper left hand point is null.

While any sky is visible, such as in the “home” position, I use a point-radius query method. I continue to use this while zooming in until the corners of the screen have cartographic coordinates. Then I switch to a polygon query method, sampling 16 points around the screen edges. (Using rectangular bounds in 3D leads to a noticeable mismatch of visible area to queried area.) If the user “rolls over” the view into a perspective view, the visible sky will trigger the center-radius query. (I was pleased to discover that the cartographic center of the screen remains constant as the earth “rolls over”.)