Show:

An encapsulation of a FeatureDefn's fields.

Methods

add
(
  • fields
)

Adds field definition(s).

Parameters:

count () Number

Returns the number of fields.

Returns:

Number
forEach
(
  • callback
)

Iterates through all field definitions using a callback function.

Parameters:

  • callback forEachCb

    The callback to be called with each FieldDefn

Example:

featureDefn.forEach(function(array, i) { ... });`
get
(
  • key
)
gdal.FieldDefn

Returns a field definition.

Parameters:

  • key String | Number

    Field name or index

Returns:

getNames () String[]

Returns a list of field names.

Returns:

String[]:

List of field names.

indexOf
(
  • name
)
Number

Returns the index of field definition.

Parameters:

  • name String

Returns:

Number:

Index or -1 if not found.

map<U>
(
  • callback
)
U[]

Iterates through field definitions using a callback function and builds an array of the returned values.

Parameters:

  • callback mapCb

    The callback to be called with each FieldDefn

Returns:

U[]

Example:

var result = featureDefn.map(function(array, i) {
    return value;
});`
remove
(
  • key
)

Removes a field definition.

Parameters:

  • key String | Number

    Field name or index

reorder
(
  • map
)

Reorders the fields.

Parameters:

  • map Number[]

    An array representing the new field order.

Example:

// reverse fields:
featureDef.fields.reorder([2, 1, 0]);`
Symbol.asyncIterator ()

Iterates through all field definitions using an async iterator

Example:

for await (const array of featureDefn) {
}
Symbol.iterator ()

Iterates through all field definitions using an iterator

Example:

for (const array of featureDefn) {
}

Attributes

featureDefn

gdal.FeatureDefn readonly

Parent feature definition.