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




AcetateLayerObject used for extracting data from a MapService.

Syntax

Visual Basic (Declaration) 
<SerializableAttribute()>
Public Class Extractor 
Visual Basic (Usage)Copy Code
Dim instance As Extractor
C# 
[SerializableAttribute()]
public class Extractor 

Example

The following example creates an Extractor object, temporarily modifies layer visibility and map extent, then extracts the map.
C#Copy Code
// Extract map from existing MapView 

Extractor mapExtractor = New Extractor(mapView); 

  

// Set map extent temporarily For extract 

Envelope currentEnvelope = mapView.Extent; 

mapView.Extent = New Envelope(30, 40, 50, 60); 

  

// Turn a layer off so won't extract 

mapView.Layers[0].Visible = False; 

  

// Extract the map 

Uri extractUri = mapExtractor.Extract(); 

HyperLink1.Text = "Click here to download the extracted map data."; 

HyperLink1.NavigateUrl = extractUri.AbsoluteUri; 

  

// Restore previous map settings 

mapView.Layers[0].Visible = True; 

mapView.Extent = currentEnvelope; 

    
Visual BasicCopy Code
' Extract map from existing MapView

Dim mapExtractor As New Extractor(mapView)



' Set map extent temporarily for extract

Dim currentEnvelope As Envelope = mapView.Extent

mapView.Extent = New Envelope(30, 40, 50, 60)



' Turn a layer off so won't extract

mapView.Layers[0].Visible = False



' Extract the map

Dim extractUri As Uri = mapExtractor.Extract()

HyperLink1.Text = "Click here to download the extracted map data."

HyperLink1.NavigateUrl = extractUri.AbsoluteUri



' Restore previous map settings

mapView.Layers[0].Visible = True

mapView.Extent = currentEnvelope

Remarks

Map layers may be extracted to allow users to download sections of the map data. Layers are extracted as shapefiles, with one shapefile per layer. Only vector layers can be extracted.

All layers are packaged into a zip file when the extract operation is performed. The shapefiles in the zip file will be named using the ID of the layers, not the Name. Note that services created in Author use integers for layer IDs, starting with zero. If necessary, modify layer IDs in your map service by modifying the AXL file before performing extract. Alternatively, create aliases with OUTPUTFILE tags within the extract parameters. See the ArcXML Guide in the ArcIMS Help for details.

Do not change the IDs of layers in the Web application; doing so will cause the Visible setting to be ignored, so that the layer is extracted based on its default visibility in the map service.

The Extract() methods return a Uri with the location of the zip file, which can be used to allow download by the user.

For extract to be enabled, at least one layer in the map service configuration ArcXML file must contain an EXTENSION tag with the extract type. If any feature layer in the configuration file has the extract extension, then all feature layers will be extractable.

If no layers are set to be extractable in the map configuration, an error with this message will be thrown if the Extract() method is called:

[ERR0618] Unknown ArcIMS service <service name>

For details on setting up extraction in the map service, see ArcIMS Help in the ArcXML Guide under EXTRACT.

Extract is not supported with ArcMap Server image services.

When an Extract method is called, it uses the current map properties. The following may be modified, perhaps temporarily, before extracting data in order to extract the appropriate data:

  • Map extent
  • Spatial reference
  • Layer visibility - only layers where Visible is true are extracted
  • Scale dependency of layers - image size properties (Height and Width in ImageDescriptor) determine the visibility of scale-dependent layers
  • Filters - filters on map layers in the map service are respected when extracting
  • Output path - physical and virtual directories, as well as file name, can be set for extract. See the MapView's ImageDescriptor.

Dynamic layers can be extracted. Acetate and highlight layers will not be extracted.

Inheritance Hierarchy

System.Object
   ESRI.ArcGIS.ADF.IMS.Carto.Extractor

See Also

© 2010 All Rights Reserved.