ESRI.ArcGIS.ADF.IMS
ExtractInfo Class
Members  Example  See Also 
ESRI.ArcGIS.ADF.IMS.Carto.Layer Namespace : ExtractInfo Class




Provides information about map layers for extraction.

Object Model


Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class ExtractInfo 
Visual Basic (Usage)Copy Code
Dim instance As ExtractInfo
C# 
[SerializableAttribute()]
public class 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 BasicCopy 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

If permitted by the creator of the map service, feature layers in the map may be clipped and downloaded as shapefiles. This object is stored in the FeatureLayer's ExtractInfo property. For more information on extracting map data, see Extractor. Also see ArcIMS Help, under "Using GET_EXTRACT and EXTRACT".

The ExtractInfo provides information on the layer as extracted. These settings are defined by the author of the map service. All properties of ExtractInfo are read-only. To modify the setting, you must change the ArcXML configuration file for the map service.

A known issue is that a layer may be extractable even when the ExtractInfo property of a feature layer is null (Nothing). If the ArcXML configuration file for the map service has at least one layer with the EXTRACT extension tag, then every feature layer will be extractable. Feature layers with the EXTRACT tag in the configuration file will have a valid ExtractInfo object. Feature layers without this tag in the configuration file will have no ExtractInfo object, but can still be extracted. Those layers will use defaults for extracted file name, fields, code page, and clipping of features.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Carto.Layer.ExtractInfo

See Also

© 2010 All Rights Reserved.