Geofence Info Service
URL http://baoapi.esri.com/rest/report/GeofenceInfo

Obtain a list of geographic features from the analysis data layers accessible from the current user account.

Output

The Geofence Info service queries available features from any data layer based on the geographic constraints imposed on the API account. The result of this service is a GeofenceInfoOutput object which contains all of the available feature/area names and their corresponding IDs that satisfy the string-based query on the data layer. Results will vary depending on the geographic constraints on the account.

Additionally, a polygon FeatureSet may be optionally generated and returned in the output results. This FeatureSet may be used to obtain the geographic coordinates of the areas for mapping or rendering in a client application.

Description

The Geofence Info service produces a list of feature/area names and their corresponding IDs based on the result of a string-based query on a data layer and on user account geofence constraints.

After looking up these IDs, the client application developer may view the list of geographic features which she has access to. Feature IDs obtained from the list can be used to specify one or more geographic features/areas in a Summary Reports analysis using StdLayers as the value for the Boundaries parameter. Features/areas in the data layers are often identified by standardized FIPS codes which generally correspond to the geography feature IDs. The Geofence Info service can be leveraged to look up these IDs which are available to the current user.

Usage Tips

You can provide arguments to the Geofence Info service as defined in the parameters table below.

Parameters

Parameter Details
GeoLevelID (Required) Description: A data layer ID to query.

Syntax: GeoLevelID=<string>

Example: GeoLevelID=US.Tracts

Notes: See Get Standard Geography Levels for a list of available geography data layers.
Token (Required) Description: A valid REST services token string.

Syntax: Token=<string>

Example: Token=ABC123...

Notes: The value associated with the Token parameter is for example purposes only. See Get Token for more information on obtaining a token.

ActiveDatasetID Description: Specify a dataset to perform Online API tasks or operations.

Default: USA

Syntax: ActiveDatasetID=<string>

Example: ActiveDatasetID=Canada

Notes: See the Get Datasets task to dynamically query the available dataset IDs.

Access to additional datasets is subject to the type, terms and restrictions associated with your Online API subscription.

Callback Description: Wrap the JSON or PJSON response in a named function that can be executed by client-side JavaScript upon receipt.

Default: null

Syntax: Callback=<string>

Example: Callback=MyCallbackFunction

Notes:
The response will be wrapped in a callback function only if a non-null Callback parameter value is specified and if the response format (the f parameter) is set to JSON or PJSON
.

Callback functions are useful for consuming the service in JavaScript-based client applications as shown in this basic example.

f Description: The response format.

Default: HTML

Syntax: f=<HTML | JSON | PJSON>

Example: f=JSON

OutputType Description: GetFeatureClass returns the serialized geometry and attributes of the output areas in the response. If the list of operations is empty, an array of standard geography feature IDs and names is returned in the GeofenceInfoOutput result object.

Default: OutputType=null


Syntax: OutputType=<TaskOutputTypeArray>

Example: OutputType=GetFeatureClass

Notes: Only GetFeatureClass is currently supported. Omit this parameter and value, if no geometry is required and to minimize the size of the response payload.

SearchString Description: A string of characters which is used to query the data layer specified by the GeoLevelID parameter value.

Syntax: SearchString=<string>

Example: SearchString=06

Notes: White space in the attribute values may be substituted with the + character (e.g. "san+bernardino+county"). URL encoding also allows the use of %20 in place of spaces.

Example Usage


Example 1: Obtain the list of all U.S. Census tracts accessible from the current API subscription account. Additionally, obtain the corresponding geometry (polygon FeatureSet) and graphic image representing the accessible geographic features.

Request Example (1)

http://baoapi.esri.com/rest/report/GeofenceInfo?
f=PJSON&
OutputType=GetFeatureClass&
GeoLevelID=US.Tracts&
Token=ABC123

Notes: The response payload can be large due to the specification of GetFeatureClass in the OutputType parameter. Omit this parameter to retrieve the list without the polygon geometries.

The Request Example is hyperlinked with the URL-encoded request URI without a valid token parameter value. Include a valid token value to submit. See Get Token for more information on obtaining a token.



Example Response

JSON Response Syntax

<GeofenceInfoOutput>

Notes: When areas are specified in other analyses, the values associated with their feature IDs are typically specified.



JSON Response Example

{
  "TaskMessagesArray": [],
  "StdGeographiesFeatures": [
    {
      "FeatureID": "06071007301",
      "FeatureName": "06071007301"
    },
    {
      "FeatureID": "06071007800",
      "FeatureName": "06071007800"
    },
    
    ...
    
    {
      "FeatureID": "06071008600",
      "FeatureName": "06071008600"
    }
  ],
  "RecordSet": {
    "geometryType": "esriGeometryPolygon",
    "spatialReference": {"wkid": 4326},
    "features": [
      {
        "attributes": {
          "ID": "06071008500",
          "Gen2_Length": 0.27680121712515127,
          "Gen2_Area": 0.0025918185791268225
        },
        "geometry": {
          "rings": [
            [
              [-117.066024, 34.004074],
              [-117.135041, 34.00397],
              
              ...
              
              [-117.066024,34.004074]
            ]
          ],
          "spatialReference": {"wkid": 4326}
        }
      },
      {
        "attributes": {
          "ID": "06071008600",
          "Gen2_Length": 0.32809403429573064,
          "Gen2_Area": 0.004200010941483622
        },
        "geometry": {
          "rings": [
            [
              [-117.036539, 34.0684],
              [-117.042867, 34.06833],
            
              ...
            
              [-117.036539, 34.0684]
            ]
          ],
          "spatialReference": {"wkid": 4326}
        }
      },
      
      ...
      
      {
        "attributes": {
          "ID": "06071008404",
          "Gen2_Length": 0.049442110817163376,
          "Gen2_Area": 1.2628456739656116E-4
        },
        "geometry": {
          "rings": [
            [
              [-117.156408, 34.062809],
              [-117.156354, 34.059817],
              
              ...
              
              [-117.156408, 34.062809]
            ]
          ],
          "spatialReference": {"wkid": 4326}
        }
      }
    ]
  }
}

Notes: The response has been abbreviated in the example where "..." is noted.

The default map projection is GCS_WGS_1984 (WKID: 4326).


JSON Response Example (1) Rendered with the ArcGIS API for JavaScript

Example 1 Rendering Example

Notes: The thematic shading of the features is for illustrative purposes only and is not representative of their corresponding attribute values.





See Also

Benchmark Report

Get Standard Geography Levels

Get Token

Summary Reports