Standard Geographies from Extent Service
URL http://baoapi.esri.com/rest/report/StdGeographiesFromExtent

Query the geographic boundary data layers by spatial extent.

Output

The Standard Geographies from Extent service enables a spatial 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 spatial query on the data layer. These feature/area IDs can be used to specify specific geographic areas in subsequent analysis.

Description

The Standard Geographies from Extent service produces a list of feature/area names and their corresponding IDs based on the result of a spatial 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 from Extent include the following:

Usage Tips

You can provide arguments to the Standard Geographies from Extent utility service as defined in the parameters table below.

Parameters

Parameter Details
GeoLevelID (Required) Description: The 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.

AnalysisExtent (Required) Description: The spatial/geographic extent on which to perform the query. This parameter expects a value of type ExtentData. ExtentData can consist of either ExtentCoordinates or a 2-D Geometry of at least three points specifying an area.

Default: null

Syntax: AnalysisExtent=<ExtentData>

Syntax (1) (ExtentData as ExtentCoordinates):

{
  "Coordinates": <ExtentCoordinates>
}

Example (1) (ExtentData as ExtentCoordinates):
{
  "Coordinates": {
    "XMin": -84.020313,
    "XMax": -82.457595,
    "YMin": 41.983507,
    "YMax": 41.983507,
    "CoordinateSystem": 4326
  }
}

Notes: For a list of valid coordinate system values, see Projected coordinate Systems and Geographic coordinate Systems.

ExtentCoordinates define a rectangular extent "envelope" and must fall within the area covered by the data layers.




Syntax (2) (ExtentData as Polygon):

{
  "Extent": <Polygon>
}

Example (2) (ExtentData as Polygon):
{
  "Extent": {
    "rings": [  
      [ 
        [-82.457595,41.983507],
        [-82.457595,42.885916],
        [-83.733139,43.240413],
        [-84.949773,42.940422],
        [-84.943043,42.554298],
        [-84.020313,41.983507],
        [-82.457595,41.983507]
      ]
    ],
    "spatialReference": {"wkid" : 4326}
  }
}

Notes: If a Polygon type of Geometry is used to define ExtentData, it should only consist of a single ring. A polygon ring's last coordinate pair should be "connected" to the first coordinate pair to "close" off the polygon shape. Also, per convention, coordinate pairs for the polygon vertices should be listed in counter-clockwise "draw order" to define an area inside the perimeter formed by the vertices.

For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

The area defined by the 2-D Geometry must fall within the area covered by the data layers.




Syntax (3) (ExtentData as Envelope):

{
  "Extent": <Envelope>
}

Syntax (3) (ExtentData as Envelope):
{
  "Extent": {
    "xmin": -84.020313,
    "ymin": 41.983507, 
    "xmax": -82.457595,
    "ymax": 42.885916,
    "SpatialReference": {"wkid": 4326}
  }
}

Notes: For a list of valid WKID values, see Projected coordinate Systems and Geographic coordinate Systems.

The area defined by the 2-D Geometry must fall within the area covered by the Services analysis data set.


SpatialRelationship (Required) Description: The spatial selection method used with the AnalysisExtent to define the area of analysis. This parameter expects an enumeration value of type esriSpatialRelEnum.

Default: null

Syntax: SpatialRelationship=<esriSpatialRelEnum>

Example: SpatialRelationship=esriSpatialRelIntersects

Notes: For more detailed information regarding the spatial relationship options, see this link.

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 U.S. Census tracts which intersect an extent Envelope.

Example (1) Input Extent Envelope Rendered with the ArcGIS API for JavaScript

Example 1 Extent Envelope

Request Example (1)

http://baoapi.esri.com/rest/report/StdGeographiesFromExtent?
f=PJSON&
AnalysisExtent={"Extent":{"xmin":-117.171502,"ymin":34.052656,"xmax":-117.154933,"ymax":34.060632,
"SpatialReference":{"wkid":4326}}}&
GeoLevelID=US.Tracts&
SpatialRelationship=esriSpatialRelOverlaps&
Token=ABC123
(Example uses limited demo account)

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



Example 2: Obtain a list of all ZIP codes intersecting a custom Polygon.

Example (2) Input Extent Polygon Rendered with the ArcGIS API for JavaScript

Example 2 Extent Polygon

Request Example (2)

http://baoapi.esri.com/rest/report/StdGeographiesFromExtent?
f=PJSON&
AnalysisExtent={"Extent":{"rings":[[[-117.150177,34.062935],[-117.171502,34.060631],[-117.185412,34.063170],
[-117.186903,34.043610],[-117.160785,34.042416],[-117.154932,34.052655],[-117.150177,34.062935]]],
"spatialReference":{"wkid":4326}}}&
GeoLevelID=US.ZIP5&
SpatialRelationship=esriSpatialRelIntersects&
Token=ABC123
(Example uses limited demo account)

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


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": "06071008402",
          "FeatureName": "060710084.02"
        },
        {
          "FeatureID": "06071008403",
          "FeatureName": "060710084.03"
        },
        {
          "FeatureID": "06071008404",
          "FeatureName": "060710084.04"
        }
      ]
    }
  ]
}

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



JSON Response Example (2)

{
  "results": [
    {
      "Feature": [
        {
          "FeatureID": "92373",
          "FeatureName": "Redlands"
        },
        {
          "FeatureID": "92374",
          "FeatureName": "Redlands"
        }
      ]
    }
  ]
}

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

See Also

Drive Time

Get Standard Geography Levels

Get Token

Simple Rings

Standard Geographies by Attributes

Summary Reports