FRAMES | NO FRAMES
OpenSegProfile Method

Returns XML serialized segmentation profile.

Availability: Business Analyst Server.

string OpenSegProfile ( 
    esriFolderItem  Item 
);

Parameter Description
Item Folder item containing a segmentation profile. Type esriFolderItem.

Returns

Variable of type String containing XML serialized segmentation profile.

Usage Tips

Examples

The example below retrieves an existing segmentation profile item from the Business Analyst Server Repository. In order to demonstrate this method, a market segmentation profile is created and saved to the repository. The OpenSegProfile method is then used to retrieve the profile.

C#
// Instantiate the BAServerHelper class to access analysis methods
BAServerHelper baServerHelper = new BAServerHelper();
baServerHelper.ActiveDatasetID = "USA_ESRI"; // Optional parameter
baServerHelper.IsFullErrorMessage = true;    // Default is false
 
// ========= STEP 1: Create a boundary layer from standard geographies
 
// The San Francisco County study area is selected as the boundary.
StandardLevelsOfGeographyParameters geographyParameters = new StandardLevelsOfGeographyParameters();
 
// Set specific analysis parameters
geographyParameters.GeographyFeaturesBehavior = esriStdGeographyType.esriStdGeographyTypeFirst;
geographyParameters.GeographyIDs = new string[] { "06075" }; // FIPS ID code for San Francisco County
geographyParameters.GeographyLevelID = "US.Counties";
 
// Set other parameters
RenderingParameters imageOptions = null;
TaskOutputType[] outputOptions = new TaskOutputType[] { TaskOutputType.GetFeatureClass };
esriFolderItem outputLayer = null;
esriFolderItem outputReport = null;
 
TaskResultOutput geographyResult =
    baServerHelper.StandardLevelsOfGeography(geographyParameters, imageOptions, outputOptions, outputLayer, outputReport);
 
DataLayer boundaryLayer = new DataLayer();
boundaryLayer.RecordSet = geographyResult.RecordSet;
 
// ========= STEP 2: Create a segmentation profile by the boundary layer
 
ProfileByAreaSummationParameters parameters = new ProfileByAreaSummationParameters();
 
// Set specific analysis parameters
parameters.AreaIDField = "AREA_ID";
parameters.Boundaries = boundaryLayer;
parameters.SegmentationBase = "Total Households";
 
// Set other parameters
// In general, a non-null esriFolderItem is specified to save a newly-created
// item to the server-side repository or to reference an existing item in it.
esriFolderItem outputItem = new esriFolderItem();
outputItem.folderType = esriFolderType.esriFolderSegProfiles;
outputItem.itemName = "segProfile_OpenSegProfile";
outputItem.projectName = "Default Project";
outputItem.workspaceName = "Default Workspace";
 
baServerHelper.ProfileByAreaSummation(parameters, outputItem);
 
// ========= STEP 3: Retrieve the segmentation profile residing in the repository
 
string result = baServerHelper.OpenSegProfile(outputItem);
 
ProfileData segProfile = new ProfileData();
segProfile.Description = result;

See Also