CesiumION

182 阅读2分钟

CesiumIon --笔记

一、创建账号

  • 注册账号

    • 拥有全球卫星影像和真实3D场景内容

      • Cesium World Terrain — high resolution terrain with up to 1 meter accuracy.

      • Cesium OSM Buildings — over 350 million buildings derived from OpenStreetMap data.

      • Bing Maps Aerial Imagery — global satellite imagery with up to 15 cm resolution.

    • 默认token值

      • eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhYjIyNDk5Ni1hNmFlLTQyNzctOGMwOS1hYWU4NmEyMjcxZTEiLCJpZCI6NDM0MjEsImlhdCI6MTYxNTcyNDg5NH0.fyGAT3jkTTGTMKbvXAllYNUvXbU9qwcTMkhLEXcD9Rc
        

二、创建CesiumJS客户端

  • CDN

    • <!DOCTYPE html>
      <html lang="en">
      <head>
        <meta charset="utf-8">
        <!-- Include the CesiumJS JavaScript and CSS files -->
        <script src="https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Cesium.js"></script>
        <link href="https://cesium.com/downloads/cesiumjs/releases/1.91/Build/Cesium/Widgets/widgets.css" rel="stylesheet">
      </head>
      <body>
        <div id="cesiumContainer"></div>
        <script>
          // Your access token can be found at: https://cesium.com/ion/tokens.
          // This is the default access token from your ion account
      
          Cesium.Ion.defaultAccessToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJhYjIyNDk5Ni1hNmFlLTQyNzctOGMwOS1hYWU4NmEyMjcxZTEiLCJpZCI6NDM0MjEsImlhdCI6MTYxNTcyNDg5NH0.fyGAT3jkTTGTMKbvXAllYNUvXbU9qwcTMkhLEXcD9Rc';
      
          // Initialize the Cesium Viewer in the HTML element with the `cesiumContainer` ID.
          const viewer = new Cesium.Viewer('cesiumContainer', {
            terrainProvider: Cesium.createWorldTerrain()
          });    
          // Add Cesium OSM Buildings, a global 3D buildings layer.
          const buildingTileset = viewer.scene.primitives.add(Cesium.createOsmBuildings());   
          // Fly the camera to San Francisco at the given longitude, latitude, and height.
          viewer.camera.flyTo({
            destination : Cesium.Cartesian3.fromDegrees(-122.4175, 37.655, 400),
            orientation : {
              heading : Cesium.Math.toRadians(0.0),
              pitch : Cesium.Math.toRadians(-15.0),
            }
          });
        </script>
       </div>
      </body>
      </html>
      
  • NPM

image-20220307104901431.png

三、Cesium global 3D content

  • Ceisum ion 是一个Cesium的在线服务器
  • image-20220307110037150-1647842742291.png

四、Cesium Stories introduction

可以利用Cesium Stories来创建一个互动的3D演示,类似在线版的PPT

create a new story

创建一个Cesium 故事

add data to slide

添加数据到幻灯片中,可随时添加各种数据,如GeoJSON、KML、CZML等格式

capture view

捕获想要的视野,然后可以新建map 或者 新建slide

add infobox content

添加信息内容,如标题和具体信息

explore sellf dataset

image-20220312135804490.png

share self story

#教程地址,可以在Stories viewer 进行查看了,可以公网发布(可选)
https://cesium.com/learn/ion/stories-introduction/

五、Cesium ion integratioin

哪些软件内置了Cesium的的插件(类似这个概念)

  • 3DS MAX
  • Blender
  • FME
  • STK
  • WebODM

从哪些软件中可以导出数据到Cesium ion

  • Bentley Context Capture
  • RealityCapture
  • Simactive Correlator3D
  • Agisoft Metashape
  • SketchUp

哪些软件可以使用Cesium ion

  • CesiumJS
  • Cesium for Unreal
  • deck.gl
  • iModel.js
  • osgEarth

六、integrate with Ceisum ion

  • Rest 风格的api来帮助管理Cesium ion平台

Upload your 3D data with REST

curl "api.cesium.com/v1/assets" -H "Authorization: Bearer <your_access_token>"

curl https://api.cesium.com/v1/assets -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiI5NjNjMjRiMS0wYTM3LTRjMzItYmI0My00MjA0YTVhOGNlYzIiLCJpZCI6NDM0MjEsImlhdCI6MTY0NzMxMzY4OH0.IpUyaBmm1r2TNgeIRs9De62O_Old60ZaHAOhsc3xDsk"

curl -h //可以查看对应的参数一般有什么

  • curl baidu.com
    • 会返回当前百度的首页代码
  • curl baidu.com -s
    • -s 意思是省略请求时间的显示
  • curl baidu.com -???
    • -H 设置请求头
    • -d 设置请求体
    • -X 设置请求方法

七、Manage your account

Public Scopes

ScopeDescription
assets:readRead metadata and access the tiled data for individual assets in your account.
geocodePerform geocodes (for example, CesiumJS uses the ion geocode service by default for the search widget.)

Private Scopes

ScopeDescription
assets:listList the metadata for all assets available to your account.
assets:writeCreate, modify, and delete assets in your account.
profile:readRead your username, email address, avatar, and storage quota.
tokens:readRead token metadata and list all tokens for your account.
tokens:writeCreate, modify, and delete tokens for your account.

管理账户

  • 秘钥
  • 秘钥的相关配置(公共的和私有的可读可写、域名 与 端口等)
  • 天地图的请求次数
  • 压缩格式(每个人的ion asset 存储有限,5G)