liveBook · Manning

Coordinate system

As explained in Digital Twins in Action

A coordinate system is a framework for specifying the position of points using numerical coordinates relative to defined axes or references.

A coordinate system gives positions a shared spatial reference. A sensor’s local coordinates can locate it within a home, but they do not by themselves place it on a map or in a real-world 3D scene. Aligning coordinate systems lets measurements, models, and imagery refer to the same physical locations. section 2.7 section 7.3.1 section 7.3.2

Choose the reference needed for the decision:

  • For a floor plan, position readings in the plan’s (x,y) coordinate system so users can see where a condition occurs. section 6.2.4
  • For a real-world 3D scene, georeference the model and transform locally recorded positions into global coordinates before overlaying readings. section 7.3.1 section 7.3.2
  • For datasets from different sources, use a shared spatial reference frame. GeoJSON and KML define geometry using global coordinates. section 7.3.1

Placing a home sensor reading

Record a sensor’s position relative to the home. On a floor plan, use its placement coordinates to put the reading beside its physical location. In a georeferenced 3D model, transform that local position into a global one before placing the reading in the scene. Correct positioning gives an abstract measurement physical context; attaching it to a particular building element may still require reconciling identifiers and metadata. section 6.2.4 section 7.3.2

Listing 7.4 Transforming local to global coordinates in JavaScript
<script>
  const matrix = (lon, lat, height, scaleFactor, rotationZDeg = 0) =>  #1
    Cesium.Matrix4.multiply(
      Cesium.Transforms.eastNorthUpToFixedFrame(Cesium.Cartesian3.
      fromDegrees(lon, lat, height)),
      Cesium.Matrix4.multiply(
        Cesium.Matrix4.fromScale(new Cesium.Cartesian3(scaleFactor,
        scaleFactor, scaleFactor)),
        Cesium.Matrix4.fromRotation(Cesium.Matrix3.fromRotationZ(
        rotationZDeg * Math.PI / 180)),
        new Cesium.Matrix4()
      ),
      new Cesium.Matrix4()
    );

  const localToGeographic = (localCartesian) => { #2
    const worldPoint = Cesium.Matrix4.multiplyByPoint(
      BASE_TRANSFORM_MATRIX,
      localCartesian,
      new Cesium.Cartesian3()
    );
    const { longitude, latitude, height } = Cesium.Cartographic.
    fromCartesian(worldPoint);

    return {
      longitude: Cesium.Math.toDegrees(longitude),
      latitude: Cesium.Math.toDegrees(latitude),
      height
    };
  };

  const BASE_TRANSFORM_MATRIX = matrix(
    115.868492,
    -31.961505,
    -39,
    1,
    -20
  );

</script>

The JavaScript listing shows a CesiumJS transform built from longitude, latitude, height, scale, and rotation, then applied to a local point before converting it to geographic coordinates. section 7.3.2

How Digital Twins in Action covers it

How deep it goes
Explains alignment through 2D placement and a worked local-to-global 3D transformation, without developing coordinate-system mathematics.
Examples
Uses floor-plan sensor overlays, drone imagery overlaid on a map, and home sensor positions transformed for a 3D scene.
What it assumes
Assumes sensor placement coordinates and a positioned model for the 3D exercise; introduces the local-to-global transformation in JavaScript.
What you can do after
Apply it via CesiumJS to transform local sensor positions and place readings on a georeferenced 3D model.
How it connects
Connects to georeferencing, digital twins, spatial visualization, GeoJSON, KML, and 3D models.

Also explained in

Compare how 4 books explain coordinate system →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Digital Twins in Action. The section links point to the parts of the book it draws on.