Reader Directives
The directives that are processed by the MIF reader are listed below. The suffix shown is prefixed by the current <ReaderKeyword>
in a mapping file. By default, the <ReaderKeyword>
for the MIF reader is MIF
.
DATASET
Required/Optional: Required
The value for this keyword is the folder containing the MIF files to be read, or a single MIF file. A typical mapping file fragment specifying an input MIF dataset looks like:
MIF_DATASET /usr/data/mapinfo/92i080
Workbench Parameter: Source MapInfo MIF/MID File(s)
DEF
Required/Optional
Optional
The definition specifies the base name of the file, and the names and the types of all attributes. The syntax of a MIF DEF line is:
<ReaderKeyword>_DEF <baseName> \
[<attrName> <attrType>]+
The file names of the physical MIF files is constructed by using the folder specified by the DATASET keyword, the basename specified on the MIF DEF lines, and the .mif (geometry) and .mid (attributes) extensions.
MIF files require at least one attribute to be defined. The attribute definition given must match the definition of the file being read. If it does not, translation is halted and the true definition of the MIF file’s attributes gets logged to the log file. There are no restrictions on the field names of MIF attributes.
Tip: Tip: MapInfo decimal fields are analogous to DataBase Format (DBF) number fields. MapInfo also provides float, integer, and smallint field types for storing numeric values.
The following table shows the attribute types supported.
Field Type |
Description |
char(<width>) |
Character fields store fixed length strings. The width parameter controls the maximum number of characters that can be stored by the field. No padding is required for strings shorter than this width. |
date |
Date fields store dates as character strings with the format YYYYMMDD. |
datetime |
Datetime fields store dates as character strings with the format YYYYMMDDHHMMSS.FFF |
decimal(<width>, |
Decimal fields store single and double precision floating point values. The width parameter is the total number of characters allocated to the field, including the decimal point. The decimals parameter controls the precision of the data and is the number of digits to the right of the decimal. |
float |
Float fields store floating point values. There is no ability to specify the precision and width of the field. |
integer |
Integer fields store 32 bit signed integers. |
logical |
Logical fields store TRUE/FALSE data. Data read or written from and to such fields must always have a value of either true or false. |
smallint |
Small integer fields store 16 bit signed integers and therefore have a range of -32767 to +32767. |
time |
Time fields store times as character strings with the format HHMMSS.FFF |
The following mapping file fragment defines two MIF files. Notice that neither definition specifies the geometric type of the entities it will contain since MIF files may contain any of the valid geometry types.
MIF_DEF landcover \
area decimal(12,3) \
landcoverType char(11) \
perimeter float
MIF_DEF roads \
numberOfLanes smallint \
roadType char(5) \
underConstruction logical \
divided logical \
travelDirection char(6)
IDs
Required/Optional
Optional
This optional specification limits the available and defined MIF files read. If no IDs are specified, then all defined and available MIF files are read.
The syntax of the IDs keyword is:
<ReaderKeyword>_IDs <baseName1> \
<baseName2> \
<baseNameN>
The basenames must match those used in DEF lines.
Example: The example below selects only the roads MIF file for input during a translation:
MIF_IDs roads
ENCODING
This directive is applicable only if you are working with foreign (non-English) character sets.
For example, if your source data contains foreign characters, using this directive along with the encoding value ensures that the original data is preserved from the reader to the writer.
Required/Optional
Optional
Values
Values supported by MapInfo 10:
SJIS, CP437, CP850, CP852, CP855, CP857, CP860, CP861, CP863, CP864, CP865, CP869, CP874, CP932, CP936, CP950, CP1250, CP1251, CP1253, CP1254, CP1255, CP1256, ISO8859-1, ISO8859-2, ISO8859-3, ISO8859-4, ISO8859-5, ISO8859-6, ISO8859-7, ISO8859-8, ISO8859-9
Mapping File Syntax
<ReaderKeyword>_ENCODING <encoding>
Workbench Parameter
Character Encoding (optional)
SEARCH_ENVELOPE
Using the minimum and maximum x and y parameters, define a bounding box that will be used to filter the input features. Only features that interact with the bounding box are returned.
If all four coordinates of the search envelope are specified as 0, the search envelope will be disabled.
Mapping File Syntax
<ReaderKeyword>_SEARCH_ENVELOPE <minX> <minY> <maxX> <maxY>
Note: If all four coordinates of the search envelope are specified as zero, the search envelope will be disabled.
Required/Optional
Optional
Workbench Parameter
Minimum X, Minimum Y, Maximum X, Maximum Y
SEARCH_ENVELOPE_COORDINATE_SYSTEM
This directive specifies the coordinate system of the search envelope if it is different than the coordinate system of the data.
The COORDINATE_SYSTEM
directive, which specifies the coordinate system associated with the data to be read, must always be set if the SEARCH_ENVELOPE_COORDINATE_SYSTEM
directive is set.
If this directive is set, the minimum and maximum points of the search envelope are reprojected from the SEARCH_ENVELOPE_COORDINATE_SYSTEM
to the reader COORDINATE_SYSTEM
prior to applying the envelope.
Required/Optional
Optional
Mapping File Syntax
<ReaderKeyword>_SEARCH_ENVELOPE_COORDINATE_SYSTEM <coordinate system>
Workbench Parameter
Search Envelope Coordinate System
CLIP_TO_ENVELOPE
This directive specifies whether or not FME should clip features to the envelope specified in the SEARCH_ENVELOPE
directive.
Values
YES | NO (default)
Mapping File Syntax
<ReaderKeyword>_CLIP_TO_ENVELOPE [yes | no]
Workbench Parameter
Clip To Envelope
EXPOSED_ATTRS
This directive allows the selection of format attributes to be explicitly added to the reader feature type.
This is similar to exposing format attributes on a reader feature type once it has been generated; however, it is even more powerful because it enables schema-driven applications other than Workbench to access and leverage these attributes as if they were explicitly on the schema as user attributes.
The result of picking a list of attributes is a comma-separated list of attribute names and types that will be added to the schema features. Currently all reader feature types will receive the same set of additional schema attributes for a given instance of the reader.
Required/Optional
Optional
Mapping File Syntax
Not applicable.
While it is possible for FME Objects applications to invoke this directive, the required format is not documented.
This directive is intended for use in our GUI applications (for example, Workbench) only.
Workbench Parameter
Additional Attributes to Expose