=======MapInfo MIF/MID file format description=======
MapInfo MIF/MID文件格式描述
(from Appendix A of MapInfo Reference)
(摘自MapInfo参考资料的附录a)
This appendix describes the data interchange format for MapInfo. In this
appendix, you will find information on:
这个附录描述了MapInfo的数据交换格式。在这个附录中,你会发现如下信息:
MIF File header
MIF Data Section
Pen, Brush, Symbol, and Font Codes in MIF
MID File
This versatile format allows generic data to be attached to a variety of
graphical items. It's ASCII, so it is editable, relatively easy to generate,
and works on all platforms supported by MapInfo. Perhaps the best way to
understand the MapInfo Interchange Format (MIF) is to study the sample file
at the end of this appendix in conjunction with the explanation of the file
format. You can also create samples of your own by exporting files to MIF and
then examining those files in a text editor.
这种通用的格式允许把普通的数据添加到多种的图像元素中。MIF/MID文件采用ASCII编码,因此它是可编辑的、相对比较容易生成、并且可以工作在MapInfo支持的所有平台上。也许理解MIF格式的最好的方法是在读完这篇文章后,拿着MIF格式说明,研究一个MIF文件。你也可以通过“exporting files to MIF”创建你自己的MIF文件,然后在文本编辑器中好好的研究它。
Mapinfo data is in two file -- the graphics reside in a .MIF file and textual
data is contained in a .MID file. The textual data is delimited data, with
one row per record and either Carriage Return, Carriage Return plus Line Feed,
or Line Feed between lines. The MIF file has two areas -- the file header and
the data section. Information on how to create MapInfo tables is in the
header; the graphical object definitions are in the data section.
MapInfo数据存在于两种文件中--图形数据存储在.MIF文件、文本数据存储在.MID文件。文本数据包括每一项记录的一行和回车,回车加换行,行之间的换行。MIF文件的数据包括两部分--文件头和数据区。文件头存放着如何创建MapInfo表格的信息;数据区存放着图形对象的解释。
=================MIF FILE HEADER===============
This is a description of MIF file header with optional information in square
brackets.
下面是MIF文件头的描述(包括可选项,下表中由“[]”括起来的部分就是可选项)。
Version n
Charset "characterSetName"
[ DELIMITER "<c>" ]
[ UNIQUE n,n.. ]
[ INDEX n,n.. ]
[ COORDSYS... ]
[ TRANSFORM... ]
COLUMNS n
<name> <type>
<name> <type>
…
…
DATA
1.Version 版本号
The Version clause states whether you are using VERSION 1, VERSION 2, or
VERSION 300 of the format. Version 300, introduced with Mapinfo 3.0, allows
multiple-section polyline objects.
“Version”说明你使用的MIF格式的版本(VERSION 1, VERSION 2, VERSION 300中的一种)。Version 300,引自Mapinfo 3.0,允许形容由多段组成的折线对象。
2.Charset 字符集
The Charset clause specifies which character set was used to create text in
the table. For example: Specify "WindowsLatin1" to indicate that the file was
created using the Windows US & Western Europe character set; specify
"MacRoman" to specify the Macintosh US & Western Europe character set; or
specify "Neutral" to avoid converting the text into another character set.
If you are not using one of these character sets, you can determine the
correct syntax for your character set by exporting a table and examining the
.MIF file in a text editor.
“Charset”指定表(此处还不知道是哪一个表)中创建文本所使用的字符集。比如说:"WindowsLatin1"说明文件使用的是the Windows US & Western Europe字符集;"MacRoman"说明文件使用的是the Macintosh US & Western Europe字符集;或者,注明"Neutral"是为了防止将文本转成了另外的字符集。如果你没有使用其中任何一个字符集,你可以通过exporting a table和examining the .MIF file in a text editor为你的字符集指定正确的语法。
3.Delimiter 分隔符
Specify the delimiting character in quotation marks, for example:
指定引号(即""或者'')之间的分隔符,比如说:
DELIMITER ";"
The default delimiter is Tab; if you are using the default, you do not need
the DELIMITER line.