Converting vector map into MIF / MID format

Print Top page Next page

The program will export the digital vector data from GIS Map 2011 into a graphical format MIF / MID of MapInfo system.

The program is a library maptomif.dll, which is called in the system Map 2011, through the menu Tools/ Run application.

After occurrence of the main dialogue the opportunity is given to the user either use the options specified by default, or to change them at own discretion, having taken new values from the provided list.  

 

1. Description of the main dialogue

 

_engbm193

 

In the top part of dialogue the fields Name and the Source map are located, containing data on a current file of works region. In case of need the user can refuse work with this region of works and specify by means of the button "..." any other file of works region.

Contents of a field Output folder are intended for display of the path to created output data.

Catalog file field contains a name of a file of the options created during an execution of the program.

For work with the Catalog file having other location, there is a button "..." of standard choice and opening of a file.

With the purpose of prevention of casual destruction of the information - of the Catalog file, by pressing the button Create the window with question about confirmation or a cancelling of deleting the file will appear.

In the main dialog there are several groups of control elements displaying various data about current process of processing.

Input Data group contains data on the nomenclature, scale, type of a map, total of objects in a sheet, amount of the found errors.  

Statistics group contains the information on total of sheets in region, amount of the sheets chosen from region, etc.

Data processing group displays the processing of a separate sheet and all region.

Options group is intended for access to other dialogues and contains following operating buttons: Parameters …, Tables …, Filter ….

After setup of options in the main dialog and dialogs Parameters… and Tables … the user by means of the button Save starts the program onto an execution, or refuse it by pressing Cancel button.

 

2.Description of Parameters … dialog

 

_engbm223

 

In the Parameters … dialog there is a group Name of output folder, containing two radio-button with names Auto and Direct which are intended to specify  different ways of forming a path to output data.

In the first case the output directory, in which will be placed MIF / MID - files and  the log file .LOG, is created in a directory where there is a MAP-file. The name of this output directory is formed by default automatically - thus it uses the path of a file of works region and a name of a current HDR-file of the sheet  included into this region of works, for example,

- D:\ NameOfDirect \ Data \ NameMap.Map - a path to a file of works region;

- NameFirstList.Hdr - a name of the first-file of sheet included into this region;

- D:\ NameOfDirect \ Data \ NameFirstList \ - a name of output directory.

In the second case the path to a directory is specified manually in standard dialog of a file choice. After appearance of dialog of a file choice it is necessary to press the right mouse button and in the contextual menu to choose item create a new folder and then to create in it a new document, for example text.

Name of output files group contains two radio-buttons with names Layer number and Short layer name which are intended to specify different modes of forming a name of output files.

During an execution of the program in a output directory the files MIF/MID are created, which names are formed by default from a name of HDR-file of sheet and two-digit hexadecimal number of a layer (in a range from ' 00 ' up to ' FF ') which is taken from a file .RSC of Map 2011 systems, for example,

- NameFirstList. Hdr - a name of processed HDR-file of sheet;

- 10 - a serial number of a layer in a file of resources .RSC (in a hexadecimal two-digit kind - 0A);

- NameFirstList0A.mif - a name of MIF file

- NameFirstList0A.mid - a name of MID file

When Short layer name button is pressed into names of files MIF/MID instead of number of a layer to a name of HDR-file is added a short name of a layer from a file .RSC of Map 2011 systems, for example,

- NameFirstListLAYER01.mif - a name of file MIF

- NameFirstListLAYER01.mid - a name of file MID

Names of created files can have length of more than 8 characters with the extensions .mid, .mif.

After setup of input and output data the user has an opportunity to change parameters of dialog installed by default.

Semantics (attributes) of objects of each layer is saved in a separate file MID. The structure of MID file is described by tables of MIF file. The separate field of the table corresponds to one semantic characteristic of object.

The list of the semantic characteristics admissible for a layer, is contained in the classifier (a file of resources) of convertible map.

For viewing and updating a file of resources it is necessary to choose in the menu Tools/Run applications/Classifier processing the item Editing of classifier which calls the dialog, allowing to view, add and delete semantics of a layer. For an execution of these operations it is necessary:

- in Layers bookmark, in the list of layers to mark demanded number of a layer;

- to choose window Code|Semantic name in which there are three buttons;

- at absence of a layer semantics to press Fill button;

- for addition of a layer semantics to press Add button;

- for deleting semantics of a layer to press Delete button.

For saving results of work with semantics of a layer it is necessary to press the Save button.

Names of table fields group allows to use short or full names of the semantic characteristics containing in a file of resources of Map 2011 system as names of table fields.

The group View output data enables to form output coordinates of MIF files in degrees (by default), or in meters and an opportunity to replace (change by places ) X and Y.

Vector create as … group defines a view of representation of vector objects of source map in output format MIF.

The group Processing of semantics enables to operate a view of semantics in MID files and to write down all values of repeated semantics. All values of the same code of semantics are formed in a line, bounded by symbols « ». Among themselves values are separated by a symbol which Delimiter for repeated semantics is selected from the list.

MIF header structure group allows to change the values set by default, for header lines of MIF file - Version, Font, Delimiter, Coordinate.

By pressing Save button in the beginning of a text file maptomif.ini the service section .SETMAIN is created or updated, in which parameters of work specified in Parameters dialog are saved.

The list of tables fields can be added by service fields.

In Parameters … dialog there is a button with header "Table insert …", by clicking this button a modal dialog with header "Insert in tables" will be called.

 

3. Description of dialog Insert in tables

 

_engbm195

 

Fields of this dialog allow the user to operate structure of tables header of MIF files, containing the information on a layer, a code of object and its unique number, etc.

On the dialog panel two tables with names Source fields list and Output fields list are located, the first of them is the input, the second - output.

By means of an option Russian is available an opportunity of representation of the source list on Cyrillic.

The user by means of a mouse specifies (highlights) the certain line in the input table which is necessary for placing into the output table, and presses a key >>> then this line is transferred to the output list.  

Names of service fields have values by default and can be, if necessary, are changed by the user in the output table.

The format of a field can change also by the user:

N - a format of field Integer;

C (32) - character format by length of 32 bytes.

Insert key allows to execute an insert of a line from the source table into an any place in the output table.

Delete key carries out deleting the line highlighted in the output table.

Clear key at pressing deletes all lines from the output table.

By pressing the Save key in the end of a text file .m2m the service section .SETUP is created or updated, in which parameters of work specified in dialog "Insert in tables" are saved. A format of section .SETUP.

 

4. Work with classifier

In case of occurrence in the protocol .LOG the messages:

            "FOR LAYER ........ NUMBER …. THERE IS NO SEMANTICS IN THE CLASSIFIER",

It is necessary to execute following actions for each layer:

- to choose in the menu Tools/Rum applications/Classifier processing item Editing of classifier;

- in Layers bookmark in the list of layers to mark demanded number of a layer;

- to go to a window, containing table Code|Semantic name;

- at absence of a layer semantics to press Fill button.

To save results of work with semantics of a layer it is necessary to press Save button.

 

5.Output control data

As a result of work of the program three control files with a name of a processed map are created:

- text file (extension .m2m);

- binary file (extension .rab);

- file of parameters (extension .ini).

Text file contains the information about how the object of MAP format should be described for its representation in format MIF/MID.

On the basis of a text file the binary file necessary for work of the program is created.

The text file is created only in case of its absence.

The binary file is created at each execution of the program.

The text file contains data on the objects presented in a file of classifier RSC.

Text, binary and a file of parameters maptomif.ini are created in a directory, which contains the processed region of works.

 

6. Structure of control data

Further the description of structure of a catalog file follows, by means of which the user has an opportunity to influence process of assignment to MAP objects of characteristics of external representation of objects in format MIF/MID.

Changes in structures of these sections .POINT, .LINE, .SQUARE, .TITLE, .VECTOR and .MIXED allows the user to change appearance characteristics of MIF objects. Editing of lines of data of a text file consists in change of values of numerical, string fields.

At editing fields of strings it is necessary to observe following rules:

- it is required to observe the order of fields in record of a text file;

- values of changeable fields should correspond to type and dimension of modified attribute.

Names of attributes fields of the file-MIF table (the group Names of tables fields) is formed on the basis of a short or full name of semantic characteristics of  RSC-file of system Map 2011 resources, in cases if in a name of semantic characteristics there are  spaces, they are replaced with an underscore.

Types of attributes of the file-MIF table can accept values:

- Char (30) for field ExCode;

- Integer for field LinkObject;

- Integer (n, m) for all numerical semantic characteristics of RSC resources file of system Map 2011, found in this layer;

- type "classifier" (the values are given in the form of decoded string);

- type a file name .MAP,.OLE,.TXT,.PCX,.BMP, etc.;

- type of the reference to numbers of objects.

Dimension n, m attributes Integer (n, m), Char (n) is defined by dimension of semantic characteristics of RSC resources file of system Map 2011.

For viewing properties of semantic characteristics it is necessary to choose in the menu Tools/Rum applications/Classifier processing item Editing of classifier:

- Semantics bookmark contains the detailed description of each semantic characteristic;

- in Layers bookmark in the list of layers to mark demanded number of a layer;

- go to the window, containing the table Code|Semantic name in which semantics for the chosen layer is presented;

- at absence of a layer semantics to press Fill button.