FRAMES | NO FRAMES
StdGeographiesByAttributes Method

Query the Business Analyst Online geographic boundary data layers by string.

StdGeographiesReturnedFeature[] StdGeographiesByAttributes ( 
    StdGeographiesByAttributesParams  Parameters 
);

Parameter Description
Parameters Geographic search parameters. Type StdGeographiesByAttributesParams.

Returns

Variable of type StdGeographiesReturnedFeature[].

The Standard Geographies by Attributes service enables a string-based query on any available Business Analyst Online standard geography/administrative boundary data layer. The result of this service is an array of StdGeographiesReturnedFeature objects 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.

 

Remarks

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 Business Analyst Online 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 Business Analyst Online data layers are often identified by standardized FIPS codes. Alternatively, they may be identified in the Business Analyst Online 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


 

Examples

Example 1: Retrieve the names and IDs of standard geography features in a given Business Analyst standard geography data layer based on a string-based query. (See Get Standard Geography Levels to lookup the IDs of the data layers accessible from your Business Analyst Online API subscription account.)

Notes: Example 1 demonstrates the use of the BAOReportHelper class. For information about code that consumes the BAOReport proxy class, (generated from the WSDL ) without leveraging the BAOReportHelper class, please refer to the BAOReport vs BAOReportHelper comparison chart and see the additional Examples below.
Download complete source code as Visual Studio solution to immediately execute samples. (See StandardGeographiesByAttributesExamples.standardGeographiesByAttributesExample1 in source.)

Example (1) Code
C#
// Authentication: Uses BAOReportHelper class for token management.

// Instantiate BAOReportHelper class
string tokenServiceUrl = "https://baoapi.esri.com/bawebservices/rest/authentication";

// Business Analyst Online API Sample credentials.
// NOTE: These credentials are associated with an 
// account which constrains analysis to the
// two ZIP codes in Redlands, CA.
string username = "BAOAPISAMPLE"; // Substitute user name here
string password = "baoapisample"; // Substitute password here

ITokenProvider tokenProvider = new HTTPTokenProvider(tokenServiceUrl, username, password);
BAOReportHelper baoReportHelper = new BAOReportHelper(tokenProvider);

// Specify parameters of StdGeographiesByAttributes task
StdGeographiesByAttributesParams parameters = new StdGeographiesByAttributesParams();
parameters.GeoLevelID = "US.ZIP5";
parameters.SearchString = "065";

// Execute the task
StdGeographiesReturnedFeature[] locations = baoReportHelper.StdGeographiesByAttributes(parameters);

Example (1) Code
VB.NET
' Authentication: Uses BAOReportHelper class for token management.

' Instantiate BAOReportHelper class
Dim tokenServiceUrl As String = "https://baoapi.esri.com/bawebservices/rest/authentication"

' Business Analyst Online API Sample credentials.
' NOTE: These credentials are associated with an 
' account which constrains analysis to the
' two ZIP codes in Redlands, CA.
Dim username As String = "BAOAPISAMPLE"
' Substitute user name here
Dim password As String = "baoapisample"
' Substitute password here
Dim tokenProvider As ITokenProvider = New HTTPTokenProvider(tokenServiceUrl, username, password)
Dim baoReportHelper As New BAOReportHelper(tokenProvider)

' Specify parameters of StdGeographiesByAttributes task
Dim parameters As New StdGeographiesByAttributesParams()
parameters.GeoLevelID = "US.ZIP5"
parameters.SearchString = "065"

' Execute the task
Dim locations As StdGeographiesReturnedFeature() = baoReportHelper.StdGeographiesByAttributes(parameters)

 

Example 2: Obtain a list of all USPS ZIP codes names or IDs containing the string"065".

Notes: Example 2 demonstrates code which consumes the BAOReport proxy class (generated from the WSDL ) without leveraging the BAOReportHelper class. Please view Example 1 above for additional information about the BAOReportHelper class.

Download complete source code as Visual Studio solution to immediately execute samples. (See StandardGeographiesByAttributesExamples.standardGeographiesByAttributesExample2 in source.)

Example (2) Code
C#
// Authentication: Uses Authentication proxy class to generate token.

// Business Analyst Online API Sample credentials.
// NOTE: These credentials are associated with an 
// account which constrains analysis to the
// two ZIP codes in Redlands, CA.
string username = "BAOAPISAMPLE"; // Substitute user name here
string password = "baoapisample"; // Substitute password here

Authentication auth = new Authentication();
string token = auth.getToken(username, password);

// Specify parameters of StdGeographiesByAttributes task
StdGeographiesByAttributesParams parameters = new StdGeographiesByAttributesParams();
parameters.GeoLevelID = "US.ZIP5";
parameters.SearchString = "065";
// Associate the token
parameters.token = token;

// Instantiate the BAOReport proxy object to submit the
// request
BAOReport baoReportProxy = new BAOReport();

// Execute the task
StdGeographiesReturnedFeature[] locations = baoReportProxy.StdGeographiesByAttributes(parameters);

Example (2) Code
VB.NET
' Authentication: Uses Authentication proxy class to generate token.

' Business Analyst Online API Sample credentials.
' NOTE: These credentials are associated with an 
' account which constrains analysis to the
' two ZIP codes in Redlands, CA.
Dim username As String = "BAOAPISAMPLE"
' Substitute user name here
Dim password As String = "baoapisample"
' Substitute password here
Dim auth As New Authentication()
Dim token As String = auth.getToken(username, password)

' Specify parameters of StdGeographiesByAttributes task
Dim parameters As New StdGeographiesByAttributesParams()
parameters.GeoLevelID = "US.ZIP5"
parameters.SearchString = "065"
' Associate the token
parameters.token = token

' Instantiate the BAOReport proxy object to submit the
' request
Dim baoReportProxy As New BAOReport()

' Execute the task
Dim locations As StdGeographiesReturnedFeature() = baoReportProxy.StdGeographiesByAttributes(parameters)

 

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

Notes: Example 3 demonstrates code which consumes the BAOReport proxy class (generated from the WSDL ) without leveraging the BAOReportHelper class. Please view Example 1 above for additional information about the BAOReportHelper class.

Download complete source code as Visual Studio solution to immediately execute samples. (See StandardGeographiesByAttributesExamples.standardGeographiesByAttributesExample3 in source.)

Example (3) Code
C#
// Authentication: Uses Authentication proxy class to generate token.

// Business Analyst Online API Sample credentials.
// NOTE: These credentials are associated with an 
// account which constrains analysis to the
// two ZIP codes in Redlands, CA.
string username = "BAOAPISAMPLE"; // Substitute user name here
string password = "baoapisample"; // Substitute password here

Authentication auth = new Authentication();
string token = auth.getToken(username, password);

// Specify parameters of StdGeographiesByAttributes task
StdGeographiesByAttributesParams parameters = new StdGeographiesByAttributesParams();
parameters.GeoLevelID = "US.Counties";
parameters.SearchString = "san bernardino county";
// Associate the token
parameters.token = token;

// Instantiate the BAOReport proxy object to submit the
// request
BAOReport baoReportProxy = new BAOReport();

// Execute the task
StdGeographiesReturnedFeature[] locations = baoReportProxy.StdGeographiesByAttributes(parameters);

Example (3) Code
VB.NET
' Authentication: Uses Authentication proxy class to generate token.

' Business Analyst Online API Sample credentials.
' NOTE: These credentials are associated with an 
' account which constrains analysis to the
' two ZIP codes in Redlands, CA.
Dim username As String = "BAOAPISAMPLE"
' Substitute user name here
Dim password As String = "baoapisample"
' Substitute password here
Dim auth As New Authentication()
Dim token As String = auth.getToken(username, password)

' Specify parameters of StdGeographiesByAttributes task
Dim parameters As New StdGeographiesByAttributesParams()
parameters.GeoLevelID = "US.Counties"
parameters.SearchString = "san bernardino county"
' Associate the token
parameters.token = token

' Instantiate the BAOReport proxy object to submit the
' request
Dim baoReportProxy As New BAOReport()

' Execute the task
Dim locations As StdGeographiesReturnedFeature() = baoReportProxy.StdGeographiesByAttributes(parameters)

See Also