类 OneDimDistance

嵌套关系

嵌套类型

继承关系

基类

类文档

class OneDimDistance : public gwm::Distance

Class for calculating spatial distance according to coordinate reference system.

公有成员函数

OneDimDistance()
explicit OneDimDistance(bool isGeographic)

Construct a new OneDimDistance object

参数:

isGeographic -- Whether the coordinate reference system is geographical.

OneDimDistance(const OneDimDistance &distance)

Construct a new OneDimDistance object.

参数:

distance -- Refernce to object for copying.

inline virtual std::unique_ptr<Distance> clone() const override

克隆这个 Distance 对象。

返回:

Distance* 重新创建的对象指针

inline virtual DistanceType type() override

返回该对象的类型。

返回:

DistanceType 距离陆良类型

virtual void makeParameter(std::initializer_list<DistParamVariant> plist) override

Create Parameter for Caclulating CRS Distance.

参数:

plist -- A list of parameters containing 2 items:

  • arma::vec focus coordinates (one column)

  • arma::vec data coordinates (one column)

返回:

DistanceParameter* The pointer to parameters.

virtual arma::vec distance(arma::uword focus) override

为一个目标点计算距离向量。

参数:

focus -- 目标点索引,要求 focus 小于参数中的 total

返回:

arma::vec 目标点到所有数据点的距离向量

arma::vec noAbsdistance(arma::uword focus)

Calculate distance for points (focus) just like distance.

参数:

focus -- the index of points to be calculated. A list of parameters should be contained, and 2 items: Matrix of focus point' coordinate & Matrix of data point' coordinate.

返回:

arma::vec Distance vector with not absolute value.

virtual double maxDistance() override

获取最大距离。

返回:

double 最大距离

virtual double minDistance() override

获取最小距离。

返回:

double 最小距离

公有静态方法

static inline arma::vec AbstractDistance(const double &out_loc, const arma::vec &in_locs)

Calculate spatial distance for points with geographical coordinate reference system.

参数:
  • out_loc -- Matrix of focus point' coordinate. The shape of it must be 1x2 and the first column is longitudes, the second column is latitudes.

  • in_locs -- Matrix of data points' coordinates. The shape of it must be nx2 and the first column is longitudes, the second column is latitudes.

返回:

arma::vec Distance vector for out_loc.

保护属性

std::unique_ptr<Parameter> mParameter = nullptr

参数

struct Parameter : public gwm::Distance::Parameter

Struct of parameters used in spatial distance calculating according to coordinate reference system. Usually a pointer to object of this class is passed to OneDimDistance::distance().

公有成员函数

inline Parameter(const arma::vec &fp, const arma::vec &dp)

Construct a new OneDimDistanceParameter object.

参数:
  • fp -- Reference to focus points.

  • dp -- Reference to data points.

公有成员

arma::vec focusPoints

Matrix of focus points' coordinates. The shape of it must be nx2 and the first column is longitudes or x-coordinate, the second column is latitudes or y-coordinate.

arma::vec dataPoints

Matrix of data points' coordinates. The shape of it must be nx2 and the first column is longitudes or x-coordinate, the second column is latitudes or y-coordinate.