The Data Window and Attribute Data
The data window gives you access to the attribute, or nongraphic, data in your feature class tables and provides you with a suite of tools for viewing and editing your data. Nonspatial attributes are linked to geometry in such a way that, when the same feature class is displayed in both a map and a data window, selection of a map object in the map window locates its corresponding attribute information in the data window. Conversely, when a feature record is selected in the data window, its geometry is highlighted in the map window.
The relationship of the graphic and nongraphic attributes of features allows you to work on the spatial and nonspatial characteristics of a feature simultaneously. The GeoMedia application takes care of synchronizing the data by immediately applying updates in one window to the other in read/write warehouses.
The display of features in the data window can be customized with the Data View tools. To accommodate the requirements of your workflow, you can specify which columns appear and which are hidden, and how records are sorted. Data window tools can generate statistics, including value range, average, variance, and standard deviation for any column that contains numeric data. These tasks are accomplished in the data window display and do not impact your source data. Therefore, the data may be read-only or read/write.
The data window contains commands for printing your data, and for producing snapshots of the data that can be pasted onto any OLE-compliant application. Attribute values displayed in the data window can be copied and pasted into other applications as well.
The largest range of data window functionality is available when source data are stored in Access warehouses. You can use only the full toolset when you have write access to your data. Editing tools are not available if your attribute is accessed via a read-only connection or resides in a read-only warehouse. Data are stored in an Access warehouse in tables. An Access database that serves as a GeoMedia warehouse consists of a variety of tables that conform to the relational database model and to the GDO model. (See Chapter 38 for a discussion of the GDO model and Access databases.)
The tables you have direct access to within the application are those that represent feature classes. Feature class tables are typically created in the Feature Class Definition dialog, or imported from another data source such as an MGE project or an ARC/INFO coverage. Each table consists of a structure that stores information about a group of features that share a set of properties. For example, a feature class called "airports" might consist of information about each airport’s name, elevation, service area, congestion level, number of runways, hub size, tower type, and so on.
Whether you create tables from scratch or import features from an external data source, GeoMedia builds feature class tables that consist of a geometry type, and attributes and their data types. This is the table structure. This structure defines what type of information each record can contain and how the information will be stored. The content of the table are the records. Each record represents a single feature instance consisting of the spatial and nonspatial attribute values that describe that feature.
Attribute Versus Spatial Data
The GDO data model processing specifications for spatial data require the differentiation of spatial attribute data and nongraphic attribute data. Spatial data (geometry and spatial indices) are attribute values of a feature, or record, in a feature class or a relational database table. However, the spatial and nonspatial components of a feature instance are treated differently within the GeoMedia application on two levels.
On one level there is the difference between defining attribution for columns that contain spatial data versus those that contain nonspatial data. When you select a geometry type for a feature class, the Geometry column (the attribute) for the table is created through Automation, as required by the GDO model. You have no control over the attribute name or its data type.
Although you add geometry (the attribute value) by placing features (or digitizing) in the map window, you have no direct access to the Geometry column in the feature class table. Contrast the creation of the Geometry column with the definition of nongraphic attributes. They are named and their data types specified entirely by the user and are only required to conform to broad relational database model constraints.
The second level of difference between spatial and nonspatial attributes relates to the storage, preprocessing, and post-processing of geometry data. Geometry is stored in a feature record as a binary large object, or "blob" data type. A blob is a serial data stream that contains the geometry type, geometry object, coordinate points, and so forth.
Blobs, however, are not map objects. When you add a feature class to the map window legend, the blobs stored in the feature class table must be processed to generate geometry objects. The reverse occurs when the geometry is written back to the table. It must be converted from a map object to a blob. Of course, this is not the case when nongraphic attribute values are being retrieved, manipulated, or stored.
The point of all this is simply to make it clear that spatial attributes are there in the feature class, but not necessarily in the user interface. The GeoMedia application, and the data window tools specifically, prevent you from making direct contact with the geometry of your features.
Working in the Data Window
Each data window consists of a matrix of cells, each containing the nongraphic attributes of a feature class or query. Each column represents an attribute and each row represents a feature instance belonging to the feature class. The information in each cell is called a value or an attribute value. In the data window you can select individual cells, rows, columns of cells, or the entire database table for manipulation.
Any number of data windows can be open in the GeoWorkspace for viewing feature classes, as can any combination of map and data windows. When a data window is active, the Main Menu bar options change, and the Legend menu is replaced with the Data menu.
Manipulation of the Data Window
GeoMedia’s Microsoft Office compatibility ensures that the data window behaves like any other Windows-based application. If you are already familiar with working in Windows NT/95/98, you will notice the similarity.
Opening a Data Window
To open a data window, you must have a connection to either a read-only or a read/write warehouse. If the connection is read-only, all editing tools are disabled. However, you can review a feature class and manipulate how it is displayed in the data window. On the Main Menu bar, click on Window > New Data Window. The New Data Window dialog box is shown in the illustration at left.
The text you enter in the Window Name field is used on the title bar of the data window. When the window is maximized, this name appears on the application title bar. When the data window is any other size, the name appears on the data window title bar. It will also be added to the bottom section of the Window menu on the Main Menu bar where all open windows and the active window are listed. This entry is optional. When no entry is made, window names default to DataWindow1, DataWindow2, and so on.
Your warehouse connections are listed in the second portion of the dialog. Expand the warehouse list trees and select a feature class for display. Notice that Queries is a selection in this dialog. When a query is chosen, it will be rerun if it is not currently in the map window legend. Clicking on OK ends the dialog and opens the new window and makes it the active window. A new data window is shown in the following illustration.
ORIGINAL GRAPHIC Fig. 21-2
When a data window is active, the Main Menu bar changes. The Legend menu is replaced with the Data menu. When menu selections you expect are not available, make sure you have not changed the focus to a map window.
Controlling the Data Window
The data window icon appears either to the left of the data window title or in the upper left corner of the Main Menu bar when the data window is maximized. It contains the standard window control menu. This menu allows you to restore a minimized window. You can also move, size, minimize, or maximize the window. From this menu you can close the data window, or you can move the focus to another open window using the Next command. The options that are available depend on the current state of the data window.
A second way to control the data window is via the Window menu on the Main Menu bar. It contains commands to open new map and data windows, and to cascade or tile open windows. All open windows in the GeoWorkspace are listed at the bottom of this menu. A check mark appears next to the title of the active window. To activate a different window you select it from this list.
Data Window Properties
Another selection on the Window menu is Data Window Properties. This command activates a dialog that allows you to name the data window. Just type in a new name and click on OK. This dialog renames the active data window.
Printing the Contents of the Data Window
When you print the contents of the active data window, the report consists of a title (the feature class name), column headings consisting of the attribute names, and gridded cells containing the attribute values for each feature. The feature records print the way they are formatted in the window. The records will be arranged in the report according to the sort order in the data window. Columns that are hidden are not output to the report. You have the option of printing all features in the feature class or of specifying a particular range of records to print.
The Print dialog is that common to most Microsoft applications. To print, activate the correct data window. On the Main Menu bar, select File > Print. Fill in the rest of the print dialog parameters. Select your printer name, enter the number of copies you want, and choose to print all rows or enter a range. The draft print quality and collate parameters are available only if your printer supports those options.
A Data Page Setup dialog is provided to set other print options such as margins, scale, paper size, and printer properties. Print parameters of map and data windows are independent of each other. Changes made in the Data Window Page Setup dialog are not applied to the Map Window Page Setup. This allows you to assign a different printer or plotter, orientation, and paper size to each type of window. The parameters are stored and reused for all print jobs.
Printing the Data Window to a File
This is an option in the Print dialog that saves print commands and data to a file instead of sending it directly to a printer. The file can then be transferred to a computer attached to a printer you want to use, or printed from a computer on which GeoMedia is not installed.
On the Print dialog, set up the options previously discussed and click on the "Print to file" checkbox. When you click on OK, you can navigate to the file system location where you want to write the print file.
Snapshots
Clicking on Edit > Snapshot on the Main Menu bar or selecting Snapshot from the data window pop-up menu creates an image of the data window. That picture can be pasted into any application that supports Object Linking and Embedding, such as Word or Excel. A snapshot is what you see is what you get, meaning that the content of the active window is copied exactly as it appears in the display. Hidden columns and cells containing hypertext are not copied. Columns that are not visible in the data window are not included in the image. Selected rows, columns, and cells have no effect on what is copied.
Both the left and right mouse buttons are enabled when you work in the data window. The left mouse button is used to activate a window by clicking in the window or on its title bar. The left mouse click is used to create a select set consisting of an entire table or specific feature instances. It is also used to select a row, column, cell, or the content of rows, columns, or cells for editing, copying, or deleting.
Right clicking in the data window produces the data window pop-up menu. This menu contains tools for cutting, copying, and pasting; manipulating columns; changing the data window contents and window properties; and inserting, editing, and opening hypertext. It is context sensitive. The available commands vary as a function of the status of the data window. GeoMedia works with Intellimouse, wherein the middle button and roller ball are used to zoom in or zoom out.
Selecting Input for Data Window Tools
Two sets of tools are available when you are working in the data window. One set, the Data View tools, operates on either rows or columns. They affect the data window display and have no affect on the data in the source warehouse. The other set of tools consists of the standard Windows editing tools, Copy, Cut, and Paste. Executing these commands causes the database to be automatically updated.
These tools are grouped together on the Data menu on the Main Menu bar, on the Data toolbar, and on the Data pop-up menu. However, their availability is a function of the selection technique used to identify records, columns, individual cells, or groups of cells. This is an important distinction to be aware of. The Data View tools are enabled only when an entire row or column is selected with the selector buttons. For rows, the selector button is the one at the left of the record. For columns, the selector button is the column heading. The following illustration shows data window pop-up menu options when columns or rows are selected.
ORIGINAL GRAPHIC Fig. 21-3
Cut, Copy, Paste, Delete, and attribute editing are available only when a cell is selected with a left mouse click, or when cells are selected with a click and drag. In both cases, a heavy black border is displayed around the selection and the editing tools are enabled. (See the following illustration.)
ORIGINAL GRAPHIC Fig. 21-4
All rows and columns in a table are selected by clicking on the row selector button on the left of the column headings row. When the entire table is selected it highlights and the Delete and Delete Geometry buttons on the Placement and Editing toolbar are activated. You can delete only the feature geometry or you can delete all feature attributes, including geometry. These commands affect all features in the feature class.
A single row or a set of adjacent or nonadjacent rows can be selected. To select one row, click on the row selector at the left of the record. To select a set of adjacent rows, click on the row selector button of the first record. With the mouse button depressed, drag on the row selector buttons for the records you want to include. You can also select multiple adjacent rows using the Shift key. Select the first record, then while holding down the Shift key click on the last record. All intervening records will be highlighted. To select nonadjacent features, click on their row selectors while holding down the Control key. When you click on a selected row with the Control key depressed, the row is removed from the select set.
Rows selected by any of these methods can be promoted. That is, they can be moved up in their sequence in the data. They cannot, however, be copied, cut, pasted, or edited. The only time those commands are enabled is when the rows, or parts of rows, are selected by dragging the mouse cursor across the desired range of records. When you select records by dragging, a bold black line fences in the selected records.
To select a single column, click on the column heading. To select a disjoint set of columns, click on the headings with the Control key depressed. A contiguous set of columns is selected by dragging the cursor from one heading to the next while holding down the left mouse button. You can also use the Shift key to select a range of adjacent columns. When columns are selected one of these ways, they can be hidden. When a single column is selected, sorting and statistics are available. To copy, cut, and paste, column content must be selected by clicking and dragging the cursor.
Click on a cell to select it. If the cell contains hypertext, it will be activated. To select data in a cell for editing, highlight the cell content by clicking in the cell. Adjacent cells are selected by clicking in a cell and dragging to extend the selection. These cells can be copied, cut, or pasted.
Unselecting Cells
To remove all objects from a select set, click on Edit > Unselect All on the Main Menu bar. Clicking anywhere in the data or map window also clears selections.
Editing Cells in the Data Window
All commands you can execute in the data window involve the attribute values of a feature or features. Most data window operations have no effect on the records stored in the source warehouse. Editing attributes, however, does.
Editing is performed in a read/write warehouse by selecting a single cell and updating its contents. Edits can also be performed with any combination of standard Windows tools for copying, cutting, deleting, and pasting one or many cell values. Changes made to attributes by any of these methods are immediately posted to the database. The exception is cells that are hidden or that contain hypertext. Hidden fields cannot be edited. Fields defined as hypertext must be updated with the Insert > Hypertext dialog, which can be activated from the Main Menu bar, or from the Placement and Editing toolbar.
The Copy command copies nongraphic attributes to the Clipboard as text. A cell or a group of cells can be copied in the data window and pasted in a different data window or in another application such as a Word document or an Excel spreadsheet.
Copying Cells or Blocks of Cells
To copy a cell or a group of cells, make a selection using the click-and-drag method. The selected cells will highlight. On the Main Menu bar, click on Edit > Copy. Alternatively, you can right mouse click and select Copy from the pop-up menu.
You must use the click-and-drag method to select data to paste into Excel (or similar application). Other methods of selecting data will not work. Selecting a row by clicking on the left button, or selecting a column by clicking on the heading, or selecting the entire data by clicking on the button in the upper left will highlight the data cells but will not make these eligible for copying and pasting.
The option for copying the data on the Edit menu drop-down will not be available unless the proper click-and-drag selection method has been used. You will also not be able to copy and paste if you use the Edit menu option of Select All (rows). If you use the click-and-drag method, you can copy the data using either Edit > Copy (by pressing the Control key and the number zero (Ctrl+0), or by pressing the Control key and the letter C (Ctrl+C).
Pasting the Data Window
Paste is run from the Edit menu on the Main Menu bar or from the pop-up menu in the data window. Pasting data in a data window copies the content of the Clipboard to cells in the target data window. It replaces the values in the target cells only when pasting complies with database rules. If the paste populates required fields and creates a unique primary key, a new feature is created in the database. Cells containing hypertext or read-only values cannot be pasted over in a data window. Pasting is disabled when the Clipboard is empty. When the paste causes duplication of values in the key field, you receive the warning shown in the first illustration at left.
There is no way to recover from this error. Clicking on No in response to the "discard changes" prompt has no effect. The paste is not executed. When a paste would produce null values for a required field, you have an opportunity to remedy the situation. Clicking on No in response to the "discard changes" prompt takes you to the required field, where you can enter a key value and save the paste operation. The second illustration at left shows the warning generated when pasting fails.
Paste will also fail if the data type of the source and target cells do not match. There is no recovery from this error. The following illustration shows the warning that appears when data conversion is invalid.
Pasting fails when the shape of the target location does not match the source. Paste wants to populate cells using the target cell you click in as the upper left corner of the block of cells. From there it looks for cells to the right if there are multiple columns on the Clipboard, and down when there are multiple rows. When the right number of target cells does not exist, you receive the warning shown in the following illustration and the paste fails. It cannot create new rows or columns.
ORIGINAL GRAPHIC Fig. 21-9
Cutting Data Window Data
Cutting data in the data window removes the attribute values from the selected cells and places those values on the Clipboard. It is the use of the Clipboard that distinguishes Cut from Delete. Values that are deleted are not written to the Clipboard. Cut is available when source cells have been selected. It is accessed from the Edit menu on the Main Menu bar or from the data window pop-up menu. Cutting fails if you attempt to cut the primary key.
Deleting Cells in the Data Window
The Delete command removes selected attribute values from a feature or features. The Delete command is available on the Edit menu on the Main Menu bar and from the Delete button on the Placement and Editing toolbar. The Delete command does not copy the deleted values to the Clipboard, and therefore cannot be undone. Unlike the Cut command, Delete can remove features selected with the row selector button. The Undo command is available in the data window for attributes in the last record modified, as long as you have not moved the cursor out of that row.
Inserting a Feature Using the Data Window
New features are added to a feature class by typing attribute information in the last row in the data window. Because you can enter only nongraphic attribute values, the new features will not have any associated geometry. The graphics are added in the map window using the Continue Geometry command. See Chapter 26 for information on adding geometry.
Data View Tools
The Data View tools operate on either rows or columns. They affect the data window display and have no affect on the data in the source warehouse. Data views persist for the duration of your session. The settings are lost when you close the GeoWorkspace.
The data view tools promote rows and show, hide, sort, and display statistics for columns. They are accessed from the Data menu on the Main Menu bar, from the Data toolbar (shown at left), or from the data window pop-up menu. These tools are available only when a data window is active. They are context sensitive in response to what has been selected in the data window and how it has been selected. They are enabled only when one or more rows or one or more columns have been previously selected. The Data View Show command is the exception. It is always enabled.
Showing Columns
The Show Columns command allows you to condense and expand the content of the data window by selecting the columns you want to display. By default all columns are displayed. The display of columns you are not interested in can be turned off, and columns that have been hidden can be added to the window. This command has no effect on data in the source warehouse.
The Show Columns command is not dependent on a selection in the data window. It is available on the Data menu on the Main Menu bar and on the data window pop-up menu. The Show Columns button is the leftmost icon on the Data toolbar (see previous illustration). The Show Columns command displays a dialog box (illustration at left) containing all attribute names for the feature class in the active data window. Each attribute is associated with a checkbox. When the box is checked, the attribute values for that column are displayed. When it is unchecked, display is disabled for that column.
Hiding Columns
The Hide Columns command is an alternative to the Show command for disabling column display. This command is enabled only after a column has been selected. You interactively select a column, or a set of contiguous or discontiguous columns, and click Hide Columns on the Data menu or the data window pop-up menu. You can also hide a selected column by clicking on the Hide button, the second from the left on the Data toolbar.
Sorting Columns
The records in the feature class can be displayed based on a sort on the attribute values of one of the columns in the class. You could, for example, request county features arranged with the highest precipitation at the top of the data window; you could request parcel features in order of their assessed values from lowest to highest; or you could request features listed alphabetically. The sort commands will perform all of these. Sorts affect only the display order of features. They have no effect on the tables in the warehouse. Sorts can be performed only when a single column is selected. When multiple columns are selected, sorting is disabled.
Sort Ascending
Sort Ascending sorts attribute values from lowest to highest. For example, from 0 to 9 or from A to Z. In the active data window, select the column containing the values you want to sort on by clicking on the column heading. Click on the Sort Ascending entry on the Data menu or on the data window pop-up. The Sort Ascending button on the Data toolbar is the center button.
Sort Descending
When you want your features sorted from highest to lowest attribute value, such as 9 to 0 or Z to A, select Sort Descending. Select the column to sort on and select Sort Descending from one of the two menus or from the Data toolbar. The Sort Descending button is the second button from the right.
Promoting Rows
Promoting rows moves them to the top of the data window. You can select a single feature, a group of adjacent records, or a group of nonadjacent records. With the row or rows selected, click on the Promote Rows command on the Data menu. The Data menu is the only place where this command is available. Like the other Data View tools, promotion has no effect on the rows in the table, and it persists only until the workspace is closed.
Column Statistics
Column Statistics is a read-only display of summary information about the attribute values contained in a selected column. The Column Statistics display, shown in the illustration at left, reports the number of records in the feature class, and the number of records that contain a value for the selected attribute. It determines the minimum and maximum values in the column and computes the range. Column Statistics also calculates the sum, average, variance, and standard deviation for the data values in the column.
ORIGINAL GRAPHIC Fig. 21-12
The Column Statistics command is available only on the Data menu on the Main Menu bar.
The Load Data command is only found on
the pop-up menu produced by right clicking in the data window. It is used
to load previously ‘unloaded’ data. The data window will be in the unloaded
state under the following circumstances. You have selected the ‘Do not
load data when opening GeoWorkspace’ option on the General tab of the Options
dialog. And you have saved the GeoWorkspace with an open data window. When
the workspace is reopened, the data window will be empty. To repopulate
the data window you must right click in the data window and select Load
Data from the pop-up menu. The unloaded state applies to the map window
legend as well and is discussed in Chapter 11.
Changing Data Window Contents
You can replace the contents of the data
window with another feature class with the Change Contents command. The
Change Contents dialog presents you with tree listings of the feature classes
in each warehouse connection. The dialog is available from both menus.
It can also be run by clicking the right button on the Data toolbar. In
the following workflow exercise you will practice working with the data
window.
Undo
The Undo command is found on the Main Menu bar on the Edit menu. There is also an Undo icon, shown at the left, which can be added to an existing or a new toolbar. See Chapter 10 for the procedures for creating and modifying toolbars.
New graphic hgm9_1.tif
Caption Undo icon.
When applied to the data window the Undo
command is rather limited, but it will replace the contents of the last
data window cell you changed, provided that you have not moved the cursor
to a new row.
The data window gives you access to nongraphic attribute data in table format. In a table there is a row of data for each feature. The rows consist of cells. Each cell contains one piece of attribute information about the feature. The information in each column is defined by a data type and length. Attribute data can be associated with a feature class or with a query. You can view graphic data and attribute data simultaneously by way of the map window and the data window linkage. Multiple data windows can be opened to view various tables simultaneously.
In this exercise you open and modify the contents of a data window. You will need a warehouse connection to the Census.mdb database.
Note that both the Main Menu bar and the available toolbar buttons change when the data window (shown in the following illustration) is active. The functionality available is that appropriate to nonspatial attribute data. The tools and commands available are always a function of the active window.
ORIGINAL GRAPHIC Fig. 21-14
The selected records are moved to the top of the data window. The arrangement of records within the table is not changed by this command.
Data and Map Window Linkage
When you have a data window containing the nongraphic attributes for a feature class, and the same feature class’s map objects are displayed in a map window, each window is linked to the other. When map objects are selected in the map window, their associated records are highlighted in the data window. When a record is selected in the data window, the graphics for that feature are highlighted in the map window.
In this exercise you will investigate the relationship between GeoMedia’s handling of spatial and nonspatial data via the linkage between map and data windows. Open a connection to the Census warehouse and add the feature class blocks_stf1bx to the legend.
3. Display the locations in the map window associated with records in the data window. Holding down the Shift key, click on the left buttons for the first four records in the data window.
5. Display attribute data for a feature in the map window. Click on any block in the map window.
Options That Apply to Data Windows
There are no default settings specific
to data windows.