feature.Field()

class feature.Field(config)
Arguments
  • config (Object) – Configuration object.

Create a new field.

Example Use

Sample code to create a new field:

>> var Field = require("geoscript/feature").Field;
>> var field = Field({
..   name: "age",
..   type: "Double"
.. });

>> var field = Field({
..   name: "location",
..   type: "Point",
..   projection: "EPSG:4326"
.. });

For detail on the supported type values, see the section on Type Mapping.

Config Properties

description

String The field description (optional).

isNillable

Boolean The field is nillable (optional). Default is true.

minOccurs

Number The minimum occurences for field values (optional). Default is 0.

name

String The field name (required).

projection

proj.Projection() Geometry projection (optional). Relevant for geometry type fields only.

title

String The field title (optional).

type

String The field type (required). For detail on the supported type values, see the section on Type Mapping.

Properties

Field.description

String The field description (read-only).

Field.isNillable

Boolean The field is nillable (read-only).

Field.maxOccurs

Number The maximum occurences for field values (read-only).

Field.minOccurs

Number The minimum occurences for field values (read-only).

Field.name

String The field name (read-only).

Field.projection

proj.Projection() Geometry type fields can have an optional projection (read-only).

Field.title

String The field title (read-only).

Field.type

String The field type (read-only). For detail on the supported type values, see the section on Type Mapping.

Methods

Field.equals()
Arguments
Returns

Boolean The two fields are equivalent.

Determine if another field is equivalent to this one.