cesium-native  0.41.0
CesiumGeospatial Namespace Reference

Classes for geospatial computations in Cesium. More...

Classes

class  BoundingRegion
 A bounding volume specified as a longitude/latitude bounding box and a minimum and maximum height. More...
 
class  BoundingRegionBuilder
 
class  BoundingRegionWithLooseFittingHeights
 A BoundingRegion whose heights might be very inaccurate and so distances should be estimated conservatively for level-of-detail computations. More...
 
class  Cartographic
 A position defined by longitude, latitude, and height. More...
 
class  CartographicPolygon
 A 2D polygon expressed as a list of longitude/latitude coordinates in radians. More...
 
class  EarthGravitationalModel1996Grid
 Loads and queries heights from an Earth Gravitational Model 1996 (EGM96) grid. More...
 
class  Ellipsoid
 A quadratic surface defined in Cartesian coordinates. More...
 
class  EllipsoidTangentPlane
 A plane tangent to an Ellipsoid at a certain origin position. More...
 
class  GeographicProjection
 A map projection where longitude and latitude are mapped using an Ellipsoid. More...
 
class  GlobeAnchor
 Anchors an object to the globe by defining a transformation from the object's coordinate to the globe-fixed coordinate system (usually Earth-Centered, Earth-Fixed or ECEF). More...
 
class  GlobeRectangle
 A two-dimensional, rectangular region on a globe, specified using longitude and latitude coordinates. The region is rectangular in terms of longitude-latitude coordinates, but may be far from rectangular on the actual globe surface. More...
 
class  GlobeTransforms
 Transforms between globe-related coordinate systems. More...
 
class  LocalHorizontalCoordinateSystem
 A coordinate system created from a local horizontal plane at a particular origin point on the globe. More...
 
class  S2CellBoundingVolume
 
class  S2CellID
 A 64-bit unsigned integer that uniquely identifies a cell in the S2 cell decomposition. More...
 
class  SimplePlanarEllipsoidCurve
 Produces points on an ellipse that lies on a plane that intersects the center of the earth and each of the input coordinates. The height above the surface at each point along the curve will be a linear interpolation between the source and destination heights. More...
 
class  WebMercatorProjection
 The map projection used by Google Maps, Bing Maps, and most of ArcGIS Online, EPSG:3857. More...
 

Typedefs

typedef std::variant< GeographicProjection, WebMercatorProjectionProjection
 A projection. More...
 

Enumerations

enum class  LocalDirection {
  East , North , West , South ,
  Up , Down
}
 

Functions

double calcQuadtreeMaxGeometricError (const CesiumGeospatial::Ellipsoid &ellipsoid) noexcept
 Computes the maximum geometric error per radian of a quadtree with certain assumptions. More...
 
glm::dvec3 projectPosition (const Projection &projection, const Cartographic &position)
 Projects a position on the globe using the given Projection. More...
 
Cartographic unprojectPosition (const Projection &projection, const glm::dvec3 &position)
 Unprojects a position from the globe using the given Projection. More...
 
CesiumGeometry::Rectangle projectRectangleSimple (const Projection &projection, const GlobeRectangle &rectangle)
 Projects a rectangle on the globe by simply projecting its four corners. More...
 
GlobeRectangle unprojectRectangleSimple (const Projection &projection, const CesiumGeometry::Rectangle &rectangle)
 Unprojects a rectangle to the globe by simply unprojecting its four corners. More...
 
CesiumGeometry::AxisAlignedBox projectRegionSimple (const Projection &projection, const BoundingRegion &region)
 Projects a bounding region on the globe by simply projecting its eight corners. More...
 
BoundingRegion unprojectRegionSimple (const Projection &projection, const CesiumGeometry::AxisAlignedBox &box, const CesiumGeospatial::Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
 Unprojects a box to the globe by simply unprojecting its eight corners. More...
 
glm::dvec2 computeProjectedRectangleSize (const Projection &projection, const CesiumGeometry::Rectangle &rectangle, double maxHeight, const Ellipsoid &ellipsoid CESIUM_DEFAULT_ELLIPSOID)
 Computes the approximate real-world size, in meters, of a given projected rectangle. More...
 
const EllipsoidgetProjectionEllipsoid (const Projection &projection)
 Obtains the ellipsoid used by a Projection variant.
 

Detailed Description

Classes for geospatial computations in Cesium.

Typedef Documentation

◆ Projection

A projection.

This is a std::variant of different types of map projections that can convert between projected map coordinates and Cartographic coordinates.

See also
GeographicProjection
WebMercatorProjection

Definition at line 25 of file Projection.h.

Function Documentation

◆ calcQuadtreeMaxGeometricError()

double CesiumGeospatial::calcQuadtreeMaxGeometricError ( const CesiumGeospatial::Ellipsoid ellipsoid)
noexcept

Computes the maximum geometric error per radian of a quadtree with certain assumptions.

The geometric error for a tile can be computed by multiplying the value returned by this function by the width of the tile in radians.

This function computes a suitable geometric error for a 65x65 terrain heightmap where the vertical error is 25% of the horizontal spacing between height samples at the equator.

Parameters
ellipsoidThe ellipsoid.
Returns
The max geometric error.

◆ computeProjectedRectangleSize()

glm::dvec2 CesiumGeospatial::computeProjectedRectangleSize ( const Projection projection,
const CesiumGeometry::Rectangle rectangle,
double  maxHeight,
const Ellipsoid &ellipsoid  CESIUM_DEFAULT_ELLIPSOID 
)

Computes the approximate real-world size, in meters, of a given projected rectangle.

The returned X component corresponds to the size in the projected X direction, while the returned Y component corresponds to the size in the projected Y direction.

Parameters
projectionThe projection.
rectangleThe projected rectangle to measure.
maxHeightThe maximum height of the geometry inside the rectangle.
ellipsoidThe ellipsoid used to convert longitude and latitude to ellipsoid-centered coordinates.
Returns
The approximate size.

◆ projectPosition()

glm::dvec3 CesiumGeospatial::projectPosition ( const Projection projection,
const Cartographic position 
)

Projects a position on the globe using the given Projection.

Parameters
projectionThe projection.
positionThe Cartographic position.
Returns
The coordinates of the projected point, in the coordinate system of the given projection.

◆ projectRectangleSimple()

CesiumGeometry::Rectangle CesiumGeospatial::projectRectangleSimple ( const Projection projection,
const GlobeRectangle rectangle 
)

Projects a rectangle on the globe by simply projecting its four corners.

This is only accurate when the globe rectangle is still a rectangle after projecting, which is true for WebMercatorProjection but not necessarily true for other projections.

Parameters
projectionThe projection.
rectangleThe globe rectangle to be projected.
Returns
The projected rectangle.

◆ projectRegionSimple()

CesiumGeometry::AxisAlignedBox CesiumGeospatial::projectRegionSimple ( const Projection projection,
const BoundingRegion region 
)

Projects a bounding region on the globe by simply projecting its eight corners.

This is only accurate when the globe box is still a box after projecting, which is true for WebMercatorProjection but not necessarily true for other projections.

Parameters
projectionThe projection.
boundingRegionThe bounding region to be projected.
Returns
The projected box.

◆ unprojectPosition()

Cartographic CesiumGeospatial::unprojectPosition ( const Projection projection,
const glm::dvec3 &  position 
)

Unprojects a position from the globe using the given Projection.

Parameters
projectionThe projection.
positionThe coordinates of the point, in meters.
Returns
The Cartographic position.

◆ unprojectRectangleSimple()

GlobeRectangle CesiumGeospatial::unprojectRectangleSimple ( const Projection projection,
const CesiumGeometry::Rectangle rectangle 
)

Unprojects a rectangle to the globe by simply unprojecting its four corners.

This is only accurate when the rectangle is still a rectangle after unprojecting, which is true for WebMercatorProjection but not necessarily true for other projections.

Parameters
projectionThe projection.
rectangleThe rectangle to be unprojected.
Returns
The unprojected rectangle.

◆ unprojectRegionSimple()

BoundingRegion CesiumGeospatial::unprojectRegionSimple ( const Projection projection,
const CesiumGeometry::AxisAlignedBox box,
const CesiumGeospatial::Ellipsoid &ellipsoid  CESIUM_DEFAULT_ELLIPSOID 
)

Unprojects a box to the globe by simply unprojecting its eight corners.

This is only accurate when the box is still a box after unprojecting, which is true for WebMercatorProjection but not necessarily true for other projections.

Parameters
projectionThe projection.
boxThe box to be unprojected.
Returns
The unprojected bounding region.