cesium-native
0.41.0
|
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, WebMercatorProjection > | Projection |
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 ®ion) |
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 Ellipsoid & | getProjectionEllipsoid (const Projection &projection) |
Obtains the ellipsoid used by a Projection variant. | |
Classes for geospatial computations in Cesium.
typedef std::variant<GeographicProjection, WebMercatorProjection> CesiumGeospatial::Projection |
A projection.
This is a std::variant
of different types of map projections that can convert between projected map coordinates and Cartographic coordinates.
Definition at line 25 of file Projection.h.
|
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.
ellipsoid | The ellipsoid. |
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.
projection | The projection. |
rectangle | The projected rectangle to measure. |
maxHeight | The maximum height of the geometry inside the rectangle. |
ellipsoid | The ellipsoid used to convert longitude and latitude to ellipsoid-centered coordinates. |
glm::dvec3 CesiumGeospatial::projectPosition | ( | const Projection & | projection, |
const Cartographic & | position | ||
) |
Projects a position on the globe using the given Projection.
projection | The projection. |
position | The Cartographic position. |
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.
projection | The projection. |
rectangle | The globe rectangle to be projected. |
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.
projection | The projection. |
boundingRegion | The bounding region to be projected. |
Cartographic CesiumGeospatial::unprojectPosition | ( | const Projection & | projection, |
const glm::dvec3 & | position | ||
) |
Unprojects a position from the globe using the given Projection.
projection | The projection. |
position | The coordinates of the point, in meters. |
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.
projection | The projection. |
rectangle | The rectangle to be unprojected. |
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.
projection | The projection. |
box | The box to be unprojected. |