當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS meshUtils.georeference用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/geometry/support/meshUtils"], (meshUtils) => { /* code goes here */ });

ESM: import * as meshUtils from "@arcgis/core/geometry/support/meshUtils";

對象: esri/geometry/support/meshUtils

自從:用於 JavaScript 4.7 的 ArcGIS API

用法說明

meshUtils.georeference函數(或屬性)的定義如下:

georeference (vertexAttributes, location, options) {VertexAttributes}


在笛卡爾坐標係中指定的地理參考頂點。這在轉換通常沒有地理參考的一般 3D 模型網格時很有用。此方法對網格頂點屬性進行操作,並將位置和法線(如果指定)從本地 (0, 0, 0) 笛卡爾係統轉換為指定 location 處的正確地理參考坐標。源數據的單位默認為 location 的空間參考單位。如果坐標係為 WGS84,則默認使用公製單位。可以在附加的options 中指定源數據的單位,在這種情況下,將自動應用線性單位比例以使源數據采用空間參考單位。

參數:

規格:
類型說明
vertexAttributes VertexAttributes

地理參考的位置和法線緩衝區。

location Point

地理參考位置和正常緩衝區的位置。

options Object
可選的

其他選項。

規格:
geographic

Boolean

可選的

指示是相對於地球還是投影坐標係進行地理配準。

unit

String

可選的

表示源數據的單位。線性比例將應用於位置屬性,以將源數據轉換為對網格進行地理參考的空間參考單位。默認情況下,假定源數據的單位與目標空間參考相同。

可能的值"millimeters"|"centimeters"|"decimeters"|"meters"|"kilometers"|"inches"|"feet"|"yards"|"miles"|"nautical-miles"|"us-feet"

返回:

類型 說明
VertexAttributes 地理參考位置和正常緩衝區。

例子:

let geoVertexAttributes = meshUtils.georeference(vertexAttributes, location);
let mesh = new Mesh({
  vertexAttributes: geoVertexAttributes,
  spatialReference: location.spatialReference
});

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 meshUtils.georeference。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。