Hide Table of Contents
esri/dijit/util
esri/layer/pixelFilters
esri/process
esri/workers
Class: FeatureSet

require(["esri/tasks/FeatureSet"], function(FeatureSet) { /* code goes here */ });

Description

(Added at v1.0)
A collection of features returned from ArcGIS Server or used as input to tasks. Each feature in the FeatureSet may contain geometry, attributes, symbology, and an InfoTemplate. If the FeatureSet does not contain geometry, and only contains attributes, the FeatureSet can be treated as a table where each feature is a row object. Tasks that return FeatureSet include QueryTask, Geoprocessor, and RouteTask. In addition, Geoprocessor and RouteTask may require FeatureSet as input.

Samples

Search for samples that use this class.

Subclasses

Constructors

NameSummary
new FeatureSet()Creates a new FeatureSet object.
new FeatureSet(json)Creates a new FeatureSet object using a JSON object.

Properties

NameTypeSummary
displayFieldNameStringThe name of the layer's primary display field.
exceededTransferLimitBooleanTypically a layer has a limit on the number of features (i.e., records) returned by the query operation.
featuresGraphic[]The array of graphics returned.
fieldAliasesObjectSet of name-value pairs for the attribute's field and alias names.
fieldsObject[]The array of fields.
geometryTypeStringThe geometry type of the FeatureSet.
spatialReferenceSpatialReferenceWhen a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default.
Constructor Details

new FeatureSet()

Creates a new FeatureSet object. The constructor takes no parameters.

new FeatureSet(json)

Creates a new FeatureSet object using a JSON object. (Added at v1.3)
Parameters:
<Object> json Required A JSON object that contains feature set.
Property Details

<String> displayFieldName

The name of the layer's primary display field. The value of this property matches the name of one of the fields of the feature. Only applicable when the FeatureSet is returned from a task. It is ignored when the FeatureSet is used as input to a geoprocessing task.

<Boolean> exceededTransferLimit

Typically a layer has a limit on the number of features (i.e., records) returned by the query operation. See FeatureLayer.maxRecordCount property. If maxRecordCount is configured for a layer, exceededTransferLimit will be true if a query matches more than the maxRecordCount features and false otherwise. Supported by ArcGIS Server version 10.1 and later. (Added at v2.8)
Known values: true | false

<Graphic[]> features

The array of graphics returned.
Sample:
require([
  "esri/graphic", "esri/tasks/FeatureSet", ... 
], function(Graphic, FeatureSet, ... ) {
  var graphic = new Graphic( ... );
  var features= [];
  features.push(graphic);
  var featureSet = new FeatureSet();
  featureSet.features = features;
  ...
});

<Object> fieldAliases

Set of name-value pairs for the attribute's field and alias names.

<Object[]> fields

The array of fields. (Added at v3.18)

<String> geometryType

The geometry type of the FeatureSet.

<SpatialReference> spatialReference

When a FeatureSet is used as input to Geoprocessor, the spatial reference is set to the map's spatial reference by default. This value can be changed. When a FeatureSet is returned from a task, the value is the result as returned from the server. See Projected Coordinate Systems and Geographic Coordinate Systems for the list of supported spatial references.