5
Overview of Warehouse Connections
Accessing Warehouse Data
The power of GeoMedia lies in the fact that it is a universal geographic client where data in different formats from different sources are combined into one spatially uniform environment for viewing and analyzing that data. For example, you can simultaneously view data from MGE, Oracle, and Access in an integrated map.
You combine data by connecting to data servers. Connections are the links between the work environment and your data warehouses. They ensure the accuracy of the spatial environment by providing the GeoMedia application with information about your data servers. The types of data servers you can currently connect to follow. Within the connection dialogs you can open new connections, change the connection status, edit existing connections, and delete connections.
• CAD
• ARC/INFO
• ArcView
• FRAMME
• MGDM
• MGSM
When you have a GeoWorkspace open and configured the way you want it, the next step in any workflow is to associate the workspace with some data. Remember, geographic data is not stored in the workspace. Features are accessible only through a connection to a data warehouse. Therefore, at least one warehouse connection is required for a workspace. From your point of view, a connection is simply a link to a data warehouse that passes information to the GeoMedia application about the server, the type of access you have to the server, and events that occur on the server.
Although at least one warehouse connection is required, your workflows may frequently require simultaneous workspace connections to many warehouses. You can set up many connections to different warehouses, but you are not allowed to have more than one connection to a single warehouse.
A connection consists of a connection type, a connection name, an absolute path to the database location in the file system, an access mode, and optionally a description and a spatial filter.
Connection type refers to the type of warehouse you are connecting to. You select a type from those discussed in Chapter 4. Note that some warehouse connections cannot be properly made until some setup steps have been taken. Almost all of the servers except Access, and in most cases MGE, require that configuration parameters be predefined and stored in a specified location in the file system. The details of server parameter file setup are discussed in Chapters 6, 37, and 40. For the purpose of introducing you to warehouse connections in this chapter, it will be assumed that these files exist.
Every connection is given a name. The Connection Wizard will provide you with a default name when you establish a new connection. Connections are numbered sequentially by type, and assigned a name in the format Access Connection # or ArcView Connection #, for example. However, when you set up a new connection, you are allowed to give the connection a name.
Although this may seem trivial at first glance, connection names are really an important tool for keeping track of the location of various feature classes. As your workflow becomes more complex, you will find that naming connections (like naming workspaces, legends, and queries) eliminates the need to hunt through long tree listings looking for the feature you need.
A spatial filter is an object used to restrict what is brought into the map window. It is a "fence" that tells the Connection Wizard which features to display and which to exclude from the display. When a filter is applied to a warehouse, the display of all feature classes is limited to the defined area. Filters are an optional component of a connection.
A rspatial filter is defined interactively in the map window, and can be named and saved in the GeoWorkspace. A spatial filter can be applied to any warehouse connection in your workspace. Working with rspatial filters is covered in detail in Chapter 7 "Using Connection Spatial Filters".
Connection status tells GeoMedia whether to open the connection read-only, read/write, read/import, or to leave the connection closed upon completion of the dialog. The type of warehouse to which you are trying to connect will restrict connection status. By definition, MGE, FRAMME, ARC/INFO, ArcView, MapInfo, ODBC Tabular, and CAD warehouses cannot be updated in GeoMedia and can therefore be linked to a workspace only via a read-only connection. This is also true for SQL Server connections in GeoMedia. This data server can be opened read/write in GeoMedia Pro. Connections to Access databases can be read/write or read-only. Oracle databases, which also can be opened read-only, are the only ones that can be opened with a read/import status in GeoMedia. Oracle connections in GeoMedia Pro can be defined as read/write connections.
See GeoMedia Pro section for more info"
In addition to the restrictions imposed on connection status by server type, there is a restriction imposed by the file system on your computer. If a writable database resides in a location you do not have permission to write to, it must be opened read-only. When you specify a read/write connection to a warehouse you do not have write permissions for, the Connection Wizard fires off an error message and is dismissed. It appears that the process is aborted. Be aware that in reality the connection is established, but remains closed. To re.gify the situation, you need only run the Edit Connection dialog and change the connection status from closed to read-only.
Note. It is especially important to remember this when connecting to data on CDs. This data is always read-only. Connecting to it with a read/write status will result in a connection with a ‘closed’ status. That is, you will not be able to access the data until you edit the connection and change the status to read-only.
Another Note. Another gotcha with data from CDs. Any file that you copy from a CD to a new directory on your computer is copied with the Read-only flag turned on. From Windows Explorer, you will have to find the file, right click on the filename, and select Properties from drop-down menu. On the General tab of the Properties dialog make sure that the Read-only attribute is turned off (unchecked).
The alternative to the open status options is to establish the connection, but leave it closed. There are two reasons for leaving connections closed. First, it saves you a substantial amount of time when you are setting up connections to many large data servers. Second, you must do this when your workflow requires access to multiple FRAMME or MGSM warehouses. GeoMedia restricts you to one open connection for those servers at any time. Therefore, the others must be closed.
In order to create a new connection, you need to know what type of connection you want to make, the name and location of the database, which spatial filter to use (if any), and whether the connection should be opened or kept closed.
Using the Warehouse Connection Wizard
The Warehouse Connection Wizard guides you through the connection setup. The Connection Wizard must be run once for each connection you need to set up. There is an exception to this rule in the case of new warehouses. When you create a new Access warehouse, your workspace is automatically connected to that warehouse. The connection is given the name of the warehouse. The following sections explore the Wizard. It is accessed from the Warehouse menu on the Main Menu bar by clicking on Warehouse > New Connection.
On the first page of the Warehouse Connection
Wizard, shown in the following illustration, you select the type of warehouse
to which you want to connect. Highlight the desired server type and click
on the Next button. If a data server you need is one of the servers delivered
with GeoMedia and does not appear in this selection box, you can add it
by reinstalling GeoMedia.
Naming
a Connection
and Locating the Database
The second page of the Wizard allows you
to name the connection by typing in a new name. It is highly recommended
that you give your connections meaningful names. The Wizard defaults to
naming connection DataServerType1, DataServerType2, and so on. You
set the search path to the database by navigating to its file system location
using the Browse button. You can optionally provide a text description
of the connection. This process is indicated in the following illustration.
Click on Next to proceed to the next page of the dialog.
The options in this dialog are to access
all features in the warehouse or to apply a filter, as indicated in the
following illustration. In order to use a filter at this stage, a filter
must have been previously saved in the workspace. When there are defined
filters in the workspace, the entire dialog is available. If there are
none, your only choice is to access all features.
This, however, is not the only opportunity you have to apply a filter. Other options for doing so are discussed in the sections that follow.
Selecting the Connection Status
The three radio buttons in the Connection
Status dialog, shown in the following illustration, offer you a choice
of the mode for opening the connection. If you select an inappropriate
open mode (e.g., you select open read/write for a read-only warehouse),
you will receive an error message from the wizard. Although it appears
that the process has failed, the connection has in fact been created. However,
it remains closed until you correct the problem that caused the error.
Click on Finish to complete the Warehouse Connection Wizard dialog.
A warehouse connection must be established in order to view feature data in GeoMedia or to import data into an Access Warehouse. In this exercise you will make a connection to such data. GeoMedia can connect to data developed in ARC/INFO, ArcView, AutoCAD, MGE, FRAMME, Oracle, MGE Segment Manager, MGDM, MapInfo, and SQL Server. It can also connect to data that has been imported from those sources to a Microsoft Access database. With the exception of data in Access warehouses, source data cannot be modified in GeoMedia See Section XI for a discussion of the extended capabilities of GeoMedia Pro.
GM Pro icon here.
Remember, changes to projections, symbology, queries, and so on are stored in your GeoWorkspace, not in the data warehouse. To begin, open a new GeoWorkspace. You will need read/write access to the parcels.mdb warehouse for this exercise.
3. Define a connection name. Type in parcels as the connection name.
5. Select a database file. Click on Browse and navigate to the directory where your warehouses are stored. Click on parcels.mdb. Click on Open.
You have now set up your GeoWorkspace and its projection, and you have established a connection to an Access data source. At this point your coordinate system is set, and you have a blank map window and a blank legend.
An existing warehouse connection can be
displayed, edited, or removed from the workspace in the Edit Connection
dialog, shown in the following illustration. The dialog is accessed by
clicking on Warehouse > Edit Connection on the Main Menu bar. This dialog
displays all warehouse connections, and provides you with limited editing
capabilities. The connection can be edited to change its status to closed
or open. The file system path to the warehouse can be changed. This dialog
also allows you to delete connections no longer needed. The connection
name is the only value that cannot be modified. If you need to change the
name, you must close and delete the connection, and then rebuild it with
the new name.
The New button on this dialog takes you directly to the Warehouse Connection wizard. The steps you save by adding connections through the Warehouse Connections dialog (compared with accessing the wizard from the Warehouse menu) and the fact that you can see the connections you have already built makes this dialog a more efficient tool to use when you need to add many connections.
There are three fields in a warehouse connection
that are editable. They are Connection Status, Spatial
Filter, and Location. Connection Name
and Type cannot be changed. If you have to modify one of these two connection
components, you must delete the connection and rebuild it. Open connections
cannot be edited. You must close the connection.
There are three ways to edit a connection. First, you can directly edit the Status and Connection filterSpatial Filter fields in the dialog. Clicking in the Status field produces a down arrow that turns on a spin box containing the read-only, read/write, and closed options. If the legend contains feature classes from the warehouse whose connection is being closed, the features are removed from the map window and the legend entry is marked as "Connection is closed" (the red ‘X’). When a closed connection, with entries in the legend, is reopened, the feature classes are reloaded into the map window and the legend entry is restored to a normal state.
The down arrow in the Default spatial filter field gives you access to a list of filters saved in the workspace. To add or change a filter, simply click on the desired selection. There is a blank entry at the end of the filter list. It is used to remove a filter from a warehouse.
The second way you can edit connections is to rerun the Connection Wizard by clicking on a connection to select it and clicking on the Edit button. The Edit button starts the second panel of the Wizard and steps you through the dialog. You have access to the Location, Filter, and Status portions of the Wizard dialog. What is really important about the Edit dialog is that it allows you to change the database location. Notice that the Location field is dimmed in the Edit Connection dialog. You are not given the opportunity to change the database location in the dialog itself. However, you do have access to the file location in the Wizard dialog.
The third opportunity to edit a connection arises when you open an existing GeoWorkspace. GeoMedia may be unable to find a warehouse using the file system path stored in the workspace. This will occur in cases where a warehouse was moved to a new directory, or when you are opening a workspace emailed to you from another computer. In previous releases of the software, you were warned that the warehouse could not be found, and the connection was made with a Closed status. Now you are given a dialog that allows you to correct the path information as the GeoWorkspace is opening. That dialog is shown below.
Caption: Correcting an invalid warehouse file location.
You can either use the Browse button to
create a new path or you can cancel the dialog. Canceling produces the
result described above. The connection is created, and is left in a closed
state.
The behavior of the Delete connections can be a little quirky at times. Sometimes connections can be removed and sometimes they just cannot. According to the GeoMedia documentation, only certain connections can be removed from the GeoWorkspace, and only under very particular conditions.
First, a connection cannot be deleted if it is open. This is always true. You must change its Status to closed, then delete it. Second, you are not supposed to be able to remove a connection to a warehouse if you have ever added any of its features to the map window. This is the quirky part. Sometimes this is true and sometimes it is not. Again, the connection must first be closed. You can then highlight it and click on the Delete button. You will receive several warnings to the effect that legend entries and queries from that connection will be lost. At that point, the connection may be deleted, but there are cases in which GeoMedia will not remove the connection.
Before you start adding features to the map window, take a look at the types of things you can change in your warehouse connections. Open a new GeoWorkspace and connect to the parcels warehouse and the census warehouse. (See Workflow 5-1 for the procedure for making connections.) Use all defaults in the Warehouse Connection Wizard, with the exception of the connection name. Make sure that you give each of your connections a recognizable name. Remember, at this point all you have are the warehouse connections, an empty map window, and an empty legend.
• There are two ways to change the other fields. If you want to change the Status or the default spatial filter, you can do it here. If you want to change the Location (directory path and warehouse), you must return to the Connection Wizard dialog.
• At this point, Edit and Delete are not available. A connection must be closed before it can be deleted or edited in the Connection Wizard.
Vicinity Connections
The vicinity connection is a special kind of connection. You can assign one of your warehouse connections to serve as a vicinity connection. The warehouse in the vicinity connection will usually contain a small-scale, overview feature class used to create a locator, or vicinity, map. Vicinity maps allow you to orient yourself in your data and to more efficiently place and apply spatial filters to your connections. You might set up a vicinity connection to a vicinity warehouse consisting only of the boundaries of a country, a single state or a county boundary. You could then create and save a GeoWorkspace template with a map window display of the vicinity data. Whenever that template is opened for a new GeoWorkspace you will immediately be presented with a vicinity map you can use to place spatial filters. The spatial filters can then be easily applied to each new connection you create in the workspace. Spatial filters, briefly mentioned here, are covered in detail in Chapter 7.
The warehouse data in a vicinity connection is handled differently than data in non-vicinity connections. The feature classes in the vicinity connection are not subject to spatial filters, therefore all the data in the vicinity connection is always available. Define Spatial Filter by Fence, Define Spatial Filter by Area, Apply Spatial Filter by View, and Spatial Filters overlook the vicinity connection when applying spatial filters, so the vicinity map itself and features in the vicinity connection are never filtered.
The New Connection dialog likewise ignores the vicinity connection. When ‘Match GeoWorkspace and Warehouse Coordinate Systems when making first connection’ is selected on the General tab of the Tools > Options dialog, the coordinate system of the vicinity connection is ignored. Instead the coordinate system of the GeoWorkspace will be set to that of the first non-vicinity connection available. See Chapter 3 for more detail on matching GeoWorkspace and warehouse coordinate systems. Vicinity Connections are defined in the Tools> Options dialog, discussed in the following section.
Connections and the Options Dialog
You designate a Vicinity Connection by selecting a connection name from the Vicinity connection drop-down list on the General tab of the Tools > Options dialog box. The first entry by default is <None>, and the rest are the names of all the connections in the GeoWorkspace. The name of the vicinity connection is stored in the GeoWorkspace and applies only to that workspace.
Caption Connection settings in the Options dialog
A second setting that refers to Connections
on the General tab of the Tools > Options dialog is Add connection prefix
to feature names in the General Options panel. When this checkbox is selected
the connection name is added to the feature class in on the Legend Properties
dialog. See Chapter 11 for a complete description of this feature. The
connection prefix option is also used in the PickQuick function. This is
discussed in Chapter 15.