国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

關(guān)于cesium根據(jù)地形畫區(qū)域面積并覆蓋在3d表面上

這篇具有很好參考價值的文章主要介紹了關(guān)于cesium根據(jù)地形畫區(qū)域面積并覆蓋在3d表面上。希望對大家有所幫助。如果存在錯誤或未考慮完全的地方,請大家不吝賜教,您也可以點擊"舉報違法"按鈕提交疑問。

最近一直在研究在3d地圖上添加區(qū)域還有車輛路徑路線,很是禿然?。≡诓粩嗟陌俣劝俣仍侔俣?,終于有了一套解決辦法,先演示一下操作過程,

drawLine()方法

cesium 地形遮擋,cesium,vue學(xué)習(xí),3d,vue.js,javascript

?drawPlane()方法

cesium 地形遮擋,cesium,vue學(xué)習(xí),3d,vue.js,javascript

下面就來堆代碼吧。

一、viewer.scene.pickPosition與viewer.camera.pickEllipsoid的區(qū)別

前提是開啟了地形檢測viewer.scene.globe.depthTestAgainstTerrain = true;一般開啟會占用一定內(nèi)存,但是獲取笛卡爾坐標(biāo)更精確了,否則用viewer.camera.pickEllipsoid的話,可能畫線的鼠標(biāo)位置跟線的實際位置差距很大

二、獲取鼠標(biāo)點擊位置的笛卡爾坐標(biāo)

在畫區(qū)域面積的時候坐標(biāo)是必備的,通常獲取坐標(biāo)的方法有兩中viewer.scene.pickPosition()與viewer.camera.pickEllipsoid(),這就不得不說說兩者的區(qū)別了

開啟了地形檢測的話viewer.scene.pickPosition()獲取坐標(biāo)要比viewer.camera.pickEllipsoid()更精確,(viewer.scene.globe.depthTestAgainstTerrain = true),直接用viewer.camera.pickEllipsoid的話,可能畫線的鼠標(biāo)位置跟線的實際位置差距很大,這里推薦使用開啟地形檢測的pickPosition()方法

//首先建立ScreenSpaceEventHandler對象獲取鼠標(biāo)左擊事件
this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
this.handler.setInputAction((movement) => {
      let cartesian = this.viewer.scene.pickPosition(movement.position);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);
      let hei = Cesium.Math.toDegrees(cartographic.height);
 }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

以上是獲取鼠標(biāo)左擊的迪卡爾坐標(biāo)并且轉(zhuǎn)換成經(jīng)緯度坐標(biāo)

三、根據(jù)多點坐標(biāo)畫點或面

兩點一線,三點/多點一面,要畫線/面必須要2個或多個坐標(biāo)才能繪畫,光有一個坐標(biāo)是不夠的,所以我們要先命名一個變量let positions = [],來記錄點擊點的坐標(biāo),然后根據(jù)后面的轉(zhuǎn)換變?yōu)楫嬀€和面積的坐標(biāo),同時需要命名一個變量來存儲層次結(jié)構(gòu)的對象? polygon = new Cesium.PolygonHierarchy(),還需要一個codeInfo來記錄移動點的所有數(shù)據(jù)

1.下面就可以通過綁定鼠標(biāo)事件來獲取初始位置

this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    // left
    this.handler.setInputAction((movement) => {
      let cartesian = this.viewer.scene.pickPosition(movement.position);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);
      let hei = Cesium.Math.toDegrees(cartographic.height);

      // console.log("><><><><><>", cartographic);
      if (cartesian && cartesian.x) {
        if (positions.length == 0) {
          positions.push(cartesian.clone());
        }
        codeInfo.push([lng, lat, hei]);
        positions.push(cartesian.clone());

        polygon.positions.push(cartesian.clone());
      }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

2.綁定鼠標(biāo)移動來獲取移動位置

this.handler.setInputAction((movement) => {
      let cartesian = this.viewer.scene.pickPosition(movement.endPosition);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);
      let hei = Cesium.Math.toDegrees(cartographic.height);

      if (positions.length >= 0) {
        if (cartesian && cartesian.x) {
          positions.pop();
          positions.push(cartesian);
          polygon.positions.pop();
          polygon.positions.push(cartesian);
          codeInfo.pop();
          codeInfo.push([lng, lat, hei]);
        }
      }
    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

3.綁定鼠標(biāo)右鍵來獲取終點位置

 this.handler.setInputAction(() => {
      this.infoDetail.planeSelf.push({ id: id, positions: codeInfo, polygon });
      console.log("planeSelf", this.infoDetail.planeSelf);
      this.handler.destroy();
      positions.push(positions[0]);
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);

這樣的話就獲取了所有點坐標(biāo)的信息,接下來就畫線/面了。

4.繪畫

我們通過添加實體的方法來繪制線/面

 polyObj = this.viewer.entities.add({
            id: id,
            name: "planeSelf",
            polyline: {
              positions: new Cesium.CallbackProperty(function () {
                return positions;
              }, false),
              width: this.config.borderWidth,
              material: this.config.borderColor,
              clampToGround: true,
            },
            polygon: {
              hierarchy: new Cesium.CallbackProperty(function () {
                return polygon;
              }, false),
              material: this.config.material,
              clampToGround: true,
            },
          });
        }

這樣我們就可以根據(jù)我們的鼠標(biāo)來繪制我們的線/面了

四、根據(jù)記錄的點實現(xiàn)線/面的繪制

我們根據(jù)codeInfo記錄的數(shù)據(jù)獲取了線/面的點坐標(biāo)數(shù)據(jù),只需在繪制方法中為其添加坐標(biāo)參數(shù),即可實現(xiàn)線/面的繪制

  addLine(id, name, positions) {
    this.viewer.entities.add({
      name: name,
      id: id,
      polyline: {
        positions: new Cesium.CallbackProperty(function () {
          return positions;
        }, false),
        width: this.config.borderWidth,
        material: this.config.borderColor,
        clampToGround: true,
      },
    });
  }

五、完整繪制線/面的類方法

import * as Cesium from "cesium";

// add...方法的position數(shù)據(jù)從this.infoDetail中獲取

export class Draw {
  constructor(viewer, config) {
    /**cesium實例對象 */
    this.viewer = viewer;
    /**繪制要素的相關(guān)配置
       * 默認(rèn)配置
       * {
          borderColor: Cesium.Color.BLUE,  邊框顏色
          borderWidth: 2, 邊框?qū)挾?          material: Cesium.Color.GREEN.withAlpha(0.5),填充材質(zhì)
      }
      */
    this.config = config || {
      borderColor: Cesium.Color.BLUE,
      borderWidth: 2,
      material: Cesium.Color.GREEN.withAlpha(0.5),
    };
    /**存貯繪制的數(shù)據(jù) 坐標(biāo) */
    this.infoDetail = {
      point: [],
      line: [],
      rectangle: [],
      circle: [],
      planeSelf: [],
    };
    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
  }

  /*******
   * @param:  id 必須是唯一的 name、position是三點的笛卡爾坐標(biāo)[lng,lat,hei]
   * @function: function
   * @return {*}
   * @description: 繪制方法
   */
  addPoint(id, name, position) {
    this.viewer.entities.add({
      position: Cesium.Cartesian3.fromDegrees(...position),
      name: name,
      id: id,
      point: {
        color: this.config.material,
        pixelSize: 12,
        outlineColor: this.config.borderColor,
        outlineWidth: this.config.borderWidth,
      },
    });
  }
  /*******
   * @param:  id 必須是唯一的 name、positions
   * @function: function
   * @return {*}
   * @description: 繪制方法
   */
  addLine(id, name, positions) {
    this.viewer.entities.add({
      name: name,
      id: id,
      polyline: {
        positions: new Cesium.CallbackProperty(function() {
          return positions;
        }, false),
        width: this.config.borderWidth,
        material: this.config.borderColor,
        clampToGround: true,
      },
    });
  }
  /*******
   * @param:  id 必須是唯一的 name、positions
   * @function: function
   * @return {*}
   * @description: 添加平面方法
   */
  addPlane(id, name, positions) {
    let polygon = new Cesium.PolygonHierarchy();
    polygon.positions = positions;
    this.viewer.entities.add({
      id: id,
      name: name,
      polyline: {
        positions: new Cesium.CallbackProperty(function() {
          return positions;
        }, false),
        width: this.config.borderWidth,
        material: this.config.borderColor,
        clampToGround: true,
      },
      polygon: {
        hierarchy: new Cesium.CallbackProperty(function() {
          return polygon;
        }, false),
        material: this.config.material,
        clampToGround: true,
      },
    });
  }
  drawPoint() {
    this.handler.destroy();

    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    this.handler.setInputAction((click) => {
      let position = this.getMovement(click).position;
      /**實體的唯一標(biāo)注 */
      let id = new Date().getTime();

      this.addPoint(id, "point", position);

      this.infoDetail.point.push({ id, position });
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

    this.handler.setInputAction((click) => {
      this.handler.destroy();
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  }

  /*******
   * @function: function
   * @description: 繪制矩形區(qū)域
   * @return {*}
   * @author: xk
   */
  drawRectangle() {
    this.handler.destroy();
    /**
     * 矩形四點坐標(biāo)
     */
    let westSouthEastNorth = [];
    /**實體的唯一標(biāo)注 */
    let id = null;
    /**地圖點擊對象 */
    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    this.handler.setInputAction((click) => {
      /**點擊位置笛卡爾坐標(biāo) */
      let cartesian = this.viewer.scene.pickPosition(click.position);
      /**笛卡爾轉(zhuǎn)弧度坐標(biāo) */
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian, false);
      /**點擊位置經(jīng)度 */
      let lng1 = Cesium.Math.toDegrees(cartographic.longitude);
      /**點擊位置維度 */
      let lat1 = Cesium.Math.toDegrees(cartographic.latitude);
      /**邊框坐標(biāo) */
      westSouthEastNorth = [lng1, lat1];
      id = new Date().getTime();
      if (westSouthEastNorth) {
        this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
      }
      /**面實例對象 */
      let polygons = this.viewer.entities.add({
        name: "rectangle",
        id: id,
        polygon: {
          hierarchy: new Cesium.CallbackProperty(function() {
            return {
              positions: Cesium.Cartesian3.fromDegreesArray(westSouthEastNorth),
            };
          }),
          height: 0,
          // 填充的顏色,withAlpha透明度
          material: this.config.material,
          // 是否被提供的材質(zhì)填充
          fill: true,
          // 是否顯示
          show: true,
        },
        polyline: {
          positions: new Cesium.CallbackProperty(function() {
            return Cesium.Cartesian3.fromDegreesArray(westSouthEastNorth);
          }),
          material: this.config.borderColor,
          width: this.config.borderWidth,
          zIndex: 1,
        },
      });
      this.handler.setInputAction((move) => {
        let cartesian = this.viewer.scene.pickPosition(move.endPosition);
        let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
        let lng = Cesium.Math.toDegrees(cartographic.longitude);
        let lat = Cesium.Math.toDegrees(cartographic.latitude);

        westSouthEastNorth = [
          lng1,
          lat1,
          lng1,
          lat,
          lng,
          lat,
          lng,
          lat1,
          lng1,
          lat1,
        ];
      }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

    this.handler.setInputAction(() => {
      this.handler.destroy();
      this.infoDetail.rectangle.push({ id: id, position: westSouthEastNorth });
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  }
  /*******
   * @function: function
   * @description: 繪制圓形區(qū)域
   * @return {*}
   * @author: xk
   */
  drawCircle() {
    this.handler.destroy();
    /**實體的唯一標(biāo)注 */
    let id = null;

    /**圓半徑 */
    let radius = 0;
    /**圓心 */
    let lngLat = [];
    /**鼠標(biāo)事件 */
    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    this.handler.setInputAction((click) => {
      id = new Date().getTime();
      let cartesian = this.viewer.scene.pickPosition(click.position);

      // console.log(">>>", click.position);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);

      // console.log(">>>>>>>>>", cartographic);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);
      let hei = Cesium.Math.toDegrees(cartographic.height);
      lngLat = [lng, lat, hei];
      let entity = this.viewer.entities.add({
        position: new Cesium.CallbackProperty(function() {
          return new Cesium.Cartesian3.fromDegrees(...lngLat);
        }, false),
        name: "circle",
        id: id,
        ellipse: {
          height: hei / 57.3,
          outline: true,
          material: this.config.material,
          outlineColor: this.config.borderColor,
          outlineWidth: this.config.borderWidth,
        },
        // label: {
        //   text: "區(qū)域一",
        //   font: "18px sans-serif",
        //   fillColor: Cesium.Color.GOLD,
        //   style: Cesium.LabelStyle.FILL_AND_OUTLINE,
        //   outlineWidth: 2,
        //   verticalOrigin: Cesium.VerticalOrigin.BOTTOM,
        //   pixelOffset: new Cesium.Cartesian2(0, 0),
        //   // 對齊方式(水平和豎直)
        //   horizontalOrigin: Cesium.HorizontalOrigin.LEFT,

        //   showBackground: true,
        //   backgroundColor: new Cesium.Color.fromBytes(0, 0, 0),
        //   show: true,
        // },
      });
      entity.ellipse.semiMajorAxis = new Cesium.CallbackProperty(function() {
        return radius;
      }, false);
      entity.ellipse.semiMinorAxis = new Cesium.CallbackProperty(function() {
        return radius;
      }, false);

      if (lngLat) {
        this.handler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_CLICK);
      }
      this.handler.setInputAction((move) => {
        let cartesian2 = this.viewer.scene.pickPosition(move.endPosition);
        radius = Cesium.Cartesian3.distance(cartesian, cartesian2);
      }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);

    this.handler.setInputAction(() => {
      this.infoDetail.circle.push({ id: id, center: lngLat, radius: radius });
      this.handler.destroy();
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  }
  /*******
   * @function: function
   * @description: 自定義區(qū)域繪制
   * @return {*}
   * @author: xk
   */
  drawPlane() {
    this.handler.destroy();
    /**實體的唯一標(biāo)注 */
    let id = new Date().getTime();
    /**記錄拐點坐標(biāo) */
    let positions = [],
      /**記錄返回結(jié)果 */
      codeInfo = [],
      /**面的hierarchy屬性 */
      polygon = new Cesium.PolygonHierarchy(),
      /**面對象配置 */
      polyObj = null;
    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    // left
    this.handler.setInputAction((movement) => {
      let cartesian = this.viewer.scene.pickPosition(movement.position);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);
      let hei = Cesium.Math.toDegrees(cartographic.height);

      // console.log("><><><><><>", cartographic);
      if (cartesian && cartesian.x) {
        if (positions.length == 0) {
          positions.push(cartesian.clone());
        }
        codeInfo.push([lng, lat, hei]);
        positions.push(cartesian.clone());

        polygon.positions.push(cartesian.clone());

        if (!polyObj) {
          polyObj = this.viewer.entities.add({
            id: id,
            name: "planeSelf",
            polyline: {
              positions: new Cesium.CallbackProperty(function() {
                return positions;
              }, false),
              width: this.config.borderWidth,
              material: this.config.borderColor,
              clampToGround: true,
            },
            polygon: {
              hierarchy: new Cesium.CallbackProperty(function() {
                return polygon;
              }, false),
              material: this.config.material,
              clampToGround: true,
            },
          });
        }
      }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
    // mouse
    this.handler.setInputAction((movement) => {
      let cartesian = this.viewer.scene.pickPosition(movement.endPosition);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);
      let hei = Cesium.Math.toDegrees(cartographic.height);

      if (positions.length >= 0) {
        if (cartesian && cartesian.x) {
          positions.pop();
          positions.push(cartesian);
          polygon.positions.pop();
          polygon.positions.push(cartesian);
          codeInfo.pop();
          codeInfo.push([lng, lat, hei]);
        }
      }
    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

    // right
    this.handler.setInputAction((movement) => {
      this.infoDetail.planeSelf.push({ id: id, positions: codeInfo, polygon });
      console.log("planeSelf", this.infoDetail.planeSelf);
      this.handler.destroy();
      positions.push(positions[0]);
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  }

  /*******
   * @function: function
   * @return {*}
   * @author: xk
   * @description: 繪制線段
   */
  drawLine() {
    this.handler.destroy();
    /**實體的唯一標(biāo)注 */
    let id = null;
    /**記錄拐點坐標(biāo) */
    let positions = [],
      /**記錄返回結(jié)果 */
      codeInfo = [],
      /**面的hierarchy屬性 */
      polygon = new Cesium.PolygonHierarchy(),
      /**面對象配置 */
      polyObj = null;
    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    // left
    this.handler.setInputAction((movement) => {
      id = new Date().getTime();
      let cartesian = this.getMovement(movement).cartesian;
      let position = this.getMovement(movement).position;

      if (cartesian && cartesian.x) {
        if (positions.length == 0) {
          positions.push(cartesian.clone());
        }
        codeInfo.push(position);
        positions.push(cartesian.clone());
        polygon.positions.push(cartesian.clone());
        if (!polyObj) {
          polyObj = this.addLine(id, "line", positions);
        }
      }
    }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
    // mouse
    this.handler.setInputAction((movement) => {
      let cartesian = this.viewer.scene.pickPosition(movement.endPosition);
      let cartographic = Cesium.Cartographic.fromCartesian(cartesian);
      let lng = Cesium.Math.toDegrees(cartographic.longitude);
      let lat = Cesium.Math.toDegrees(cartographic.latitude);

      if (positions.length >= 0) {
        if (cartesian && cartesian.x) {
          positions.pop();
          positions.push(cartesian);
          codeInfo.pop();
          codeInfo.push([lng, lat]);
        }
      }
    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);

    // right
    this.handler.setInputAction((movement) => {
      this.infoDetail.line.push({ id, positions: codeInfo });
      console.log("infoDetail", this.infoDetail.line);
      this.handler.destroy();
    }, Cesium.ScreenSpaceEventType.RIGHT_CLICK);
  }
  /*******
   * @function: function
   * @description: 移除實體對象
   * @return {*}
   * @author: xk
   */
  removeEntity() {
    this.handler = new Cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas);
    this.handler.setInputAction((move) => {
      /**實體對象信息  {id:entities,primitive:。。} */
      let pick = this.viewer.scene.pick(move.endPosition);

      if (pick && pick.id && pick.id.id) {
        document.body.style.cursor = "pointer";
        this.handler.setInputAction((click) => {
          let newPoint;
          switch (pick.id.name) {
            case "point":
              /**刪除某一條數(shù)據(jù) */
              newPoint = this.infoDetail.point.filter(
                (item) => item.id != pick.id._id
              );
              this.infoDetail.point = newPoint;
              break;
            case "line":
              /**刪除某一條數(shù)據(jù) */
              newPoint = this.infoDetail.line.filter(
                (item) => item.id != pick.id._id
              );
              this.infoDetail.line = newPoint;
              break;
            case "rectangle":
              /**刪除某一條數(shù)據(jù) */
              newPoint = this.infoDetail.rectangle.filter(
                (item) => item.id != pick.id._id
              );
              this.infoDetail.rectangle = newPoint;
              break;

            case "planeSelf":
              /**刪除某一條數(shù)據(jù) */
              newPoint = this.infoDetail.planeSelf.filter(
                (item) => item.id != pick.id._id
              );
              this.infoDetail.planeSelf = newPoint;
              break;
            case "circle":
              /**刪除某一條數(shù)據(jù) */
              newPoint = this.infoDetail.circle.filter(
                (item) => item.id != pick.id._id
              );
              this.infoDetail.circle = newPoint;
              break;
            default:
              break;
          }
          this.viewer.entities.remove(pick.id);
        }, Cesium.ScreenSpaceEventType.LEFT_CLICK);
      } else {
        document.body.style = "cursor: default;";
      }
    }, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
  }
  /*******
   * @function: function
   * @return {*}
   * @author: xk
   * @description: 返回繪制數(shù)據(jù)
   */
  backInfoDetail() {
    return this.infoDetail;
  }
}

六、方法使用

//新建繪畫對象
    let draw = new Draw(viewer, {
      borderColor: Cesium.Color.RED,
      material: Cesium.Color.BLUE.withAlpha(0.3),
    });
 draw.drawPlane();

繪畫完后f12打開控制臺會有這樣的數(shù)據(jù)打印

cesium 地形遮擋,cesium,vue學(xué)習(xí),3d,vue.js,javascript

紅框中就是我們需要提取的position數(shù)據(jù),通過addPlane方法就可以實現(xiàn)重繪了


    let polygon = [
      [
        {
          x: 337391.70993699186,
          y: -4745401.190202851,
          z: 4234046.05863133,
        },
        {
          x: 338566.5104026345,
          y: -4745705.230711781,
          z: 4233614.397144763,
        },
        {
          x: 337520.9493625825,
          y: -4746057.340173215,
          z: 4233305.240160256,
        },
        {
          x: 337387.1903192716,
          y: -4745398.61765625,
          z: 4234049.280300835,
        },
      ],
    ];

    draw.addPlane(123123, "planeSelf", polygon);

?教程到這里就結(jié)束了,喜歡的不要忘記關(guān)注點贊收藏哦

這里附上gitee倉庫地址,可以直接拉取查看代碼cesium-test: 用于cesium學(xué)習(xí)測試的倉庫

這是我的qq:1711503830有什么問題歡迎添加討論。文章來源地址http://www.zghlxwxcb.cn/news/detail-674839.html

到了這里,關(guān)于關(guān)于cesium根據(jù)地形畫區(qū)域面積并覆蓋在3d表面上的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實不符,請點擊違法舉報進(jìn)行投訴反饋,一經(jīng)查實,立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費用

相關(guān)文章

  • Revit SDK 介紹:MeasurePanelArea 統(tǒng)計分割表面中族的面積

    Revit SDK 介紹:MeasurePanelArea 統(tǒng)計分割表面中族的面積

    這個例子介紹如果從分割表面中,獲取內(nèi)部Tile(或者Panel)的族里面的幾何實體的面的面積。 本例子的邏輯相對來說比較簡單,主要是對 DividedSurface 和 Element 的API接口要熟悉。 設(shè)置單個面板Panel的面積上限和下限 獲取所有分割表面 如果用戶已經(jīng)選擇了分割表面,就使用當(dāng)前

    2024年02月09日
    瀏覽(13)
  • chatgpt賦能python:Python計算球的表面積和體積

    球是幾何圖形中最簡單而又最常見的形狀之一。計算球的表面積和體積是物理學(xué)、化學(xué)、工程學(xué)等領(lǐng)域中常見的問題。Python作為一種強(qiáng)大的編程語言,可以用來求解這些問題。 在本文中,我們將介紹如何使用Python計算球的表面積和體積。 球的表面積可以用下面的公式來計算

    2024年02月06日
    瀏覽(23)
  • Cesium中實現(xiàn)地形壓平

    Cesium中實現(xiàn)地形壓平

    遇到新需求:地形與傾斜精度不一致,導(dǎo)致部分地形會壓蓋傾斜。雖然關(guān)閉地形深度測試能夠解決,但是又會引發(fā)新的問題,所以決定對范圍內(nèi)的地形做壓平處理。 地形壓平與傾斜壓平類似,目的是將指定范圍內(nèi)的地形頂點修改成設(shè)定的高程。 地形壓平原理和傾斜壓平其實

    2024年02月16日
    瀏覽(45)
  • chatgpt賦能python:如何用Python計算球的表面積和體積

    球體是數(shù)學(xué)中的常見圖形,計算球的表面積和體積是科學(xué)研究和應(yīng)用中的重要問題。Python作為一種高效、易學(xué)、廣泛使用的編程語言,可以很方便地用于計算球的表面積和體積。 本篇文章將會介紹如何用Python計算球的表面積和體積,并提供相關(guān)的代碼和步驟,幫助讀者掌握如

    2024年02月08日
    瀏覽(28)
  • c語言學(xué)習(xí)——設(shè)圓半徑r = 1.5,圓柱高h(yuǎn) = 3,求圓周長,圓面積,圓球表面積,圓球體積,圓柱體積
  • Cesium實踐(2)—— 加載地形與影像

    Cesium實踐(2)—— 加載地形與影像

    地形數(shù)據(jù)用來表示真實的地形起伏;地圖數(shù)據(jù)指的則是真實的影像服務(wù), 本文實踐在Cesium中加載地形與影像數(shù)據(jù)。 地形服務(wù)是Cesium的亮點之一,通過加入地形可以形象的展示出地球表面凹凸起伏。如果要使用地形服務(wù)的話,在創(chuàng)建Viewer時指定 terrainProvider 即可,注意地形數(shù)據(jù)

    2024年02月17日
    瀏覽(21)
  • Cesium將Point渲染到3dtiles模型表面上

    1、功能需求:將point點渲染到三維模型表面上; 2、代碼實現(xiàn): 第一步,繪制點對象,entity 第二步,根據(jù)經(jīng)緯度坐標(biāo)(沒有高度值),獲取該經(jīng)緯度在三維模型表面上的高度值

    2024年02月11日
    瀏覽(34)
  • 再說不會用python計算地球表面多邊形面積,可不能了?。ㄓ涗浳宸N可行方法)

    再說不會用python計算地球表面多邊形面積,可不能了?。ㄓ涗浳宸N可行方法)

    由于地理投影導(dǎo)致導(dǎo)致每個像元實際地面面積不同,越靠近北極實際面積越小,越靠近赤道實際面積越大, 如果不進(jìn)行面積加權(quán)就簡單平均,會導(dǎo)致溫度較實際溫度偏低。 直接使用衛(wèi)星地圖的計算面積功能就會遇到這樣的問題,多數(shù)衛(wèi)星地圖的計算面積功能是將地圖假設(shè)為

    2024年02月01日
    瀏覽(27)
  • UE4 Cesium離線生成地形

    UE4 Cesium離線生成地形

    地理空間數(shù)據(jù)云 首先進(jìn)這個網(wǎng)址,下載對應(yīng)的tif以及高程(DEM) 下載CesiumLab2 在地形切片中點擊添加,將黑白圖像數(shù)據(jù),添加,選擇存儲類型為散列文件,選擇輸出路徑 再選擇影像切片,選擇有顏色的圖片,添加進(jìn)入,選擇存儲方式為散列,選擇輸出路徑,確認(rèn) 下載nginx ?

    2024年02月11日
    瀏覽(24)
  • 【UE5 Cesium】15-Cesium for Unreal 加載本地影像和地形

    【UE5 Cesium】15-Cesium for Unreal 加載本地影像和地形

    目錄 一、加載全球無高度地形 二、加載區(qū)域DEM 三、加載離線地圖影像 1. 先去如下網(wǎng)址下載全球無高度地形:Using a global terrain layer without height detail - #9 by RidhwanAziz - Cesium for Unreal - Cesium Community 下載后如下: 解壓后可以看到是一個.tif格式的文件 2. 打開CesiumLab,需要將tif轉(zhuǎn)為

    2024年02月07日
    瀏覽(20)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包