Standard Geographies by Attributes Service
URL http://baoapi.esri.com/rest/report/StdGeographiesByAttributes

Query the geographic boundary data layers by string.

Output

The Standard Geographies by Attributes service enables a string-based query on any available data layer. The result of this service is StdGeographiesArrayOfFeatures which contains all of the feature/area names and their corresponding IDs that satisfied the string-based query on the data layer. These feature/area IDs can be used to specify specific geographic areas in subsequent analysis.

Description

The Standard Geographies by Attributes 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. After looking up these IDs, they may 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. Alternatively, they may be identified in the data layers by some other ID. Standard Geographies by Attributes can be used to look up these IDs.

Some applications of Standard Geographies by Attribute include the following:

Usage Tips

You can provide arguments to the Standard Geographies by Attribute utility 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.

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

Syntax: SearchString=<string>

Example: SearchString=060

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.

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

Example Usage


Example 1: Obtain a list of all USPS ZIP codes containing "065" and output the response in PJSON format.

Request Example (1)

http://baoapi.esri.com/rest/report/StdGeographiesByAttributes?
f=PJSON&
GeoLevelID=US.ZIP5&
SearchString=065&Token=ABC123
(Example uses limited demo account)

Notes: See Get Token for more information on obtaining a token.


Example 2: Look up the feature/area ID of San Bernardino County. (In this case, a FIPS code will be returned.)

Request Example (2)

http://baoapi.esri.com/rest/report/StdGeographiesByAttributes?
f=PJSON&
GeoLevelID=US.Counties&
SearchString=san+bernardino+county&
Token=ABC123
(Example uses limited demo account)

Notes: See Get Token for more information on obtaining a token.

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 Response

JSON Response Syntax

{
  "results": [
    {
      "Feature": <StdGeographiesArrayOfFeatures>
    }
  ]
}

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


JSON Response Example (1)

{
  "results": [
    {
      "Feature": [
        {
          "FeatureID": "05065",
          "FeatureName": "Sharon",
          "StateName": "Vermont",
          "StateAbbrev": "VT"
        },
        {
          "FeatureID": "06065",
          "FeatureName": "Riverton",
          "StateName": "Connecticut",
          "StateAbbrev": "CT"
        },
 
        ...
 
        {
          "FeatureID": "98065",
          "FeatureName": "Snoqualmie",
          "StateName": "Washington",
          "StateAbbrev": "WA"
        }
      ]
    }
  ]
}

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

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



JSON Response Example (2)

{
  "results": [
    {
      "Feature": [
        {
          "FeatureID": "06071",
          "FeatureName": "San Bernardino County"
          "StateName": "California",
          "StateAbbrev": "CA"
        }
      ]
    }
  ]
}

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

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



See Also

Get Standard Geography Levels

Get Token

Standard Geographies from Extent

Summary Reports