SWRLRegion Class Reference

Inherits from SWRLSignal : SWRLObject : NSObject
Declared in SWRLRegion.h
SWRLRegion.m

Overview

A SWRLRegion object represents a geofence.

Other Methods

  region

An CLCircularRegion which provides a center point (latitude and longitude) and a radius in meters which defines the area covered by the region or an outer bounding area for regions which are further refined by an arbitrary polygon.

@property (nonatomic, readonly) CLCircularRegion *region

Declared In

SWRLRegion.h

  polyCount

For polygon regions, polyCount is the number of entries in the polyPoints array

@property (nonatomic, readonly) NSInteger polyCount

Declared In

SWRLRegion.h

  polyCoords

For polygon regions, polyPoints is an array of polyCount coordinates that represent the vertices of the polygon that refines the circular bounding region

@property (nonatomic, readonly) CLLocationCoordinate2D *polyCoords

Declared In

SWRLRegion.h

  regionType

A string representing the type of region: control, geofence

@property (nonatomic, readonly) NSString *regionType

Declared In

SWRLRegion.h

– containsCoordinate:

Determine if a given lattitude and longitude lie within the Region or not.

- (BOOL)containsCoordinate:(CLLocationCoordinate2D)coordinate

Parameters

coordinate

A coordinate (latitude, longitude) to test for inclusion

Return Value

YES if the coordinate is contained with in the bounding region and where specified the arbitrary polygon within, NO otherwise.

Declared In

SWRLRegion.h

– containsLocation:accuracy:

Determine if a give location (plus tolerance) is within a circular region. Polygon regions will default to strict containment.

- (BOOL)containsLocation:(CLLocation *)location accuracy:(CLLocationDistance)accuracy

Parameters

location

to test

accuracy

maximum tolerance to allow (accuracy of the location will be used, clipped to this value)

Return Value

YES if within the region, NO otherwise

Declared In

SWRLRegion.h

– distanceFromLocation:

Determine the distance of a location to the region.

- (double)distanceFromLocation:(CLLocation *)location

Parameters

location

The location to use in determining distance from the region.

Return Value

The distance from the region, negative values are inside the region.

Declared In

SWRLRegion.h

– setLastDetected:

Timestamp of last detection of this signal.

- (void)setLastDetected:(NSTimeInterval)ts

Declared In

SWRLSignal.h

Other Methods

– type

Type of signal.

- (SWRLSignalType)type

Declared In

SWRLSignal.h

– range

This is the approximate range to the beacon. This is a rough approximation.

- (double)range

Declared In

SWRLSignal.h

– lastDetected

Timestamp of last detection of this signal.

- (NSTimeInterval)lastDetected

Declared In

SWRLSignal.h