Interpretation of cesium coordinate system

There are many online about cesium coordinate system introduction, but in the actual development, not condemnation, himself born mapping also get confused. So wrote in developing an understanding of cesium coordinate system.

Beginner is most likely to come into contact with the event, and therefore event-entry to tell coordinate system

Pick ---- screen coordinates Cartesian ---- world coordinate cartographic ----- geographic coordinates (rad)
Point ---- latitude and longitude coordinates

Event callback coordinate system is a screen coordinate system

handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
handler.setInputAction(function(movement) {
  var cartesian = viewer.camera.pickEllipsoid(movement.endPosition, scene.globe.ellipsoid);
  if (cartesian) {
    var cartographic = Cesium.Cartographic.fromCartesian(cartesian);
    var longitudeString = Cesium.Math.toDegrees(cartographic.longitude).toFixed(2);
    var latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(2);
  console.log(longitudeString)

  } else {

  }
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

I.e., movement coordinates is the screen coordinate system;

Screen coordinates steering the world coordinate system --- namely 3857 projected coordinate system

var cartesian = viewer.camera.pickEllipsoid(pick, viewer.scene.globe.ellipsoid);

Can be found by the API, the first parameter is a coordinate of the screen coordinate system, the second parameter is ellipsoid, default is 84; return three-dimensional world coordinate system

World coordinate system - arc coordinate system projected coordinate system ---- geodetic coordinate system conversion (radians)

var cartographic = Cesium.Cartographic.fromCartesian(cartesian);

Radians coordinates into latitude and longitude coordinates

var latitudeString = Cesium.Math.toDegrees(cartographic.latitude).toFixed(2);

 

 

Published 243 original articles · won praise 36 · Views 140,000 +

Guess you like

Origin blog.csdn.net/A873054267/article/details/102739572