GetFeatureByIndice

API definition

APP_ERROR GetFeatureByIndice(int64_t count, const int64_t *indices, int64_t *labels = nullptr, void *features = nullptr, FeatureAttr *attributes = nullptr, ExtraValAttr *extraVal = nullptr) const;

Function

Obtains features by indice.

Input

int64_t count: number of features to be obtained.

const int64_t *indices: index of the feature to be obtained.

Output

int64_t *labels: label corresponding to the feature to be obtained.

void *features: feature vector to be obtained.

FeatureAttr *attributes: spatiotemporal attribute of the feature to be obtained.

ExtraValAttr *extraVal: extra attribute of the feature to be obtained.

Return value

APP_ERROR: return status. For details, see Return Code Reference.

Restrictions

  • Value range of count for each API call: [1, 1e6]
  • The length of indices must be count. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown. The value must be greater than or equal to 0 and less than the number of features in the database.
  • If labels is nullptr, feature labels will not be obtained. The length of labels must be count × dim. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • If features is nullptr, feature vectors will not be obtained. The length of features must be count × dim. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • If attributes is nullptr, spatiotemporal attributes will not be obtained. The length of attributes must be count. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.
  • If extraVal is nullptr, extra feature attributes will not be obtained. The length of extraVal must be count. Otherwise, an out-of-bounds read/write error may occur, causing program breakdown.