FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.0   R E S T   A P I   S T D   G E O G R A P H Y   U T I L I T Y

Standard Geographies from Tree Endpoint

Geography location names and IDs are returned for a query to the hierarchy of standard geography levels.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/StdGeographiesFromTree/execute

Specific Parameters

Parameter

Description

BranchID (required)

The ID of branch in the tree of standard geography levels. The tree could be retrieved with Standard Geographies Tree method. Type string.

Depth (required)

Depth of the geography level in the given branch. Type int.

Criterion (optional)

A string to search in names of geography locations. Type string.

IDCriterion (optional)

A string to search in IDs of geography locations. Type string.

Other Parameters

Parameter

Description

ActiveDatasetID (optional)

ID of the active dataset. Type string.

Default: ID of the first available dataset.

compatibility (optional)

Business Analyst Server version the JSON output is compatible with. Type string. Available with Business Analyst Server 10.0.

Default: 9.3.1.

f (optional)

Response format. Type string. Available formats: HTML, JSON, PJSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Array of StdGeographiesReturnedFeature containing the list of IDs and names of features found. In the case of JSON and PJSON response types, the response format depends on the compatibility parameter value.

Remarks

A geography level is selected using the BranchID and Depth parameters. The BranchID specifies a branch of the tree of standard geography levels (e.g. "USbyTracts", "USbyCounties", or "USbyZIP5") and the Depth specifies the geography level depth for the given branch (e.g. the level depth in "USbyZIP5" branch is 0 for whole USA, 1 for States, 2 for Counties, and 3 for ZIPs).

 

The Criterion and IDCriterion parameters specify the criteria for search in the location name and ID fields, respectively. If both criteria are specified, the geography locations are searched in the standard geography level using the logical "and" operation. If both criteria are missing, all locations of the standard geography level are queried. The returned feature list represents the complete list of children of all matching locations from the specified geography level.

Example Usage

The example below searchs for depth-two items of "USbyZIP5" branch having the string "San Diego" in their name and returns all their direct child items. In other words, this example request all ZIP5 codes (depth-three items) belonging to the San Diego County (depth-two item).

 

Request in compatibility with version 9.3.1

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/StdGeographiesFromTree/execute?
ActiveDatasetID=USA_ESRI&
BranchID=USbyZIP5&
Depth=2&
Criterion=San Diego&
compatibility=9.3.1&
f=PJSON

 

Response

{
  "results":
  [
    {
      "Feature":
      [
        {
          "FeatureID":"91901",
          "FeatureName":"Alpine"
        },
        ...
        {
          "FeatureID":"92672",
          "FeatureName":"San Clemente"
        }
      ]
    }
  ],
  "messages":
  [
  ]
}

 

NOTE: The response has been abbreviated where "..." is noted.

 

Request in compatibility with version 10.0

http://localhost/ArcGIS/baserver/REST/services/DefaultMap/BAServer/StdGeographiesFromTree/execute?
ActiveDatasetID=USA_ESRI&
BranchID=USbyZIP5&
Depth=2&
Criterion=San Diego&
compatibility=10.&
f=PJSON

 

Response

{
  "results":
  [
    {
      "paramName":"StdGeographyFeatures",
      "dataType":"BAStdGeographiesFeatures",
      "value":
      [
        {
          "ID":"91901",
          "Name":"Alpine"
        },
        ...
        {
          "ID":"92672",
          "Name":"San Clemente"
        }
      ]
    }
  ],
  "messages":
  [
  ]
}

 

NOTE: The response has been abbreviated where "..." is noted.

 

See Also

Business Analyst Server REST API Reference