Adding an extract extension expand/collapse all
Related Topics

Using GET_EXTRACT and EXTRACT

EXTENSION

EXTRACTPARAMS

expand/collapse item About the extract extension

The extract extension allows you to extract specified layers of an Image Service into a set of shapefiles, yielding one shapefile for each layer. Data can be extracted from shapefiles and ArcSDE vector layers. Raster and acetate layers cannot be extracted.

In order for data extraction to work, an Extract extension must be included with at least one layer in the map configuration file. Note that if one layer in the map configuration file includes the extension, all vector layers will be extracted, even vector layers that do not include the extension.

In the following example, the cities layer contains an extract extension. Within the extension, EXTENSION and EXTRACTPARAMS are required, and OUTPUTFILE and OUTPUTFIELD are optional.

<LAYER type="featureclass" name="US Cities" visible="true" id="35">
  <DATASET name="CITIES" type="point" workspace="shp_ws-2" />
  <SPATIALQUERY where="POPULATION &gt; 100000" subfields="CITY_NAME STATE_NAME POPULATION MALES FEMALES #ID# #SHAPE#" />
  <SIMPLERENDERER>
    <SIMPLEMARKERSYMBOL color="0,255,0" type="star" width="8.0" />
  </SIMPLERENDERER>
  <EXTENSION type="extract" >
    <EXTRACTPARAMS clip="true" >
      <OUTPUTFILE file="us_cities" >
        <OUTPUTFIELD name="CITY_NAME" alias="CITY" />
        <OUTPUTFIELD name="STATE_NAME" alias="STATE" />
      </OUTPUTFILE>
    </EXTRACTPARAMS>
  </EXTENSION>
</LAYER>

EXTENSION : For the EXTENSION type, use "extract".

EXTRACTPARAMS: For EXTRACTPARAMS you can set the optional attribute clip to "true". When clip is set to "true", features are clipped at the extent of the viewer. However, none of a layer's database values are prorated for any clipped features. If clipping is not used, features partially within the envelope are extracted in their entirety. This is the default. You must include EXTRACTPARAMS for each layer you want clipped.

OUTPUTFILE: OUTPFILE allows you to customize the output shapefile name. Two different methods can be used to name extracted shapefiles.

  1. The default method for naming extracted shapefiles is to use the name of each layer's id attribute value. ArcIMS Author always assigns an ID using numbers. If you want to name your shapefile something more meaningful, you can assign a character string to the ID. In the above exampe, the extracted shapefile would be named "35".
  2. The second method is to name a shapefile using OUTPUTFILE. In the example, the layer is named "us_cities".

OUTPUTFIELD: OUTPUTFIELD can be used to set an alias name for a field in the database. For example, in the above example, when the data is extracted for the US Cities layer, the first field name will contain "CITY" instead of "CITY_NAME". One common reason to use this option is field names in shapefile DBF files are limited to 10 characters. Since other databases often allow more than 10 characters, it's possible to end up with two fields in the DBF file with the same name. Aliasing field names using OUTPUTFIELD gets around this problem.

SPATIALQUERY: You can use SPATIALQUERY to limit the list of fields returned with a shapefile. For more information on SPATIALQUERY, see Adding SPATIALQUERY.

For additional information on using the extract extension, see Using GET_EXTRACT and EXTRACT.

Limiting the output zip file size

When data is extracted and placed in zip files, these files have the potential to be very large depending on the number of layers and the number of features in each layer. By default, there is no size limit on zip files. You can limit the maximum file size allowed. For more information, see Changing the maximum output file size for data extraction.

expand/collapse item How to work with the extract extension

expand/collapse item Adding an extract extension

  1. Open your map configuration file in a text or XML editor.
  2. You must add the extract extension to at least one layer. Once the extension is added, all vector layers will be extracted, even if there is no extension for a layer. If you want the layers clipped at the viewable extent, set clip to "true". If you want clipping on each layer, you must include the EXTENSION for those layers.

    <LAYER type="featureclass" name="US Cities" visible="true" id="35">
      <DATASET name="CITIES" type="point" workspace="shp_ws-2" />
      <SIMPLERENDERER>
        <SIMPLEMARKERSYMBOL color="0,255,0" type="star" width="8.0" />
      </SIMPLERENDERER>
      <EXTENSION type="extract" >
        <EXTRACTPARAMS clip="true" >
        </EXTRACTPARAMS>
      </EXTENSION>
    </LAYER>

  3. Set a name for the shapefile for a layer using OUTPUTFILE, if desired. The default name for the shapefile is the layer ID.

      <EXTENSION type="extract" >
      <EXTRACTPARAMS clip="true" >
        <OUTPUTFILE file="us_cities" >
        </OUTPUTFILE>
      </EXTRACTPARAMS>
    </EXTENSION>
    </LAYER>

  4. Set alias names for fields using OUTPUTFIELD, if desired.

      <EXTENSION type="extract" >
      <EXTRACTPARAMS clip="true" >
        <OUTPUTFILE file="us_cities" >
          <OUTPUTFIELD name="CITY_NAME" alias="CITY" />
          <OUTPUTFIELD name="STATE_NAME" alias="STATE" />
        </OUTPUTFILE>
      </EXTRACTPARAMS>
    </EXTENSION>
    </LAYER>

  5. Limit which fields to include in the shapefile using SPATIALQUERY, if desired. Use the actual field names and not the alias names.

    <SPATIALQUERY where="POPULATION &gt; 100000" subfields="CITY_NAME STATE_NAME POPULATION MALES FEMALES #ID# #SHAPE#" />

    If you include SPATIALQUERY in your map configuration file, you should not open and save your file in Author.

  6. Save your changes to the map configuration file.

Unless you are using SPATIALQUERY, you can continue to open and save your map configuration file in Author once you have added an extract extension.



Search code: @config_extract