5. Running the tool

As discussed in the Setting up the tool section, the Data Extractor tool is operated from a MapInfo workspace within which the GIS layers required to run the tool are already loaded. It also relies on an SQL database containing the boundaries of the relevant partners, the SQL tables containing any data that may be extracted, and a configuration document for setting up the tool. Therefore, before running the tool, ensure the following conditions are met:

  • A MapInfo document has been created which contains both the partner boundary GIS layer and any MapInfo GIS layers that may be included in the extraction.
  • An SQL database exists that contains the relevant partner boundaries, any data tables required, and the auxiliary tables and stored procedures as set out in the setup section.
  • The file DSN for the SQL database has been created.
  • The XML configuration document has been set up correctly, both for general settings and for each individual layer that will be queried. It is also named correctly and in the same directory as the tool MapBasic application (.MBX).
  • The Data Extractor tool has been installed and is loaded in MapInfo using the MapInfo Tool Manager.

See also

Please refer to the setup section for further information about any of these requirements.

5.1. Opening the form

To open the Data Extractor tool, open the tool in the Tools menu (Tools… -> Data Extractor), as shown in Fig. 5.1.

../_images/RunExtractor.png

Fig. 5.1 Launching the Data Extractor tool

If there are any structural issues with the XML document, the tool will display a message that it has encountered an error, and not load any further. If any of the map layers that are listed in the configuration document are not present in the active workspace a warning will be shown (Fig. 5.2). The layers that are missing will not be loaded into the form and so cannot be included in the extracts.

../_images/LaunchWarning.png

Fig. 5.2 Example warning message when any GIS layers are not found

Provided that the XML document is otherwise correct, the form will display (Fig. 5.3).

../_images/DisplayForm.png

Fig. 5.3 The form displaying the active partners and available data layers

5.2. Using the form

The form can be used to process as many partners and tables as required during a single execution. Select the partners for which you wish to run the extraction, and the SQL and / or MapInfo tables that you would like to include, what type of SQL table extraction you would like to carry out (spatial, survey tags, or both), make sure all other options are correct then press OK.

../_images/SelectOptions.png

Fig. 5.4 Select the required options on the form

Caution

The tool can run for a considerable amount of time dependent on the number of records that are being selected.

Progress is shown in a progress window (Fig. 5.5).

../_images/ExtractorProcessing.png

Fig. 5.5 Progress window during the extract process

When the extract process finishes it asks the user whether to close the form or keep it open for subsequent use (Fig. 5.6).

../_images/ProcessComplete.png

Fig. 5.6 Prompt to close form when extract process completes

Once the user makes a choice the log file is shown (Fig. 5.7). This should be checked thoroughly to ensure that all expected extracts have been generated, the format of the extract files is correct, and that the number of records included in each extract file is as expected.

../_images/LogFile.png

Fig. 5.7 Example log file shown for review

You can now repeat the extract process for different partners and/or files as required.

5.3. Extract results

All results are written to the DefaultPath folder as specified in the XML configuration document. As shown in Fig. 5.8 each partner has its own sub-folder where the extract files for that partner are stored in the formats specified in the partner GIS layer.

../_images/OutputFolderAnnotated1.png

Fig. 5.8 Outputs are organised in partner-specific folders

The log file results of the process is saved in the LogFilePath folder as specified in the XML configuration document.