Provides information about map layers for extraction.
Object Model
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As ExtractInfo |
Example
The following example prints extract information about feature layers that have an ExtractInfo object. This example assumes an existing MapView object, along with a label control for the output.
C# | Copy Code |
---|
FeatureLayer fLayer = null;
ExtractInfo extractInfo = null;
StringBuilder sbExtractInfo = new StringBuilder();
string extractName;
StringBuilder sbFields = new StringBuilder();
// Get extract information for each layer
foreach (Layer layer in mapView.Layers)
{
fLayer = layer as FeatureLayer;
if (fLayer != null)
{
extractInfo = fLayer.ExtractInfo;
if (extractInfo != null)
{
sbFields.Length = 0;
if (extractInfo.FileName != null && extractInfo.FileName != String.Empty)
extractName = extractInfo.FileName;
else
extractName = fLayer.ID;
if (extractInfo.OutputFields != null)
{
sbFields.Append(", Output fields: ");
foreach (OutputField field in extractInfo.OutputFields)
sbFields.AppendFormat("{0} ({1})", field.Name, field.Alias);
}
// Add layer's information to the string builder
sbExtractInfo.AppendFormat("{0}: clip = {1}, extract file name: {2} {3}<br>", fLayer.Name, extractInfo.ClipFeatures,
extractName, sbFields.ToString());
}
}
}
if (sbExtractInfo.Length > 0)
Label1.Text = sbExtractInfo.ToString();
else
Label1.Text = "No extractable layer available."; |
Visual Basic | Copy Code |
---|
Dim fLayer As FeatureLayer = Nothing
Dim extractInfo As ExtractInfo = Nothing
Dim sbExtractInfo As New StringBuilder()
Dim extractName As String
Dim sbFields As New StringBuilder()
' Get extract information for each layer
For Each layer As Layer In mapView.Layers
If Typeof layer Is FeatureLayer Then
fLayer = CType(layer, FeatureLayer)
extractInfo = fLayer.ExtractInfo
If Not IsNothing(extractInfo) Then
sbFields.Length = 0
If Not IsNothing(extractInfo.FileName) AndAlso _
extractInfo.FileName <> String.Empty Then
extractName = extractInfo.FileName
Else
extractName = fLayer.ID
End If
If Not IsNothing(extractInfo.OutputFields) Then
sbFields.Append(", Output fields: ")
For Each field As OutputField In extractInfo.OutputFields
sbFields.AppendFormat("{0} ({1})", field.Name, field.Alias)
Next
End If
' Add layer's information to the string builder
sbExtractInfo.AppendFormat("{0}: clip = {1}, extract file name: {2} {3}<br>", _
fLayer.Name, extractInfo.ClipFeatures, _
extractName, sbFields.ToString())
End If
End If
Next
If sbExtractInfo.Length > 0 Then
Label1.Text = sbExtractInfo.ToString()
Else
Label1.Text = "No extractable layer available."
End If |
Remarks
Requirements
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family
See Also