arcpad forms

Upload: lariojaxxx

Post on 06-Apr-2018

259 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/2/2019 Arcpad Forms

    1/27

    An introduction to creating forms for ArcPad

    This guide introduces the basic concepts of producing data collection formsusing ArcPad Studio (Application Builder) and the Forms Wizard in ArcPad.A number of assumptions have been made.

    ArcGis v.8.2, ArcPad v.6.0 or v.6.0.1 and ArcPad Studio v.6.0 areinstalled on your desktop/laptop PC and ArcPad v.6.0 or v.6.0.1 areinstalled on your PDA.

    Familiarity in using ArcGis, including Arc toolbox and Arc catalogue arerequired as is a basic familiarity of ArcPad

    Help regarding ArcGis can be obtained from ITS, and a number of people in the

    department are familiar with using ArcGis, ArcPad and ArcPad Studio (seeappendix).

    Contents

    Introduction 1Getting started 1Creating shape files 1Attribute tables 4DBF files 7Creating forms in ArcPad Studio 8Creating forms using Form Wizard 19Appendix 27

  • 8/2/2019 Arcpad Forms

    2/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    2

    IntroductionThe use of GPS and field based GIS mapping tools provides a relatively quick

    and accurate means of capturing and visualising spatial data. Advances in bothPDAs and GPS, combined with field-based GIS software such as ArcPad nowprovides a viable GIS and GPS based data collection methodology for field

    geologists. To speed the data capture work flow further it is possible to create a setof data collection forms using ArcPad Studio and or the form wizard in ArcPad (NBthis requires version 6.0.1 of ArcPad and the form wizard applet, both are availablefree for registered users from the ESRI web site . See appendix).

    These instructions will guide you through the process of creating forms andinstalling them onto your PDA

    Getting started

    Creating a form requires the completion of several important intermediatestages. It is therefore, worthwhile spending some time planning what data is to becollected as this will dictate a number of factors such as the shape files required,

    coordinate systems, fields in attribute tables, dbf files and the layout of the form itself.

    Creating shape filesBefore a form can be created it must be associated with a particular shape file

    e.g. bedding. If no such shape file exists it will have to be created. This is done usingArcCatalogue. We will create a shapefile called Bedding which will be used duringthe rest of this exercise.

    1. Open ArcCatalogue (this can be done via ArcMap or opened independently).2. Select File | New | Shapefile The Create New Shape File dialogue box

    appears.3. In Name: enter Bedding.4. From the Feature Type drop down box select the feature type i.e. Point, Line,

    Polygon or Multipoint. In this case select Point

    5. To assign a coordinate system to the shapefile click Edit This will bring upthe Spatial Reference Properties dialogue box. Click on select.

  • 8/2/2019 Arcpad Forms

    3/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    3

    6. Depending on which coordinate system you wish to use, open the requiredfolder and select the coordinate system and click Add. then OK. The CreateNew Shapefile dialogue box should now look something like this. With theselected coordinate system shown in the Description area of the box.

    7. The new shapefile Bedding.shp is now shown in the ArcCatalogue window.

    Shapefiles arent single files but come with a lot of extra baggage. Use Windows

  • 8/2/2019 Arcpad Forms

    4/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    4

    Explorer to navigate to the folder where your shape file is stored. You will see thatalong with the Bedding.shp file there are three others.

    Bedding.prj is the coordinate projection file (it tells ArcGis/ArcPad what coordinatesystem to use). Bedding.dbf is the attribute table (see below) and the Bedding.shxfile links the .dbf and .shp files. It is important to keep all these related files togetherotherwise ArcGis and ArcPad cannot open the shapefile.

    Attribute TablesWhen a shape file is created an associated attribute table is also created (e.g.

    Bedding.dbf). The attribute table can be viewed in 2 ways:1. Open ArcCatalogue select the shapefile and double click on it. The shapefile

    properties dialogue box will appear.

    2. Alternatively open ArcMap and add the shapefile. In the table of contents

    (TOC) right click on the file and select open attribute table. The following tablewill appear.

  • 8/2/2019 Arcpad Forms

    5/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    5

    By default three fields are formed within the attribute table when the shapefile iscreated. However, additional fields can be added. The method differs slightlydepending on whether the editing is done within ArcCatalogue or ArcMap. Themethod described here is for editing within ArcMap.

    It is important to note at this stage that the fields available in the form aredependant on the fields present in the attribute table. Therefore, you should decideon all the fields you are likely to require as it is difficult to add them at a later stage.Fields in the attribute table do not need to be used in the form, but any field you wishto use must be in the attribute table. For example, if we want to record the followingbedding data in the field:

    Formation Strike Dip

    Dip direction Bed thickness

    We need to add a field to the attributes table for each of these characteristics.1. Open the attribute table you wish to edit2. Click Options | Add Field and the Add Field dialogue box will appear.

    3. In Name text box type Formation4. Click Type and select Text

  • 8/2/2019 Arcpad Forms

    6/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    6

    5. In Field Properties box indicate the maximum number of characters you wantto be able to enter into the field. In this case enter 15 (this includes spaces upto a maximum of 50). The default is 50. Reducing the number of charactersalso reduces the width of the column in the attributes file. An importantconsideration if you are adding several text fields as not all the fields may bevisible without scrolling.

    6. Click OK7. Add a date field. In the Name text box type Date_you cannot call it Date as

    this is also the name of a Field Type.8. Add a number field. There are several number Field Types to choose from.

    The safest option is to choose Float. In the Name text box type Strike.

    9. In Field Properties there are two selection boxes: Precision and Scale.

    Precision defines the number of integers, so in the case of Strike this shouldbe set to 3. Scale defines the number of decimal places, in this case leave thisas 0.

    10. Click OK11. Continue like this until you have added all the fields required. It is useful to add

    another field such as Other; which will allow for brief notes to be made.Note:

    No two fields can have the same name Field names cannot contain spaces and must be a maximum of 10 characters

    12. Fields cannot be edited once they are created. If a mistake is made or youwish to modify a field the existing field must be deleted.

    13. Right click the field header to view a list of options, select delete field and clickon OK.

    Once the attribute table has been edited close it down and exit ArcMap. There is noneed to save the untitled map.

  • 8/2/2019 Arcpad Forms

    7/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    7

    Dbf FilesIt is possible to create forms that use drop down pick lists that contain data that isused frequently or is time consuming to type in. The text or numbers that you wish todisplay in a pick box need to be in a dbf file. These can be created in Excel, Accessor some other spreadsheet/database application and saved as a dbf file.

    Each file should consist of two columns as shown below.

    You need to create four dbf files for use later on in the exercise;

    forname.dbf. Lay out as shown above and use the same names strikevalues.dbf. The Value field should range from 1 362 and the strike field

    should range from 1-360 plus 999. (ArcGis uses the Right Hand Rule of

    recording strike and dip i.e. dip direction is always recorded in a clockwisedirection relative to strike).

    dip.dbf. The Value field should range from1 92 and the Dip field from 0 90plus 99

    dip_dir.dbf The Value field should range from 1-9 and the Direction fieldshould include: N, S, E, W, NE, NW, SE, SW, and Unknown

    These files should be saved on your root drive (see below).

    In some circumstances no data may be available for a certain field at aparticular location. By default a zero or null value will be recorded. In these instancesit is advisable to be able to record an Unknown or a number that is easily

    distinguished e.g. in the case of Strike, 999. This means that these values can beeasily filtered out during statistical analysis.

    One of the peculiarities of the Arc family of applications is the need to havesome files in a root directory i.e. not within a folder or sub-folder. This only appears tobe necessary for certain operations, which once undertaken the files can then bestored in folders. If you experience problems with certain operations using Arcsoftware this is often the cause. Therefore, to avoid this problem it is recommendedthat, at least initially shape files and dbf files are held on the root drive of your PC.

  • 8/2/2019 Arcpad Forms

    8/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    8

    Creating forms using ArcPad Studio

    1. Open ArcPad Studio and click the New Layer Definition button on thetoolbar.

    2. Navigate to the file Bedding.shp.

    3. Click the Open button. A new layer definition file is created with the root element and child element.

    4. Double-click in the Tree View to set the properties of the layerdefinition file.

    5. Type Bedding in the Name text box and click OK.6. Notice the name attribute is added to the element in the Tree View.

  • 8/2/2019 Arcpad Forms

    9/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    9

    7. Click the Save button on the toolbar to save the layer definition file. In general,its a good idea to save your file periodically while editing, just in casesomething unexpected happens.

    Create an edit form

    8. Click the Forms button on the toolbar. This opens the Forms dialog box,which displays a list of all the forms defined in the layer definition file.

    9. Click the EDITFORM button.10. Click the Form menu and click Form Properties.

  • 8/2/2019 Arcpad Forms

    10/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    10

    11. The Form Properties dialog box is displayed. Type Bedding in the Captiontext box. Do not change any of the other default values. Ensure that all thecheck boxes are filled.

    12. Click OK. Notice the form caption changes to Bedding

    If required it is possible to add pages to a form. Simply click on the Page menu andclick Add Page.

    13. To name a page, click the Page menu and click Page Properties, the Pageproperties dialogue box will appear.

    14. Type bedinfopage in the Name text box.15. Type Bedding Data in the Caption text box

  • 8/2/2019 Arcpad Forms

    11/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    11

    16. Click OK17. Your form should now look like this

    Adding controls to the form

    A selection of different controls are available the following table shows thecontrols and their basic properties. Each control has a set of attributes that define it,which are listed in the Control Properties dialog box. For example, the X and Yattributes of a control determine the control's location on the form. Each control alsohas a set of properties and methods that are used to retrieve information about thecontrol or modify various aspects of the control at run-time, via scripts. In addition,some controls generate a range of events as they are operating, and scripts can becalled when these events occur. For example, a Buttoncontrol generates an OnClickevent each time it is clicked. A script can be associated with this event, allowing theform to perform custom actions such as the calculation of one control value based onthe values of other controls. The use of scripts is not covered in this guide.

  • 8/2/2019 Arcpad Forms

    12/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    12

    1. Add a Label control. Hold your mouse pointer over the LABEL button in the

    Control Palette , then click and drag the control onto the form.2. The Control Properties dialog box for the new Label control is displayed after

    you drop the control. This is where you'll define the Label control's attributes,such as its name, caption, and location on the form.

    3. In the Name text box, type slblFormation. Later in this tutorial, you'll see howto use a control's name to identify it in scripts.

    4. In the Caption text box, type Formation. This is what gets displayed to users

    on the form.5. Set the size and location of the Label control. Type 4 and 4 in the X and Y text

    boxes, respectively. Then type 40 and 12 into the Width and Height textboxes, respectively. You can also set the size and location of controls bydragging and sizing with your mouse, but this approach is more precise

    6. Click OK to finish adding the new control to your edit form.

  • 8/2/2019 Arcpad Forms

    13/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    13

    7. Next we'll add a ComboBox control that will be bound to an attribute field inthe Bedding.shp DBF table. When a user sets the value of a bound control inArcPad, the value gets written to the attribute that it is bound to in theshapefile table. This happens automatically. Hold your mouse pointer over the

    COMBOBOX button in the Control Palette, then click and drag thecontrol onto the form.

    8. Set the attributes for the ComboBox in the Control Properties dialogue box asshown in the figure below.

    9. Click on the List Values tab of the Control Properties dialogue box.10. Under External List Values, click on Browse and navigate to the

    Forname.dbf file.

  • 8/2/2019 Arcpad Forms

    14/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    14

    11. In the Values Field select Name. (If Value is selected then the number in theValue column of the dbf file is recorded in the attribute table rather than thename of the formation, strike, dip or dip direction. For example theForname.dbf shown on page 7, would record 1 in the attribute table if BasalSnd had been selected on the form).

    12. In the Text Field select Name.13. If you wish to limit entries to only those in the dbf file, check Limit to list. If you

    wish to be able to add other entries leave unchecked.14. Click OK.15. Repeat stages 1-14 to add Labels and ComboBoxes for Strike, Dip and Dip

    direction. Remember to change the X & Y for each new label and box, the

    entry in the Name text box of the Control Properties dialogue box for each newComboBox e.g. cboDip etc. and also to assign the correct dbf file for each.16. Your edit form should now look something like this

    17. Now we will add Label and Edit controls for bed thickness.18. Drag a Label control onto the edit form and define the Label controls

    attributes in the Control Properties dialogue box as shown below.19. Click Ok

  • 8/2/2019 Arcpad Forms

    15/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    15

    20. Add an Edit control from the Control Palette and define its attributes asshown below.

    21. Click Ok

    22. Add another Label control for the date and define its attributes as shown

    below.23. Click OK

  • 8/2/2019 Arcpad Forms

    16/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    16

    24. Finally add a Date Time control and define its attributes as shown below25. Click OK

    26. The form is now complete and should look something like this.

  • 8/2/2019 Arcpad Forms

    17/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    17

    27. Click on OK28. Click the Save button on the toolbar.29. Exit ArcPad Studio.

    Checking the form

    1. Open ArcPad on your PC

    2. Click Add Layer and add Bedding.shp.

    3. Click Layers

    4. Select Bedding and check the edit checkbox

    5. Click to close the Layers dialogue box.6. The Edit toolbar should be activated.

  • 8/2/2019 Arcpad Forms

    18/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    18

    7. Click on the Capture Point feature button.8. The arrow pointer is replaced by a cross. Click on the Map area of the display

    and a point will appear along with the Bedding form.

    9. Click on each of the drop down boxes in turn to check that it is workingcorrectly10. The form also displays the Attribute table and the Geography. Use the arrows

    to scroll to the required tab and click on it to view the contents of that page.11. Click Cancel and exit ArcPad without saving.12. Youve now created your form.13. It is worthwhile checking your forms before going out in the field to make sure

    that they function correctly and record data in the attribute table in the correctformat. This can be done by adding data using your forms and then openingthe relevant shapefiles in ArcGis and looking at the attribute table for each.

  • 8/2/2019 Arcpad Forms

    19/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    19

    Creating forms using the Form Creation WizardAnother way of creating forms is to use the From Creation Wizard (see

    appendix for details). This applet generates custom data entry forms for yourshapefile on-the-fly from within ArcPad. You select a shapefile and the wizard walksyou through the process of defining your custom data entry form. You can set options

    for each field such as default values, required and read-only fields, and minimum andmaximum values. You can also create pick lists. These forms can be furthercustomized in ArcPad Studio if desired.

    Unless you have to create a form in the field it is recommended that forms arecreated in ArcPad Studio or ArcPad on your desktop/laptop. For the purposes of thisexercise the layer definition file Bedding.apl created previously should be deleted or

    moved . The Form Wizard will overwrite the pre-existing apl file

    1. Ensure that the form wizard is installed (see appendix).2. Open ArcPad. Ensure that the Form Wizard is visible on the toolbar. If it isnt

    click on the Tools button Toolbars | tlbToolBrowser

    3. Click to add a layer.4. Navigate to Bedding.shp and check the tick box5. Click OK

    6. Click on the Layer button and check the Bedding shapefile as shownbelow.

  • 8/2/2019 Arcpad Forms

    20/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    20

    7. Click to close the Layers Dialogue box.

    8. Click on the Forms Wizard button.9. The Select Shapefile dialogue box opens, select Bedding.shp.

    10. Click OK

    11. The Select fields to include dialogue box opens.

  • 8/2/2019 Arcpad Forms

    21/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    21

    12. If you wish to add all the fields listed click . If you wish to add or remove

    fields individually highlight the field and use the and buttons

    respectively.13. Add all but the Id fields.

    14. The order in which the fields appear on the form can be altered by highlightingthe field and using the up/down button. Place the fields in the same order asshown below.

    15. Click OK16. The Date field dialogue box opens. This shows that it is the first of seven

    fields. Ensure that the Include this field in form box is checked and also thatthe Use the current date as default box is also checked.

    17. Click OK

  • 8/2/2019 Arcpad Forms

    22/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    22

    18. The next filed form appears Text Field: Formation.19. Again check the Include this field in the form box.20. If you wish to set a default value enter it into the space provided: Enter

    Unknown.

    21. Click on the Pick List tab.22. There are two options here. Either Enter pick list values manually or Use a

    DBF table for the pick list.23. In this case we will enter the pick list values manually, so check the

    appropriate box.24. Two additional text boxes appear Value and Text.25. In the Value text box type 1.26. In the Text text box type Basal Snd.27. Click Add28. The information is shown in the display box.29. Repeat stages 25 -27 with the values: 2, 3, 4, 5, 6, 7, 8, and the text: Marl Slt,

    Raisby, Ford, Conc. Lim, Roker, Seaham, Unknown.

    30. Click OK.

  • 8/2/2019 Arcpad Forms

    23/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    23

    31. The next field form appears; Numeric field: Strike.32. Check the Include this field in the form box.33. In the Default value text box enter 999

    34. Click on the Pick List tab and check the Use a DBF table for the pick list box.

    35. Click on the button to navigate to the strikevalues.dbf file.36. Set the Value Field to VALUE and the Text Field to STRIKE.37. Click OK38. Continue this process until all the field forms are completed. The following

    message should appear.

  • 8/2/2019 Arcpad Forms

    24/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    24

    39. Click Yes.40. To view the form, the bedding shapefile must be in edit mode.

    41. Click on the Layer button and check the edit box in the Layer dialoguebox.

    42. Click on to close the Layers dialogue box.43. The Edit toolbar should be activated.

    44. Click on the Capture Point feature button.45. The arrow pointer is replaced by a cross. Click on the Map area of the display

    and a point will appear along with the Bedding form.

  • 8/2/2019 Arcpad Forms

    25/27

  • 8/2/2019 Arcpad Forms

    26/27

    P.Clegg, ArcPad (forms) ver.1 28/07/2003

    26

    6. Click on Form | Form Properties.7. You will notice that the Attributes Page and Geography Page boxes areunchecked. Check both and click OK.

    8. It is possible to edit any of the attributes and controls that you created usingthe Form Wizard by following the instructions in the previous section.

    9. Click on OK and close the Bedding.apl window saving the changes you havemade.

    10. Exit ArcPad Studio.11. Check the form again in ArcPad as outlined previously.12. You will notice that the Attribute page and Geography page are now available.13. This now means that the data in the Attribute table is editable.

  • 8/2/2019 Arcpad Forms

    27/27

    Appendix

    Useful Addresses

    ESRI (owners of the ArcGis suite of applications) http://www.esri.com/

    ArcPad web page http://support.esri.com/products/default.asp?p=7 ArcPad Form creation wizard download site

    http://arcscripts.esri.com/details.asp?dbid=12608

    Installing the Form Creation Wizard

    1. Download the form wizard zip file from the site shown in Useful Addresses.2. Extract the files to the Applets folder within the ArcPad program folder.3. Open ArcPad4. The Form Wizard icon should be visible on a toolbar5. If it isnt click on Tools | Toolbars | tlb ToolBrowser.

    6. If a yellow ? appears on the toolbar you will need to upgrade ArcPad to v.6.0.1

    People using ArcGis, ArcPad & GPS in the department

    Dr. Ken McCaffrey ([email protected]) Dr. Phillip Clegg ([email protected] ) Robert (Woody) Wilson ([email protected] )