new Cesium.SampledProperty(type, derivativeTypes)

A Property whose value is interpolated for a given time from the 提供了一组样本和指定的插值算法和度.
Name Type Description
type number | Packable 财产类型.
derivativeTypes Array.<Packable> optional 提供样品时,说明样品将包含特定类型的衍生信息.
Examples:
//Create a linearly interpolated Cartesian2
const property = new Cesium.SampledProperty(Cesium.Cartesian2);

//Populate it with data
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), new Cesium.Cartesian2(0, 0));
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-02T00:00:00.00Z'), new Cesium.Cartesian2(4, 7));

//Retrieve an interpolated value
const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T12:00:00.00Z'));
//Create a simple numeric SampledProperty that uses third degree Hermite Polynomial Approximation
const property = new Cesium.SampledProperty(Number);
property.setInterpolationOptions({
    interpolationDegree : 3,
    interpolationAlgorithm : Cesium.HermitePolynomialApproximation
});

//Populate it with data
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:00.00Z'), 1.0);
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:01:00.00Z'), 6.0);
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:00.00Z'), 12.0);
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:03:30.00Z'), 5.0);
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:06:30.00Z'), 2.0);

//Samples can be added in any order.
property.addSample(Cesium.JulianDate.fromIso8601('2012-08-01T00:00:30.00Z'), 6.2);

//Retrieve an interpolated value
const result = property.getValue(Cesium.JulianDate.fromIso8601('2012-08-01T00:02:34.00Z'));
See:

Members

backwardExtrapolationDuration : number

获取或设定向后推断的时间量 在财产变成未定义之前。 0的值将永远推断出来.
Default Value: 0

backwardExtrapolationType : ExtrapolationType

获取或设定值时要执行的外推类型 在任何可用的样本之前要求提交.
Default Value: ExtrapolationType.NONE

readonly definitionChanged : Event

当此属性定义发生变化时, 获取该属性被提起的事件 . 如果给Value的电话被调回,定义就被认为有所改变 同时得出不同的结果.

derivativeTypes : Array.<Packable>

获取此属性使用的衍生类型 .

forwardExtrapolationDuration : number

获取或设定前进的时间 属性变为未定义 。 0的值将永远推断出来.
Default Value: 0

forwardExtrapolationType : ExtrapolationType

获取或设定值时要执行的外推类型 在任何可用的样品之后要求.
Default Value: ExtrapolationType.NONE

interpolationAlgorithm : InterpolationAlgorithm

获取值时获得插值算法.
Default Value: LinearApproximation

interpolationDegree : number

获取一个值时获得插值的度.
Default Value: 1

readonly isConstant : boolean

获得一个表示该属性是否常数的值。 财产被视为 常数,如果获得Value 总是返回当前定义的相同结果.

type : *

获得财产类型.

Methods

addSample(time, value, derivatives)

添加新样本.
Name Type Description
time JulianDate 样本时间.
value Packable 提供的时间值 .
derivatives Array.<Packable> optional 提供时间的衍生工具阵列.

addSamples(times, values, derivativeValues)

添加一系列样本.
Name Type Description
times Array.<JulianDate> An array of JulianDate instances where each index is a sample time.
values Array.<Packable> 数组,其中每个值对应提供的时间索引.
derivativeValues Array.<Array> optional 一个阵列,其中每个项目是等时指数的衍生物数组.
Throws:

addSamplesPackedArray(packedSamples, epoch)

添加样本作为单个组合阵列,每个新样本以日期表示, 然后是相应价值和衍生物的包装表示.
Name Type Description
packedSamples Array.<number> 组装的样本.
epoch JulianDate optional 如果包装样本中的任何日期都是数字,它们就被认为是这个时代的抵消,以秒计.

equals(other)boolean

将此属性与所提供的属性进行比较并返回 -NT+0+Treal NT+1+,如果两者是相等的, NT+2+false NT+3+否则.
Name Type Description
other Property optional 其他财产.
Returns:
如果左右对等, 则使用 NT 0 true NT 1 , 否则使用 NT 2 false NT 3 .

getSample(index)JulianDate|undefined

获取与指数相关的提供样本的时间。 负指数按反序访问样本列表.
Name Type Description
index number 样本列表索引.
Returns:
The JulianDate time of the sample, or undefined if failed.

getValue(time, result)object

在提供的时间获得财产的价值.
Name Type Default Description
time JulianDate JulianDate.now() optional The time for which to retrieve the value. If omitted, the current system time is used.
result object optional 如果省略,则创建并返回将数值存储为新实例的对象.
Returns:
未提供结果参数的修改结果参数或新实例 .

removeSample(time)boolean

如果存在,则在给定时间删除样本.
Name Type Description
time JulianDate 样本时间.
Returns:
如果时间样本被删除,则使用 NT+0 real NT+1 .

removeSamples(time)

删除给定时间间隔的所有样本.
Name Type Description
time TimeInterval 删除所有样本的时间间隔 .

setInterpolationOptions(options)

设置插值时使用的算法和度.
Name Type Description
options object optional 下列属性的对象 :
Name Type Description
interpolationAlgorithm InterpolationAlgorithm optional 新的内插算法. 如果未定义, 现有的财产将保持不变 .
interpolationDegree number optional 新内插学位. 如果未定义, 现有的财产将保持不变 .
Need help? The fastest way to get answers is from the community and team on the Cesium Forum.