Show:

An encapsulation of a FeatureDefn's fields.

Methods

add
(
  • field(s)
)

Adds field definition(s).

Parameters:

count () Integer

Returns the number of fields.

Returns:

Integer
forEach
(
  • callback
)

Defined in lib/gdal.js:296

Iterates through all field definitions using a callback function.

Parameters:

  • callback Function

    The callback to be called with each FieldDefn

Example:

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

Returns a field definition.

Parameters:

  • key String | Integer

    Field name or index

Returns:

getNames () Array

Returns a list of field names.

Returns:

Array:

List of field names.

indexOf
(
  • name
)
Integer

Returns the index of field definition.

Parameters:

  • name String

Returns:

Integer:

Index or -1 if not found.

map
(
  • callback
)

Defined in lib/gdal.js:309

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

Parameters:

  • callback Function

    The callback to be called with each FieldDefn

Example:

var result = dataset.layers.map(function(field, i) {
    return value;
});
remove
(
  • key
)

Removes a field definition.

Parameters:

  • key String | Integer

    Field name or index

reorder
(
  • map
)

Reorders the fields.

Parameters:

  • map Array

    An array representing the new field order.

Example:

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

Attributes

featureDefn

gdal.FeatureDefn readonly

Parent feature definition.