Exercise 2: Adding a new feature layer definition based on an existing Parcel layer
Creating multiple feature layers based on a single feature table in an AXF
In this exercise while in ArcPad Studio, you will add a new feature layer to the existing parcel.axf file. This new layer will be based on the same data as the existing Parcel feature layer. The ability to have multiple feature layers based on single feature tables allows users to customize how data is viewed in different situations without duplicating data. You will also add a filter query to this new feature layer (an Extensible Markup Language [XML] element called <QUERY>) so that only office parcels are displayed on the map in ArcPad.
Creating a feature layer and changing the layer icon for the new layer
- Right-click the Parcel feature layer or Parcel feature table. Click Create New Layer. See the following screen shot:
- Name the new layer Office.
- Right-click the Office layer and click Set Layer Icon. See the following screen shot:
- Navigate to the sample Layer Icons folder. On Windows XP this is usually C:\Documents and Settings\All Users\Documents\ArcPad\Samples\Layer Icons, on Windows 7 this is usually C:\Users\Public\Documents\ArcPad\Samples\Layer Icons. Choose your prefered icon and click Open. ArcPad Studio automatically updates the ArcPad Exchange File (AXF) tree view window. See the following screen shot:
Creating a query for the Parcel layer
- Right-click [ST_PARCEL_ZONECODE] under the Data Tables folder, then click Show Data. See the following screen shot:
- After you click Show Data, the SQL command window appears. Examine the fields of the Parcel feature table. Based on the ZoneCode values, you can choose to only show a subset of the parcels on the map. For example, in this project you want to display only parcels in Category 5 (Office). See the following screen shot:
- Right-click the Office layer and click Edit Layer Definition. The Riverside_mdb.axf:Office layer definition window appears.
- Right-click <Layer> Office in the Riverside_mdb.axf:Office layer definition window and click Add Element. The Add Element dialog box appears. See the following screen shot:
- Click OK to close the dialog box.
- Right-click the <QUERY> element and click Add Attribute. The Attribute dialog box appears. See the following screen shot:
- Type where in the Name text box and zonecode = 5 in the Value text box. Click OK to close the dialog box.
- Click the Toggle between source and tree view button on the toolbar. See the following screen shot:
- Save the layer defintion before you close the XML source view window. ArcPad Studio displays Office: Layer definition updated in the AXF tree view window.
- In ArcPad, click the Add Layer button. The Add Layer(s) dialog box appears. Click the folder image to navigate to the location of your saved tutorial data.
- Select the Office Parcel layer and the Streets.shp shapefile. See the following screen shot:
- Click OK. In ArcPad, the parcels that have the zone defined as Office displays on the map. See the following screen shot:
- Click the Table of Contents button in ArcPad. The Table of Contents dialog box appears. See the following screen shot:
- Double-click the Office layer. The Layer Properties dialog box appears. See the following screen shot:
- The query phrase zonecode = 5 is also saved under the Filter tab. Click OK to close the dialog box.