Fieldlog

    Copy the folder Fieldlog in \\public\505to your user area. The folder Fieldlog contains the directories SNOW14 and SNOWEMP.
    If you are a new user of Fieldlog you will need to retrieve the Fieldlog menu in Autocad: load Autocad Map -> click Tools -> Customize menus -> Browse -> select Fieldlog ->  Open ->  Load -> click Fieldlog in the Menu Groups box ->  Menu Bar -> click Fieldlog in the Menus box -> click map in the Menu Bar -> click Insert -> click Close.

    Once the Fieldlog Menu shows up in the upper toolbar, open the file snowlake.dwg. The snowlake map should show on the screen. Click the load Fieldlog button in the Fieldlog menu.  Once Fieldlog has completed loading, select fl-setup in the Fieldlog menu, followed by Project setup. If there are any projects listed in the setup box, delete them. The reason for this is that all projects must be located in the same folder with the samedefined path. Consequently, if there is a project already setup in d:\acadmap2\fieldlog, you cannot set up a Fieldlog project in your area. Type in the project name in the lower left hand data entry box, e.g. snow14, and the path to the Snow14 directory in the middle box. Select DB3 in the drop down list attached to the right hand box. Make the links button active, and click the Insert button, followed by the Exit button. Exit the Fieldlog Setup menu.
    Access the Fieldlog menu once again and select the Logon menu. Select 'snow14' in the Database drop-down selection set, and then OK. Go  to Map setup in fl-setup and check that the Map Projection is indicated to be Snowlake Grid and Clockwise Angle is set to 'Y'. If snowlake.dwg has already been opened, the Map Setup settings will have been set to correspond to those retained in the .dwg file.

    The following tutorial was downloaded from the Fieldlog web site at:

               http://gis.nrcan.gc.ca/fieldlog/Fieldlog.html


    During the installation process, Fieldlog established which projects are available on your machine. If you get an error during loading, or if no names are present in the pop-up list, the project identifier file wasn't set up correctly. Go to the FIELDLOG.PRJ section of appendix A.

    Mini Icons in AutoCAD for Windows...
     AutoCAD for Windows provides a Graphical User Interface - in other words, menus and buttons instead of menus and text lists as in AutoCAD for DOS. One of the advantages of AutoCAD for Windows is that you can change what these buttons do - and have them substitute for selecting commands from the FieldLog menu or entering them as text on the command line.
     The drawing is rotated relative to the screen by about 40 degrees clockwise. This is because the Snow Lake project is based on a user grid, and FieldLog understands and maintains the relationship between this grid and standard methods of projecting maps such as UTM. The user grid in this case is rotated relative to north, and note that the North arrow points off to the upper right on your screen. See Map Projections in Section 4 for more information.

     Relational database
     Relational databases organize information in the form of tables. Each table can have multiple columns, or fields, and any reasonable number of rows, or records. Fields have a data type, meaning that a field might store a date, an integer, a logical (true/ false), or a string of characters. For example, a field might store a date, or an integer, or a logical (true/false) value, or a string of characters.
FieldLog can store information in an internal database, or via interface drivers in a stand-alone database on your machine or on a database server.
 Note that the columns in the table aren't aligned. This may happen if your Windows system font isn't set to a fixed width spacing. See Maintenace Procedures in Section 5 for more information.

 Starting FieldLog
Introduction
Because FieldLog is an extension to AutoCAD, you must start it from within AutoCAD. In this chapter you learn how to:
• Log on to FieldLog
• Browse a sample database
• Log off FieldLog
Logging on to a FieldLog database
Starting AutoCAD
 Before you can log on to a FieldLog database, you must start AutoCAD and open a drawing.  Refer to your AutoCAD manual for instructions on starting AutoCAD and opening a drawing. If you haven't installed FieldLog, refer to Appendix A for installation instructions.
 In this tutorial we will be using snow.dwg, a map of the Snow Lake area installed during FieldLog's installation.

 Opening Snowlake.dwg
 Snow.dwg contains the linework and cartographic annotation for the SnowLake FieldLog Database. To open snowlake.dwg:
1. Choose File>Open.
2. Select snowlake.dwg from the snow directory (or where you installed the sample files).
3. Click OK.
The Snowlake drawing appears.

 Starting FieldLog
 Now that you've opened a drawing, you can start FieldLog. You can do this manually or using the FieldLog menu.
1. Choose FieldLog>Load FieldLog.
 A message in the AutoCAD command line indicates that FieldLog has loaded. Now you're ready to log on to a specific database.
  Logging on to a database
 Each time you open FieldLog you must indicate which database(s) you want to use. Several databases can be active at one time, enabling you to compartmentalize a project into several independent sub-projects or display adjoining project data on one map.
 To log on:
1. Choose FieldLog>fl-logon
 The Connect to database dialog box appears.
 If you were logging on to a corporate database, you would need a user name and password. Because the demo files are local and unprotected, you can leave the User Name and Password fields blank.
2. Select SnowLake from the Database Name pop-up, then click OK.
 When AutoCad finishes loading FieldLog and the SnowLake database, it returns you to the standard AutoCAD command prompt.
 Now that you've loaded an AutoCAD drawing, FieldLog, and a sample database you're ready to browse the database.
 Browsing the SnowLake Database
 The fundamental operation in FieldLog is to ask a question, then analyze the answer. In FieldLog this means performing a query and surveying the results in a query table. This section provides a brief overview of the query process using the SnowLake database.

 To optimize storage and access of data, FieldLog stores all data in relational databases. Browsing data stored in relational databases is simply a matter of asking FieldLog to display some of the information in the database in a table.

 To start the query process:
1. Choose fl-query from the FieldLog menu.
 The Query Panel appears. The query command lets you quickly review your data, as well as do complex, multipart queries and output the results to other programs.
2. Choose SnowLake from the Project pop-up.
3. Type StatBrowse in the Name box.
 Naming the query allows you to rerun it at a later time simply by picking its name from the Query pop-up.
 Tables in the SnowLake database include STATI, the station table, STRUC, the structural table, LITHO, the lithology table, and so on. Each table is independent, but can be related or joined to the others to build a complex query. Here all we want to do is look at the database itself, not limited by a query. We don't, however, want to look at the entire database, just a few of the fields.
 This amounts to building a summary of the database, automatically! Imagine the amount of work it would take to build a custom summary of a traditional field-notebook based field project's results.
 Since we will not be limiting the records from our database that are returned, except by specifying which fields we want to see, we don't need to build a condition. Instead, we will simply select the fields we want to show up in the query browser.
4. Choose the following from the Output list:
LITHO.ROCKNUM
LITHO.ROCKTYPE
STATI.UTMX
STATI.UTMY
STATI.UTMZ
 These correspond to the legend number and rock name for each station in the Lithology table. You can select and deselect entries on the list with successive mouse clicks.
5. To run the query, click Ok.
A message box appears indicating that FieldLog is running the query. When the query is done, you can use the Scroll Table dialog box to quickly view large amounts of data.
6. Click Ok.
 The Scroll Table dialog box appears.
 Try navigating through the list:
• Use the slider to view data off of the right side of the table.
• Click Next or Prev to scroll up or down.
• Click Top or Bot to jump to the top or bottom of the scroll table.
• To close the Scroll table, click Ok.
About FieldLog Data Tables
 Although many of the entries in the data tables may at first seem redundant, these entries are the key to FieldLog's power.
 Each record table has a unique identifier called a basenumber that unambiguously identifies individual records (or rows). FieldLog sorts each table according to its basenumber. These unique values allow FieldLog to unambiguously separate what might otherwise be identical records.
 Data is spread between many tables for flexibility and the tables are related by column values. For example, rather than recording outcrop level information for each station in STATI, FieldLog uses the OUTCROPNUM value to relate outcrop information indirectly. If you have four stations at one outcrop, this means you only have to enter outcrop information once!
 The organization of database into small tables to reduce redundancy is called database normalization. We'll discuss this in detail in Chapter XX.

 Logging Off
 When you're finished using a FieldLog database, log off the database. This allows FieldLog to terminate any connections to external databases and close down internal connections clearly.
1. Type fl-logoff in the AutoCad command line or choose fl-logoff from the FieldLog menu.
 The Disconnect from database dialog box appears.
2. Select the SnowLake database.
3. Click OK.
 If you're connected to only one database, logging off also ends your FieldLog session.
 Ending an AutoCAD session
 To save your drawing and exit AutoCAD:
1. Choose File>Save from the File menu.
2. Choose File>Exit AutoCad.
Summary
 In this chapter, you learned how to...
• Start AutoCAD
• Open a Drawing
• Start FieldLog
• Log on to a FieldLog database
• Browse a FieldLog database using the fl-query command
• Log off
• Save an AutoCAD drawing
• Exit AutoCAD

 Why have a traverse table?
 During a typical data entry session you add data for one day of mapping or one traverse. Why bother explicitly keeping track of traverses? This simple once-a-day entry enables you to do sophisticated queries —-such as displaying mapping done by one geologist or mapping done after a certain date.
Form
Edit box
About Space
 Location on the surface of the Earth is specified using a coordinate system. In Canada, the two common methods used are geographic coordinates (or latitude/longitude) and Universal Transverse Mercator (or UTM). UTM is a map projection or a method of transforming locations on a globe to a flat sheet with a minimum of distortion.
 FieldLog can convert between most major projections and can simultaneously record locations into multiple projections, automatically converting between them as data is entered.
 The SnowLake database is an example of where two coordinate systems are used — the map is stored n a user grid coordinate system and the positions are transcribed into UTM.

 About Depth
 The Profile Browser contains a viewing depth field and an Apply button. What are these for?
Geological classification schemes are, mostly, hierarchical. We subdivide rocks into igneous, metamorphic, and sedimentary. We subdivide igneous rocks into felsic intermediate, mafic, and ultramafic. The exact level of subdivision reflects the specific interests and goals of the mapping geologist. Most geologists can agree on the division and subdivision terms for rocks, but sub-subdivisions and so on quickly become highly personal terms.
 FieldLog is unique because it allows geologist to express queries in geologic terms. To a great degree this comes from FieldLog's use of profiles. The FieldLog profile allows a query to specify, for example, all igneous rocks without naming them all — the subdivisions know their division.
 The Viewing Depth box allows you to specify how deep into the profile hierarchy you see. A 0 shows the entire hierarchy, a 1 only the divisions, a 2 the division and subdivisions, and so on. VIewing depth can be useful when you want to scan the entire profile without getting overwhelmed by details.
 To shift between rows in the forms section, point using your mouse/digitizer or press the Return (Enter) key.
 If you shift to a field that requires a value, you won't be able to move away from that field until you enter a value.

 Why a key number?
 If FieldLog included rock descriptions as part of the LITHOLOGY table, you would have to make assumptions about data collection during database setup. How many rocks, at most, would you leave room for? Any unused fields would still occupy space in the tables, so your database would be highly inefficient.
By keeping rock descriptions in a separate table, any number of rock descriptions can be entered. Each knows which Lithology it's associated with via a unique number from the LITHO table. This breakup of tables is called database normalization.
 Limits on Modifying Tables:
 If you use fl-query for awhile you will notice that, often, the modify buttons are grayed out when you arrive in the Scroll Table display. In other words, you cannot modify any of the data on the display.
This is due to a limitation in AutoCAD's support for the Structured Query Language, around which FieldLog is built. AutoCAD only allows edits when all displayed data comes from a single table. Notice in the photo editing exercise we only select items from the photo table -— all of the entries are prefixed by PHOTO. If we had selected any entries from any other tables - for example, STATI.STATNUM, we wouldn't be able to modify the data in the table because the scroll table would contain items from more than one table.

 About Object Selection
 When you decide to move an object on the map, there's some ambiguity about what you're trying to accomplish. You might want to:
• move all data associated with a station (STATION)
• shift all data associated with a table by an offset from the station location — this is useful for placing structural data beside stations rather than on top of them (TABLE)
• move only a selected database entry from a single table (ROW)
 To accommodate all of these possibilities, FieldLog displays the Object Selection Mode dialog box whenever you use fl-move.

CHAPTER 4 Adding and Editing Data In FieldLog
 Introduction
 In Chapter 2, you learned how to start FieldLog, log on, and off a FieldLog database using fl-logon and fl-logoff. You also reviewed one section of the sample database using fl-query.
Building a GIS database is about more than simply browsing records using queries. In this chapter you'll discover what's involved in adding data to an existing database. The process you'll learn in this chapter is very similar to the one you'll perform at the end of a day's field work. In this chapter, you'll learn how to:
• Add data to an existing FieldLog table
• Edit existing data
• Interactively move data on the graphics screen

 Before you begin
 If you aren't logged on to FieldLog and the SnowLake database, follow the steps from Chapter 2 to open snowlake.dwg, start FieldLog, and log on.
  Adding data to a table
 Each time you add field data to an existing database, you'll enter different pieces of the data into different tables. For example, after each traverse you'll probably add:
• A new traverse to the trav table
• New stations to the stati table
• The lithology for each station to the litho table
• One or two measurements per station to the struc table
• An airphoto to the photo table
• One or more samples to the sample table
 As briefly noted in Chapter 2, FieldLog is built around a relational database. Each of the different tables are related to build one coherent database. The subdivision of data you enter into the tables reflects the internal organization of the database.
 Let's assume that you've done some mapping in the Snow Lake area and are ready to enter some new data to the SnowLake database.

 Getting Ready
 First, use AutoCAD's zoom command to zoom in on the island on the east side of the map. When you're done, the island should fill about a tenth of your screen.
 Now you're ready to add the following field geological information to the SnowLake database:
• A new traverse
• Two stations on the island
• Lithologies for each station
• A sample at one station
• A photo at the other station
• Structural measurements at both stations
 As you add the new data, note that you first enter the data into the database, then on the map. Fieldlog setup allows you to specify what database details appear on the map. As well, any query you run can output to the AutoCAD map, so you can always add more map symbols and text later.

 Adding a New Traverse
1. Type fl-add or choose fl-add from the FieldLog menu.
 The FieldLog Add to Table dialog box appears.
2. Select SnowLake from the Project pop-up.
3. Select Trav from the Table pop-up.
 Now that you've chosen a location for the data, FieldLog displays possible entries for that location in the Add to Table form.
4. Select TRAVNUM. Type 29 in the edit box at the bottom of the screen, then press Enter.
 If the entry is valid, FieldLog selects the next item in the table. If the entry is invalid, a message appears at the bottom of the Add to Table dialog box.
5. For GEOLOGIST type ME in the Edit box, then press Enter.
 Normally you'd type your initials here, but because you'll need to remember this information for a later query, type ME. Note that if you try to enter a log name here, FieldLog returns an error. In the setup of the SnowLake database, this field was deliberately kept small.
6. For NTSMAP, click List.
 The Select from Profile dialog box appears, listing possible values.
7. Choose 63k16, then click OK.
8. Once you're back in the Add to Table dialog box, press Enter.
9. For FieldDate, type 19960621, then press Enter.
10. For Summary, type Quick tour of island, then press Enter.
11. To add the record to the traverse table, click OK.
 FieldLog assumes that you'll be adding lots of data at once, so it increments the traverse number by one and returns you to the Add to Database dialog box.
 If you want to enter data in another table, you can easily change tables using the Table pop-up.
12. When you're finished adding data, click Cancel. This doesn't cancel the entries you've just made, it ends your current data entry session.
  Adding new stations
 When adding a new station to a FieldLog database, you must enter the station coordinates — after all, the key to a spatial database is that it records not only descriptive information (usually called attributes) but also spatial location. You can enter coordinates by:
• Typing in the actual number (in the current projection system)
• Pointing with a digitizer or mouse to the station location on the screen view
• Pointing with a digitizer or mouse to the station location on a digitizer map or air photo (you must first calibrate the digitizer map or photo to the coordinate system of the AutoCAD map — see Tablet Calibration in Chapter 6)
 During actual field work you might be digitizing the location from a calibrated airphoto, grabbing the data from a hand held computer or GPS, digitizing from a sketch map, or visually comparing a sketch on the screen with paper map. For simplicity, we'll use this final method here.
In this lesson you'll learn how to locate a station by interactively choosing a point on the screen.
1. To open the Add to Table dialog box, type fl-add or choose fl-add from the FieldLog menu.
2. Select the SnowLake project and the STATI table.
3. Leave the UTM, GRIDX, and GRIDY values blank.
 If the UTM, GRIDX, and GRIDY contain data, you won't be able to interactively select a point. FieldLog assumes that since you have left them blank, you want to pick the location manually.
4. Select STATNUM, type me1, then press Enter.
5. For AIRPHOTO, type none, then press Enter.
6. For TRAVNUM, type 29 (since this was the last traverse number you entered, it should by default already be in the table).
7. Click OK.
 The dialog box disappears and a crosshair with a station symbol appears on the map. If your digitizer was calibrated and you had a station on map or airphoto to enter, you would now align the digitizer cross-hair with the station or the digitizer and click. Here, though, you'll work in a relative mode, by visually estimating a location.
8. Move your mouse or digitizer until the crosshair is on a point at the left side of the island (southwest side), then click to place the station.
FieldLog prompts you for a location for the station number. (Remember, during setup you specify what database information appears on the map and what information is simply stored in the database.)
9. Click again to place the station number text beside the station.
 When done, the map should look like the one shown below.
 FieldLog returns you to the Add to Table dialog and automatically increments STATNUM by one. Because FieldLog assumes you'll be quickly adding blocks of data, it fills in fields with incremental numbers — saving you time.

 Adding Lithology Data
 Now we will add lithological information for the newly created station. We will do this using fl-add once again:
1. Open the fl-add panel using the menu or command line.
2. Select the SnowLake database and the LITHO table.
Since the station number is correctly filled in, we can begin by adding the Lithology. Note that there is a key number for the rock number. Accept the entry of 1 here and move to the Rocktype field:
3. With Rocktype highlighted, click on the List button on the right.
The Select from Profile list browser appears.
4. Click Pillow Basalt, then OK.
5. Interactively place the lithology code on your map.
FieldLog returns you to the add panel.
6. You're finished adding lithology information. Click Quit to exit.

 Adding Structural Data
 Next you'll add some structural data.
1. Open fl-add, then select the STRUC table.
 Notice that the Statnum is already filled in. Because the STATI table ties station me1 to traverse 29, future queries can search for structures found by traverse.
 Just as the profile for rock types keeps track of rock types hierarchically, FieldLog stores structural symbols hierarchically — planar versus. linear, bedding versus. foliations, and so on.

 Now we'll use the structural browser to pick a first-phase foliation from the selection offered.
2. Click the Feature field, then the Tree button.
 The Symbol Tree browser appears.
3. Click Planar, then Foliation, then SFol1, then click OK.
4. Press Return to add the chosen symbol to the table.
5. Enter 123 as the azimuth, and 45 as the dip.
 Your browser should look like the one shown below.
6. Click Ok, then place the symbol on the map.
7. Your entry should look similar to the one shown below.
8. To exit the Add to Table dialog box, click Quit.
 Congratulations, you've successfully added a station, a lithology, and a structural measurement to the FieldLog database.
 Adding a sample to station me1
 For practice, and to illustrate a few other features of FieldLog, we'll now guide you through entering some more data to the map.
1. In the Add to Table dialog box, select the SnowLake database and the SAMPLE table.
2. Enter the data in the Add to Table dialog box according to the values listed below:
STATNUM
me1
ROCKNUM
1
SAMPLENUM
1
(for this station)
THIN
N
(no thin section)
STAIN
N
(not stained)
CHEM
N
(not chemically analyzed)
OTHER
(leave blank)
REASON
for assay
3. Before finishing, click the Plot box to empty it. You don't want to plot a sample symbol to the map and clearing the box stops plotting.
4. Click Ok.
 You've added a sample to the SAMPLE table. Note that you didn't have to enter a location — the database assumes the sample coincides exactly with its station.
 Adding an airphoto to station me1
 In the Add to Table dialog, select the SnowLake database and the PHOTO table.
1. Enter data into the Add to Table dialog box according to the values listed below:
ROLL1
1
FRAME3
12
CAPTION
 Interesting feature in outcrop
2. Again, make sure the Plot box is clear.
3. To add the station, click Ok.
4. Once you return to the Add to Table dialog box, click Cancel to return to AutoCAD.
 Using fl-query to check a station's values
 We'll now check to see if you're adding the data correctly by using FieldLog's fl-query command.
1. Type fl-query or choose fl-query from the FieldLog menu.
2. Rerun your StatBrowse query by picking it from the list, then click Query.
3. Click the Bot button to move to the bottom of the list.
 Note that me1 is now in the list along with UTMX, UTMY, and other attributes you added earlier.
 Adding information to existing stations
 You can go back at any time and add or modify information on existing stations. In this section we'll add another structure measurement — a lineation — to me1 and force it to remain hidden. Hiding information is useful when you want a complete database, yet don't want your map to be too crowded.
1. Start fl-add using the menu or AutoCad command line.
2. To change the current station to me1, select STATNUM, type me1, then press Enter.
3. For Feature, click Tree. The Tree Selection dialog box appears.
4. Click Linear, then L-Fabric, then the lu symbol.
FieldLog returns you to the Add to Table dialog box.
5. Press Enter.
6. For Azimuth, type 045, then press Enter.
7. For Dip (plunge in this case), type 30, then press Enter.
8. Clear the Plot checkbox, located at the bottom right of the dialog box.
9. Click Ok.
 FieldLog adds the value to the database, but not to the map. You can now use the fl-query command to check whether the information was entered correctly into the database. Try it!

 Exercises
Before going on to more advanced topics, take a moment and do the following exercises.
• add a station, me2, at the other end of the island (use the same date, map, etc. as for me1)
• add a lithology, pillow basalt
• add a foliation (sfol1) with strike 111 and dip 54
• add a sample, for assay
 Make sure you toggle plot back on so that the data ends up on the map. When you are finished the map around the island should look similar to the one shown below.

 Editing Data
 You can edit any data in a FieldLog database. In this section you'll edit some of the data you just entered into the SnowLake database. If the value you want to edit is tied to a visible object, you can edit the value using fl-move or fl-edit, simply by clicking on the object on the screen. If the value isn't visible, first find the data using the fl-query command, highlight the row you want to change or add to, then click Modify to change its value. We'll start by moving an existing station.
 If FieldLog isn't running and you aren't connected to the SnowLake database, follow the steps from Chapter 2 to open snowflake.dwg and log on to the database.

 Editing a station's location
 Moving a station
 After entering station me2, you realized that you placed it in the wrong location. You want to move it a few meters up the right side of the island.
1. Type fl-move in the AutoCAD command line.
2. Select the station symbol (the X) for station me2, then press Enter.
 The Object Selection Mode list box appears. You can use this list to select all items in the same station, table, group, or row.
3. To move all data associated with the station, select the Station radio button.
4. Click Ok.
5. Drag the station and all associated data to a new location on the right side of the island.
6. Click to place the station in its new location.
 That's it! Note that all the structural data followed along.
 

 Moving a row
 Occasionally, when you move a station some of the station information, such as structural symbols, may obscure other objects in your view. To move the structural symbol for me2:
1. Type fl-move in the AutoCAD command line.
2. Select the structural symbol for me2, then press Enter.
 The Object Selection Mode list box appears, where you can select items in the same station, table, group, or row.
3. To move all data associated with the structural symbol (a row in the STRUC table, select the Row radio button.
 This limits the changes you make to the selected structural symbol.
4. Drag the symbol to a new location, then click.
 Editing a structural symbol using fl-edit
 Now let's change the dip of the structural symbol at me2.
1. Type fl-edit.
2. Select the structural symbol at me2.
 The Edit table dialog box appears, listing the structural data for the selected symbol.
3. Select DIP, then replace its current value (54) with 55.
 Your edit panel should look similar to the one shown below.
4. Click Ok.
 Your map should now show the changed value of 55. Note that using fl-edit you can interactively edit all aspects of a structural measurement.
 Editing a photo caption with fl-query
 Next let's edit the photo caption at me2. Because the photo isn't shown on the map, use the fl-query command to access and then edit the caption.
1. Use fl-query to select all stations with PHOTO.STATNUM > 0.

 From the selection list choose the following:
PHOTO.STATNUM
PHOTO.ROLL
PHOTO.FRAME
PHOTO.CAPTION
PHOTO.BASENUMBER
2. Run the query.
3. When the Scroll Table appears, click Bot to move to the bottom of the table.
4. Select the me2 entry, then click Modify.
5. Select the caption, then replace the current text with Fascinating structures at me2.
6. Click Ok to exit. Note that the entry has changed.
 That's it for adding and editing! Save your drawing and log out of the SnowLake database.
 CONCLUSIONS
 In this chapter you learned how to:
• Add new data to an existing FieldLog database
• Move data interactively on the map by item, station, and table
• Edit values in the FieldLog database by selecting them on the display
• Edit values in the FieldLog database by selecting them with a query

 To plot or not to plot
 Remember that when you add data to FieldLog you're primarily building a database, not drawing a map. A few well-structured queries can plot anything from the a database to the map at any time. Don't get preoccupied with what you do or do not initially plot to the map! When in doubt, reduce clutter by keeping data in the database only.
 If you get this message, try selecting the entity again. You may not have selected the entity correctly or you may have selected an entity that doesn't contain any FieldLog information.
 Notice how easy it is to run a saved query! As you continue to use FieldLog, get in the habit of naming any queries that might be useful later. Give them descriptive names so you'll remember what they do.
 

About Queries

FieldLog makes expressing a query very simple and allows queries that make geologic sense. However, it's easy to get misleading results from any complex query, especially those that involve multiple conditions. When in doubt, work through the query slowly and make sure the query does what you want! (Most people run into problems when using the AND connector.)

CHAPTER 5 Querying a Database
 Introduction
 Although FieldLog would be useful if all it did was allow you to plot data to a map and build database files containing field data for use in other programs, FieldLog actually does much more — it leverages the power of relational databases and CAD programs to enable geologists to change the way geological map analysis is done.
 Although most of the work you'll do in FieldLog is data entry and editing, the payoff comes when you mine the database for information. You can mine your database by:
• querying the database for tabular information
• querying the database and drawing the results to the map
• deriving stereonets of structural information via a query
• plotting geochemical diagrams from database tables
• exporting the existing database to advanced GIS software for further analysis
 So far you've used fl-query to generate browsable scroll tables — you queried the database for tabular information. In this chapter you'll learn how to perform complex queries — displaying results on a map, generating diagrams, and exporting. You'll also explore the full power of FieldLog's hierarchical approach to geological data manipulation.
 The fl-query command is the heart of FieldLog. It's extremely simple to use for basic searches, yet provides sophisticated power for advanced users. Many of the abilities of fl-query are not provided by even the most advanced GIS tools on the market because they were never intended for geological work. FieldLog is a specialized GIS tailored by geoscientists for geoscientists.

 Before you begin
 If you aren't logged on to FieldLog and the SnowLake database, follow the steps from Chapter 2 to open snowlake.dwg and log on:
• Start AutoCAD, then open SnowLake.dwg.
• Load FieldLog using the menu.
• Logon to the SnowLake database using fl-logon from the AutoCad command line or the FieldLog menu.

 Benefits of using layers
In Chapter 6, we'll discuss the importance of AutoCAD layers for separating different data types during map preparation. In this section, we briefly introduce you to the use of AutoCad layers in FieldLog.
 The foliations we added to the SnowLake database in Chapter 3 are on a layer named S-FOL1.
1. To open AutoCAD's layer control panel, type ddlmodes in the AutoCAD command line.
AutoCAD's Layer Control dialog box appears.
2. Select the S-FOL1 layer, then click Set Color....
 The Select Color dialog box appears.
3. Choose red from the Standard Colors list, then click OK.
4. To exit the Layer Control dialog box and return to your map, click OK.
 Note that the foliation symbols and their dip measurements are now red. It's a good idea to set AutoCAD's colors up so that different data types have different colors.
5. Zoom out to see the whole map.
 The ability to highlight or hide certain data allows you to build a variety of thematic maps from one basemap. One way to do this is to turn layers off. Another is to physically remove data from the map but not from the database. We'll return to layer usage in Chapter 6.
  Performing a simple query — details...
 Now let's do a simple query — find all S-FOL1's in the SnowLake database and add them to your map. This time we'll go through the process in detail so you can see what each section of the query box is actually contributing to the process.
1. Type fl-query in the AutoCAD command line.
 The Query database dialog box appears.
 Project
 Allows you to choose which database to query, if you have more than one open. Normally you will have one database open, but in large or complex projects you may elect to spread the project between several sub-projects, each with its own name and files area.
 Query
Enables you to select from previously used searches, providing you named them when they were initially used. Most queries are used frequently, so get into the habit of using the Name box and giving queries common-sense names.
 Name
The place where you type in a name for the current query. The named query will be available the next time you return to fl-query.
 Condition
 The viewing area where queries are built. You don't interact directly with this box except to select between multiple query components during query editing.
 Output
 The area where you select which fields will be sent to the scroll table that results from running the query. The queried table items are automatically selected in this window when you add a query to the Condition box. Recall from Chapter 3 that you can only modify items when a query is run within one table only.
 Area
 Allows a search of a geographic area on the map, selected using the mouse or digitizer. To use this feature you must select Inside or Outside in the Operator pop-up.
 Line
 Allows a search based on proximity to a line on the map, usually known as a buffer search. To use this feature, you must select Near in the Operator pop-up. Enter the width of the buffer as a number in the Value field. The width must be in the current drawing units.
 List
 Allows you to choose Value entries from a list associated with a dictionary profile. For example, structural data is tied to a structural profile, so you can choose the desired structure name to search on by selection from a list if the Column pop-up contains the field STRUC.FEATURE. You must, of course, select the Column before you use this button.
 Tree
 As with List, this button allows a search based on a profile, but in this case via a hierarchical browser.
 Symbol
 As with List, this button allows a search based on a profile, but in this case from a browser showing all the symbols associated with the profile.
 Connector
 Defines the logical relationship between entries in the Condition list. The two possible entries are:
• AND —  When conditions are related by AND, both conditions must be true for the specific entry in the Column table to be returned into the Scroll Table view.
• OR — hen conditions are related by OR, either condition must be true for the specific entry in the Column table to be returned into the Scroll Table view.
 Column
 This is the heart of the query table. The query built in the Connector-Column-Operator-Value boxes acts on the field in the database indicated by the Column entry. So, for example, to search for station numbers above a certain threshold, the column pop-up would be set to STATI.STATNUM.
 Much of the work involved in setting up a query involves deciding which column to run the query on.

 Operator
 Contains all of the acceptable logical operators that FieldLog can use. A search condition is satisfied if the entry in individual row of the field specified by the Column pop up matches the entry in the Value field according to the following logical rules:
• > field must be greater than Value.
• < field must be less than Value.
• <= field must be less than or equal to Value.
• >= field must be greater than or equal to Value.
• = field must be equal to Value.
• NOT= field must be not be equal to Value.
• LIKE allows searches based on wild cards. Valid wild-cards in SQL (the foundation of FieldLog) are:
 _ (the underscore character): This wild-card substitutes for any single character in the position indicated. For example, the search STRUC.FEATURE LIKE SFOL_ would return all structural features SFOL1, SFOL2, and so on.
 % (the percent character): This wild-card substitutes for any number of characters in the position indicated. For example, the search STRUC.FEATURE LIKE %1 would return all structural features ending with 1.
• NOT LIKE is similar to Like except that it returns those entries that fail to match the criterion.
• IS acts on hierarchies in profiles within FieldLog. It returns elements that are of the indicated type as well as those that are of types that are subsets of the indicated type. For example, the search STRUC.FEATURE IS BEDDING would return BEDDING, SUBED, S-BED and SOBED features for the structural dictionary in the SnowLake database.
• HAS is the logical complement to the Is operator. It returns elements that are of the indicated type or its super types. For example, the search STRUC.FEATURE HAS BEDDING would return BEDDING, and PLANAR features for the structural dictionary in the SnowLake database.
• INSIDE — if you choose a location field in the Column pop-up (e.g. UTMX or UTMY in the SnowLake database), you can then search for stations inside a specified area. The Area button allows you to interactively specify the target area by clicking on corner points of a polygon.
• OUTSIDE — as with INSIDE, but the query returns features that are outside the area specified using the AREA button.
• NEAR allows a buffer search — it finds all features within a specified distance of aline drawn using the Line button. Specify the buffer distance in drawing units in the value field.
 Value
 This field accepts logical, alphabetic, and numeric entries that must be satisfied by the search condition. For example, if you were querying to find all station numbers greater than 100, you would place 100 in this field.
 Next
 :Selects the entry in the Condition list below the currently selected one. Use next when editing existing conditions.
 Prev
 Selects the entry in the Condition list above the currently selected one.
 Modify
 Overwrites or enters the selected entry from the Connector-Column-Operator-Value fields into the Condition list.
 Delete
 Deletes the selected entry in the Condition list.
 Up
 Inserts a new search condition entry in the Condition list, above the currently selected entry.
 Down
 Inserts a new search condition entry in the Condition list, below the currently selected entry.
 Query
 Runs the query as it is presently entered, as long as the query is valid.
 Cancel
 Closes the query box, cancelling the query.
 For more information on these operators, see the FL-QUERY detail chapter in section 2 of the manual.
2. Select SnowLake from the Project pop-up.
 The only choice in the Query pop-up is the StatBrowse query from chapter 3. We'll make a new query here, so leave the pop-up blank.

3. In the Name box type SfolSearch.
 Choosing the input for a query
 First you must choose the table you want to query and the items in the table that you want included in your query.
1. Select STRUC.FEATURE from the Column pop-up.
 The current line in the Condition box will now query the feature name in the Structure table.  Since this is the field that names the individual structural entities, this is where we can search to eliminate structures that don't meet our chosen criterion.
2. Select IS from the Operator pop-up.
3. Click inside the Value edit box, then click Tree.
 The Tree Selection dialog box appears.
4. Select s-fol1 from the PLANAR>FOLIATION section of the tree.
 S-fol1 appears inside the Value edit box. (If you know the name of the value you want to query, you can type its name directly into the Value edit box.)
 The query we've entered, STRUC.FEATURE IS s-fol1, will find any entries in the structure table that are s-fol1's or dependents of s-fol1. Since there are no dependents of s-fol1 in the SnowLake database, this query returns all s-fol1's.
5. To insert the condition into the Condition table, click Modify.
 Choosing the output for your query
 Now that you've set up your condition and entered it into the Condition list, you must choose the type of output you want. Let's output the results onto snowlake.dwg. In other words, we'll direct the features that meet the query condition — all s-foll's — to be plotted to the map. To output the symbols on the map, FieldLog needs to know:
• STRUC.FEATURE — the feature to be drawn
• STRUC.AZIMUTH — the strike direction of the symbol
• STRUC.DIP — the dip value for the symbol
• STATI.UTMX — the X location
• STATI.UTMY — the Y location
1. In the Output list, select STRUC.FEATURE, STRUC.AZIMUTH, STRUC.DIP, STATI.UTMX, and STATI.UTMY.
 Running the query
 Now that you've selected input and output options, you're ready to run your query.
1. Click Query.
 A message box appears indicating that FieldLog found records that matched your query. Depending on how large your database is, you may have to wait for a few seconds.
2. Click Ok.
3. The Scroll Table dialog box appears, displaying a list of values that match your query. If you move to the bottom of the list you should see the two measurements — me1 and me2 — that you entered into the database.
4. To plot the symbols, select MAP from the Plot pop-up.
The Plot Options dialog box appears, asking which items to plot. Depending on what you're plotting, you may be able to specify parameters.
5. Select STRUC.FEATURE and STRUC.DIP, then click Plot.
FieldLog plots the output. When it's finished, FieldLog displays a message indicating the number of records it plotted and warns of any values it couldn't plot.
6. Click Ok.
 Your map should now contain a large number of foliation measurements (they'll show up in red if had the layer s-fol1 set to red).
 With a plotter hooked up, you could print a quick plot of first phase foliations — a custom map in less than 10 minutes! And if you named the query, it would take less than a minute to reuse the query.
 We've covered a lot in this section. The possible Operator choices in FieldLog are a bit intimidating at first, but remember that these options are the key to FieldLog's power and flexibility. Take some time to try each one out.
 Now let's try another query, picking an area on the map using the Inside operator.
 Performing a spatial query
 Now that know how to perform a simple query, you're ready to perform a more sophisticated query — a spatial query on a selected area of your drawing.
 Spatial queries are key features of G.I.S. software — any database can do queries such as finding all s-fol1's. But few databases can find all s-fol's within a highly irregular area. The advantages of FieldLog are the geological nature of the database (essentially, the fact that you can build hierarchies of relationships based on geologically meaningful relations rather than simply having long lists of independent terms) and the ability to do spatial searches just as an advanced GIS package would. If fact, because you can express your spatial queries using hierarchical relationships, FieldLog easily beats high-end GIS packages in terms of ease of use.
 Before you begin the query, use AutoCAD's zoom command to set your view so that the island containing stations me1 and me2 is on the right extremity of the screen and fills about 5% of the screen width.
 Selecting a query area on a map
 In this query, you'll pick an area on your drawing and ask FieldLog to list all of the existing structural measurements for that area.
1. Type fl-query in the AutoCAD command line or select it from the FieldLog menu.
2. In the Query database dialog box, select SnowLake from the Project pop-up.
3. In the Name field type StrucArea
4. To choose an area, then select STATI.UTMX from the Column pop-up. One limitation of the Area operator in FieldLog is that it must operate on a field that contains location information of some sort.
5. Select Inside from the Operator pop-up.
6. Click Area.
 FieldLog replaces the Query dialog box with a view of your drawing.
7. Click three or more points to define a polygon enclosing your area of interest. Make sure you choose a fairly large area so that your query finds some stations.
8. To finish adding corners, press Enter.
 This closes the polygon and returns you to the Query panel.
 The Value box should say AREA. This indicates that FieldLog has stored a list of corner points collect from the map.
9. To add the query to the Condition table, click Modify.
 The Query should now appear in the list box.
 Selecting data
1. Select the following in the Output list:
STATI.UTMX
STATI.UTMY
STATI.STATYPE
STATI.STATNUM
STRUC.FEATURE
STRUC.AZIMUTH
STRUC.DIP
2. Click Query.
 The Scroll Table dialog box appears, listing a group of points.
 Your specific display may differ from the one shown above, because it's likely you'll have chosen a different area of the map. If no points appear, you chose an area with no measurements. Return to fl-query and rerun StrucArea on a larger section of the SnowLake map.
 Plotting data
 Next, you'll add all measurements found by the query to the map view. Remember that FieldLog maintains the geological database independent of the map, so that you'll routinely add and remove symbols from the map as you do cartographic work and analysis.
1. To plot the data, select MAP from the Plot pop-up.
 The Plot Options dialog box appears.
 Notice that, depending on the parameter, Plot Options allows you to override projections, assign symbology, and redefine projections on the fly.
2. Select STRUC.FEATURE, STRUC.DIP, STATI.STATNUM, and STATI.STATTYPE, then click Plot.
3. Zoom in on the new data.
 Note that FieldLog has placed a variety of different data types on the map — station numbers, structural symbols, and dip values. If you check out the layer structure within AutoCAD you'll see that the symbols are layered by type. The layering is defined in fl-setup, but can be overridden within the Plot Options dialog box.
 Performing a compound query
 Finally, let's do a compound query. A compound query finds data that fulfills the conditions contained in two or more separate condition rules. Here is our query, in geological terms:
 Query in geological terms
 Translated to FieldLog query
 Find all of the pillow basalt outcrops that have a planar structural measurement associated with them.
Condition 1: LITHO.ROCKTYPE is Pillow Basalt
Join: and
Condition 2: STRUC.FEATURE is planar
 Before you begin, use AutoCAD's zoom command to zoom to the extents of your map. If FieldLog is not loaded and/or you are not logged on to the SnowLake database, do so now.
 Beginning your query
1. Type fl-query in the AutoCAD command line.
2. In the Query database dialog box, select SnowLake from the Project pop-up.
3. Name the query PBStruc
 Setting up rules
To set up a rule requiring all selected stations be Pillow Basalts:
1. Select LITHO.ROCKTYPE from the Column pop-up.
2. Select is from the Operator pop-up.
3. Click List, then choose Pillow Basalt.
4. Pillow Basalt should now be displayed in the Value edit box.
 This selects all stations where a pillow basalt was observed.
5. To add the rule to the Condition table, click Modify.
6. To insert another rule, click Down.
 You must establish a relationship between the second rule and the first. To get results that fulfill both rules:
7. Select AND from the Connector pop-up.
8. To choose only basalt samples, select STRUC.FEATURE from the Column pop-up.
9. Select is from the Operator pop-up.
10. To get a list of available lithologies, click Tree.
11. Select Planar, then click Ok.
12. Click Modify.
13. Select the following output values:
LITHO.ROCKNUM
LITHO.ROCKTYPE
LITHO.CLRWEATH
LITHO.CLRFRESH
SAMPL.REASON
STATI.UTMX
STATI.UTMY
STATI.STATNUM
14. To submit your query, click Query.
 The resulting scroll table should look similar to the one shown below.

 Exporting query results
 Now you'll export the resulting records to a text file. This might be useful for preparing a report, exporting data into another program, or archiving subsets of a database.
 To export the query results to a text file:
1. Select Text.txt from the Plot pop-up.
2. For output, select all items except for those ending in .BASENUMBER. These are internal FieldLog record numbers and aren't useful outside of the program.
3. Select UTM ZONE 14 NAD27 from the Projection pop-up.
 Notice that, once again, FieldLog allows you to re-project data or, in this case, export data. This can be crucial for:
• exporting data into programs that can't handle user grids
• matching specific data format requirements
• standardizing data archives
4. Type c:\snowlake\snow.txt in the File Name edit box (assuming you've put your sample data in the c:\snowlake\ directory.
5. To output the data to the text file, click Plot.
 A message box appears, indicating that FieldLog has plotted the records.
6. Using a text editor or word processor, open up the text file you just created (in this case c:\snowlake\snow.txt).
 The text file should contain the same information as the scroll table.
 That's it! You've done simple, spatial, and compound queries — outputting the results to a table, a map, and a text file. The fl-query command is powerful yet relatively simple. As you get more familiar with FieldLog you'll begin to naturally think in terms of how to express queries.

 Conclusions
 In this chapter you learned how to:
• Manipulate the colors of entities by AutoCAD layer
• Perform a simple query
• Perform a spatial query.
• Perform a compound query
• Export data to a text file
• Plot database data to the map view