当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。