ArcGIS Runtime SDK for iOS: AGSFeatureFenceParameters Class Reference
ArcGIS Runtime SDK for iOS  100.15
AGSFeatureFenceParameters Class Reference

Description

Geotrigger fence data created from features.

The features that create an AGSFeatureFenceParameters provide a set of geometries (and attributes) that define targets for the AGSGeotrigger. For example, if the condition is "notify me when my position comes within 50 meters of one of my target areas", the fence data are "my target areas" and each AGSFeature is one target area.

Create an AGSFeatureFenceParameters using an AGSFeatureTable. The features can have point, line, or polygon geometry. For points and lines, you must also supply an AGSFenceParameters::bufferDistance. Each feature in the table represents a single fence.

You can filter features using attributes or geometry by supplying a where clause. For example, you could further refine "my target areas" to be "my target areas that are open and are in California".

The number of features fetched by querying an online table is limited by the layer's AGSArcGISFeatureLayerInfo::maxRecordCount. Service feature tables that support pagination (AGSArcGISFeatureLayerInfo::supportsPagination) are not subject to the maximum feature count limit.

When saving new geotriggers into a web map, ensure all feature layer's are assigned a unique AGSLayer::layerID. This ensures the saved AGSFeatureFenceParameters::featureTable is associated with the corresponding layer. When the saved AGSMap and AGSGeoModel::geotriggersInfo are loaded, the layer and geotrigger will use the same AGSFeatureTable.

An AGSFenceGeotrigger can also take into account floors within buildings. If the feature table used to create the AGSFeatureFenceParameters is referenced by an AGSFeatureLayer that is AGSFloorAware, and the AGSLocationDataSource used to create the AGSGeotriggerFeed includes AGSLocationSourcePropertiesKeys::floor information, then fences will only be entered when they are intersected by an AGSLocation on the correct floor. If the fence or location data does not include valid floor information, the floor is ignored and the fence is entered when it is intersected by the location.

A floor aware feature layer or table must be part of an AGSGeoModel that includes a valid AGSGeoModelFloorDefinition. All layers and tables that are used by the floor definition are loaded when the AGSGeotriggerMonitor is started.

An AGSLocation can contain floor property as part of AGSLocation::additionalSourceProperties. This is populated automatically by AGSIndoorsLocationDataSource, or can be supplied as part of your own implementation.

Since
100.12
Inheritance diagram for AGSFeatureFenceParameters:
AGSFenceParameters AGSObject

Instance Methods

(instancetype) - initWithFeatureTable:
 
(instancetype) - initWithFeatureTable:bufferDistance:
 

Class Methods

(instancetype) + featureFenceParametersWithFeatureTable:
 
(instancetype) + featureFenceParametersWithFeatureTable:bufferDistance:
 
(nullable AGSFenceParameters *) + fenceParametersWithGeoElement:bufferDistance:
 

Properties

AGSGeometryareaOfInterest
 
double bufferDistance
 
AGSFeatureTablefeatureTable
 
NSString * whereClause
 

Method Documentation

◆ featureFenceParametersWithFeatureTable:

+ (instancetype) featureFenceParametersWithFeatureTable: (AGSFeatureTable *)  featureTable

Creates an AGSFeatureFenceParameters using all of the features in the AGSFeatureTable.

Parameters
featureTableThe AGSFeatureTable that contains the features to use in the AGSFeatureFenceParameters.
Since
100.12

◆ featureFenceParametersWithFeatureTable:bufferDistance:

+ (instancetype) featureFenceParametersWithFeatureTable: (AGSFeatureTable *)  featureTable
bufferDistance: (double)  bufferDistance 

Creates an AGSFeatureFenceParameters using all of the features in the AGSFeatureTable.

Parameters
featureTableThe AGSFeatureTable that contains the features to use in the AGSFeatureFenceParameters.
bufferDistanceA buffer distance in meters to apply to the features when checking if an AGSFenceGeotrigger condition is met.
Since
100.12

◆ fenceParametersWithGeoElement:bufferDistance:

+ (nullable AGSFenceParameters *) fenceParametersWithGeoElement: (id< AGSGeoElement >)  geoElement
bufferDistance: (double)  bufferDistance 

Static factory function to create an AGSFenceParameters.

This method creates the appropriate type of AGSFenceParameters based on the type of the AGSGeoElement that was supplied. The supported types of AGSGeoElement are AGSGraphic and AGSFeature.

If passed an unsupported AGSGeoElement, this method will return nil.

Parameters
geoElementAn individual AGSGeoElement used to create an AGSFenceParameters object.
bufferDistanceA buffer distance in meters to apply to the AGSGeoElement when checking if an AGSGeotrigger condition is met.
Returns
An AGSFenceParameters created from an AGSGeoElement.
Since
100.12

◆ initWithFeatureTable:

- (instancetype) initWithFeatureTable: (AGSFeatureTable *)  featureTable

Creates an AGSFeatureFenceParameters using all of the features in the AGSFeatureTable.

Parameters
featureTableThe AGSFeatureTable that contains the features to use in the AGSFeatureFenceParameters.
Since
100.12

◆ initWithFeatureTable:bufferDistance:

- (instancetype) initWithFeatureTable: (AGSFeatureTable *)  featureTable
bufferDistance: (double)  bufferDistance 

Creates an AGSFeatureFenceParameters using all of the features in the AGSFeatureTable.

Parameters
featureTableThe AGSFeatureTable that contains the features to use in the AGSFeatureFenceParameters.
bufferDistanceA buffer distance in meters to apply to the features when checking if an AGSFenceGeotrigger condition is met.
Since
100.12

Property Documentation

◆ areaOfInterest

- (AGSGeometry*) areaOfInterest
readwritenonatomicstrong

The geometry that can be used to spatially filter fences.

This needs to be either an AGSEnvelope or AGSPolygon. Use this to define which features in the AGSFeatureTable are to be used as fences by defining an area of interest. If this property is nil we will use the full extent of the feature table.

Since
100.12

◆ bufferDistance

- (double) bufferDistance
readnonatomicassigninherited

A buffer distance in meters to apply when checking if an AGSFenceGeotrigger condition is met.

For example, if the rule is "enters within 50 meters" you use an AGSFenceGeotrigger::ruleType of AGSFenceRuleTypeEnter and set this property to 50.

Buffers are Geodetic and created using the following default values:

  • AGSGeodeticCurveTypeShapePreserving
  • Max deviation = NAN
  • AGSLinearUnitIDMeters

If your fences use a point or polyline geometry then you must set this property to a value greater than 0.

Since
100.12

◆ featureTable

- (AGSFeatureTable*) featureTable
readnonatomicstrong

The AGSFeatureTable that contains the features to use in the AGSFeatureFenceParameters.

This table can be shared with an AGSFeatureLayer::featureTable.

When saving new geotriggers into a web map, ensure all feature layer's are assigned a unique AGSLayer::layerID. This ensures the saved AGSFeatureFenceParameters::featureTable is associated with the corresponding layer. When the saved AGSMap and AGSGeoModel::geotriggerCollection are loaded, the layer and geotrigger will use the same AGSFeatureTable.

Since
100.12

◆ whereClause

- (NSString*) whereClause
readwritenonatomiccopy

A where clause that defines the features from the AGSFeatureTable to use as fences.

The string that is used as the whereClause should follow standard SQL syntax similar to what is discussed in the document SQL reference for query expressions used in ArcGIS.

The number of features fetched by querying an online table is limited by the layer's AGSArcGISFeatureLayerInfo::maxRecordCount. Service feature tables that support pagination (AGSArcGISFeatureLayerInfo::supportsPagination) are not subject to the maximum feature count limit.

Since
100.12