Related Topics |
---|
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 > 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.
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.
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.
<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> |
<EXTENSION type="extract" > <EXTRACTPARAMS clip="true" > <OUTPUTFILE file="us_cities" > </OUTPUTFILE> </EXTRACTPARAMS> </EXTENSION> </LAYER> |
<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> |
<SPATIALQUERY where="POPULATION > 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.
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.