The information in this section is essentially based on the MapInfo Data Interchange Format document [2]. |
Geographical units are described in an ASCII file by their X
and Y
coordinates.
The .MIF
file is made of an header section then a data section.
Figure 11.1. MIF file header
VERSION n Charset ”characterSetName” [ DELIMITER ”<c>” ] [ UNIQUE n,n.. ] [ INDEX n,n.. ] [ COORDSYS...] [ TRANSFORM...] COLUMNS n <name> <type> <name> <type> etc.
VERSION: the version of the MapInfo software;
CHARSET clause specifies which character set was used to create text in the table (examples: WindowsLatin1
, MacRoman
or Neutral
;
DELIMITER shows the character that is used to separate columns values (if not specified, tabulation is the default delimiter);
UNIQUE parameter must be a number that refers to a database column, this parameter is used to create related tables;
INDEX parameter (a number or a comma-separated list of numbers) that shows the number(s) of the indexed column(s);
the COORDSYS parameter sets the used coordinate system.
This parameter is essential, in particular to compute the scale of the map. By default (when no COORDSYS
clause is specified)
data is assumed to be stored in longitude/latitude forms. All coordinates are stored with respect to the northeast quadrant. The coordinates for
points in the West of Greenwich have a negative X while coordinates for points in the East of Greenwich have a positive X. Coordinates for points in the Northern
hemisphere have a positive Y while coordinates for points in the Southern hemisphere have a negative Y. Examples:
The following example represents a map of Europe centered on 50°N 15°E with a Lamber Azimutal projection that can be associated to the following bounds pair: (Xmin, Ymin) (Xmax, Ymax). The
"m"
option stands for "meters" as the unit:
CoordSys NonEarth Units "m" Bounds (-2217175, -1723801) (1783333, 2518193)
Another setting for a map of Rhône-Alpes may be:
CoordSys NonEarth Units "m" Bounds (691594, 1893320) (993392, 2185448)
TRANSFORM parameter can be used to convert coordinates which are given in a different quadrant than the default northeast one.
COLUMNS parameter describes the data in the table of the associated MID
file. The n
parameter specifies the number of columns. Example:
Columns 1 unit Char(100)specifies one column named
unit
, each value will be made of characters string type whose length is not longer than 100.
HyperAdmin is quite sensible on the format of the header of the MIF file (one information by line). Here are some examples of the expected formats for the header of the more frequently recent and used MIF files:
|
The DATA keyword specifies both the end of the header of the MIF
file and the start of the enumeration of outlines.
If the MapInfo MIF
file may set different types of graphical primitives (point, line, polyline, etc.), the HyperAdmin software only expects the polygon type
in order to describe the outlines of territorial units. Eeach TU whose identifier is given in the MID
file (see Section 11.1) must be
associated to a new entry in the MIF
file under the data section, IN THE SAME ORDER, as a Region
entry. In MapInfo, a Region
object consists of one or more polygons. Let us describe an expected Region entry using the definition example shown on Figure 11.2.
Figure 11.2. Example of two "Region" entries in the MIF file Data section
Data Region 2 7 108071.871 -293320.749 96339.456 -282096.297 102833.097 -261179.193 106485.534 -258631.56 123883.98 -262981.491 122621.886 -282959.13 108071.871 -293320.749 Pen (1,2,0) Brush (0,1) Center 110111.718 -275976.153 5 -407753.01 -311500.065 -417000.993 -311417.496 -411718.965 -289228.641 -406514.985 -302217.573 -407753.01 -311500.065 Pen (1,2,0) Brush (0,1) Center -411757.989 -300364.353 Region 1 11 2186917.593 -1518464.703 2186829.009 -1692861.786 2129979.423 -1729141.275 1933829.46 -1729141.275 1928265.747 -1699690.677 1922979.324 -1671615.192 1928499.903 -1666190.274 1941660.768 -1656068.01 2005909.794 -1679948.187 2047505.1 -1676110.68 2186917.593 -1518464.703 Pen (1,2,0) Brush (0,1) Center 2140313.457 -1623802.989
Start of the entry for the first territorial unit in our data section. This region definition will be associated to the identifier on the firts entry of the | |
The first polygon of this region is set with seven points whose coordinates in X Y forms are given on following lines. | |
Pen(a, b, c), Brush(a, b) and Center x y specifications are optional and they will not be read by HyperAdmin. | |
The second polygon of this region is defined with five points whose coordinates are given on the five following lines. | |
Here is the start of a new | |
This line shows the number of points that compose the polygon: 11 points, whose coordinates are successively given on 11 folloging lines. |