Skip to content

Coordinates & Math

Coordinate types and bounding volumes.

import cesiumkit

entity = cesiumkit.Entity(
    name="Point",
    position=cesiumkit.Cartesian3.from_degrees(-74.006, 40.7128, 100),
)

See Math for rotations, quaternions, and matrices.

Coordinates

coordinates

Coordinate and spatial types for cesiumkit.

Classes:

Name Description
Cartesian2

A 2D Cartesian point.

Cartesian3

A 3D Cartesian point in Earth-Centered, Earth-Fixed (ECEF) coordinates.

Cartesian3FromDegrees

A Cartesian3 created from degrees. Serializes to Cesium.Cartesian3.fromDegrees().

Cartesian3FromRadians

A Cartesian3 created from radians. Serializes to Cesium.Cartesian3.fromRadians().

Cartesian3DegreesArray

An array of Cartesian3 from a flat degrees list. Used for polyline positions, etc.

Cartesian3DegreesArrayHeights

An array of Cartesian3 from a flat [lon, lat, h, ...] list.

Cartographic

A position defined by longitude, latitude (in radians), and height (in meters).

CartographicFromDegrees

A Cartographic created from degrees.

BoundingSphere

A bounding sphere with a center and radius.

RectangleCoords

A cartographic rectangle defined by west, south, east, north bounds (in radians).

RectangleCoordsFromDegrees

A Rectangle created from degree bounds.

NearFarScalar

Scalar values at near and far camera distances.

DistanceDisplayCondition

Display condition based on camera distance.

Cartesian2

Bases: CesiumBase

A 2D Cartesian point.

Cartesian3

Bases: CesiumBase

A 3D Cartesian point in Earth-Centered, Earth-Fixed (ECEF) coordinates.

Methods:

Name Description
from_degrees

Create a Cartesian3 from longitude/latitude in degrees.

from_radians

Create a Cartesian3 from longitude/latitude in radians.

from_degrees_array

Create an array of Cartesian3 from a flat list [lon, lat, lon, lat, ...].

from_degrees_array_heights

Create an array from [lon, lat, h, lon, lat, h, ...].

from_shapely

Create a Cartesian3 from a shapely Point (WGS84 lon/lat).

from_degrees classmethod

from_degrees(
    longitude: float, latitude: float, height: float = 0.0
) -> Cartesian3FromDegrees

Create a Cartesian3 from longitude/latitude in degrees.

from_radians classmethod

from_radians(
    longitude: float, latitude: float, height: float = 0.0
) -> Cartesian3FromRadians

Create a Cartesian3 from longitude/latitude in radians.

from_degrees_array classmethod

from_degrees_array(coordinates: list[float]) -> Cartesian3DegreesArray

Create an array of Cartesian3 from a flat list [lon, lat, lon, lat, ...].

from_degrees_array_heights classmethod

from_degrees_array_heights(
    coordinates: list[float],
) -> Cartesian3DegreesArrayHeights

Create an array from [lon, lat, h, lon, lat, h, ...].

from_shapely classmethod

from_shapely(geom: object) -> Cartesian3FromDegrees

Create a Cartesian3 from a shapely Point (WGS84 lon/lat).

Requires the geometry to be a Point; raises ValueError otherwise. Uses the Point's z coordinate as height if present, else 0.

Cartesian3FromDegrees

Bases: Cartesian3

A Cartesian3 created from degrees. Serializes to Cesium.Cartesian3.fromDegrees().

Cartesian3FromRadians

Bases: Cartesian3

A Cartesian3 created from radians. Serializes to Cesium.Cartesian3.fromRadians().

Cartesian3DegreesArray

Bases: CesiumBase

An array of Cartesian3 from a flat degrees list. Used for polyline positions, etc.

Cartesian3DegreesArrayHeights

Bases: CesiumBase

An array of Cartesian3 from a flat [lon, lat, h, ...] list.

Cartographic

Bases: CesiumBase

A position defined by longitude, latitude (in radians), and height (in meters).

Methods:

Name Description
from_degrees

Create a Cartographic from degrees.

from_degrees classmethod

from_degrees(
    longitude: float, latitude: float, height: float = 0.0
) -> CartographicFromDegrees

Create a Cartographic from degrees.

CartographicFromDegrees

Bases: Cartographic

A Cartographic created from degrees.

BoundingSphere

Bases: CesiumBase

A bounding sphere with a center and radius.

RectangleCoords

Bases: CesiumBase

A cartographic rectangle defined by west, south, east, north bounds (in radians).

Methods:

Name Description
from_degrees

Create a Rectangle from bounds in degrees.

from_degrees classmethod

from_degrees(
    west: float, south: float, east: float, north: float
) -> RectangleCoordsFromDegrees

Create a Rectangle from bounds in degrees.

RectangleCoordsFromDegrees

Bases: RectangleCoords

A Rectangle created from degree bounds.

NearFarScalar

Bases: CesiumBase

Scalar values at near and far camera distances.

DistanceDisplayCondition

Bases: CesiumBase

Display condition based on camera distance.