Touchstone 11.0 API Reference
GetHazardAnalysisResults Method
Example 


Air.Services.Proxy Assembly > (Global) Namespace > HazardAnalysisServiceClient Class : GetHazardAnalysisResults Method
Contains a GetHazardAnalysisResultsRequest that identifies the Touchstone-generated Analysis Sequential Identifier (SID) of the Hazard Analysis for which you want to view the results, along with the desired Paging Info, as well as the associated Business Unit SID and SQL Instance SID.
Retrieves Touchstone® Hazard Analysis results.

The results of the Hazard Analysis include Location information, as well as the Earthquake, Hurricane, Flood, Severe Thunderstorm, and Terrorism hazard profiles, if requested.

Syntax
Public Function GetHazardAnalysisResults( _
   ByVal request As GetHazardAnalysisResultsRequest _
) As GetHazardAnalysisResultsResponse
Dim instance As HazardAnalysisServiceClient
Dim request As GetHazardAnalysisResultsRequest
Dim value As GetHazardAnalysisResultsResponse
 
value = instance.GetHazardAnalysisResults(request)

Parameters

request
Contains a GetHazardAnalysisResultsRequest that identifies the Touchstone-generated Analysis Sequential Identifier (SID) of the Hazard Analysis for which you want to view the results, along with the desired Paging Info, as well as the associated Business Unit SID and SQL Instance SID.

Return Value

A GetHazardAnalysisResultsResponse containing the Hazard Analysis results, as well as information describing the actual paging layout of the analysis results.
Remarks
To find the Business Unit SID to pass into this method, call the GetBusinessUnits() method.

To find the SQL Instance SID to pass into this method, call the GetSqlInstances() method.

To find the Analysis SID to pass into this method, call the GetActivity() method. The Analysis SID is stored in the GetActivityResponse.Activity.AnalysisSid property.

Example
The following example shows how to retrieve Touchstone Hazard Analysis results using the GetHazardAnalysisResults() method:
using System;
using AIR.Services.Common.Data;
using AIR.Services.HazardAnalysis.Api;
using AIR.Services.HazardAnalysis.Data;
            
class SnippetGetHazardAnalysisResultsRequest
{
    private static void GetHazardAnalysisResults(int businessUnitSid, int sqlInstanceSid, int analysisSid)
    {
        HazardAnalysisServiceClient hazardClient = new HazardAnalysisServiceClient();
        GetHazardAnalysisResultsRequest request = new GetHazardAnalysisResultsRequest();
        request.BusinessUnitSid = businessUnitSid;
        request.SqlInstanceSid = sqlInstanceSid;
        request.AnalysisSid = analysisSid;
            
        /// Implement logic to loop through all the records.
        int page = 1; int pageSize = 20; 
        request.PagingInfo = new PagingInfo { PageNumber = page, PageSize = pageSize };
            
        GetHazardAnalysisResultsResponse response = hazardClient.GetHazardAnalysisResults(request);
            
        if (response.Status.Code == StatusCode.Success)
        {
            foreach (HazardAnalysisResult result in response.Results)
            {
                ///  Output some of the values from the Earthquake, Tropical Cyclone, and Flood hazard profiles. 
                ///  The response also returns many other profile details. 
            
                Console.WriteLine("------------------   Location: " + result.LocationInfo.Address + "  -----------------------");
                Console.WriteLine("  --- Earthquake Profile:  -----------------------");
                Console.WriteLine("Average Annual Loss: " + result.EarthquakeResults.AverageAnnualLoss);
                Console.WriteLine("Distance to Nearest Fault: " + result.EarthquakeResults.DistanceToNearestFault);
                Console.WriteLine("  --- Tropical Cyclone Profile:  -----------------------");
                Console.WriteLine("Average Annual Loss: " + result.HurricaneResults.AverageAnnualLoss);
                Console.WriteLine("Distance to Effective Coast: " + result.HurricaneResults.DistanceToEffectiveCoast);
                Console.WriteLine("  --- Flood Profile:  -----------------------");
                Console.WriteLine("Flood Zone: " + result.FloodResults.FloodZone);
                Console.WriteLine("Distance to 500 Year Flood Plain: " + result.FloodResults.ShortestDistanceTo500YearFloodPlain);
            }
        }
    }
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

HazardAnalysisServiceClient Class
HazardAnalysisServiceClient Members