Reader Directives

The directives that are processed by the MapInfo 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 MAPINFO.

DATASET

Required/Optional: Required

The value for this directive is the folder containing the MapInfo files to be read, or a single MapInfo file. A typical mapping file fragment specifying an input MapInfo dataset looks like:

MAPINFO_DATASET /usr/data/mapinfo/92i080

Workbench Parameter: 

Source MapInfo TAB File(s)

DEF

Required/Optional

Optional

The definition specifies the base name of the file, and the names and types of all attributes. The syntax of a MapInfo DEF line is:

<ReaderKeyword>_DEF <baseName> [<attrName> <attrType>[,indexed]]+

The file names of the physical MapInfo files are constructed by using the folder specified by the DATASET directive, the basename specified on the MapInfo DEF lines, and the file extensions.

MapInfo requires that at least one attribute 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 MapInfo file attributes are logged to the log file. There are no restrictions on the field names of MapInfo attributes. The following table shows the attribute types which are supported.

Field Type

Description

char(<width>)

Character fields store fixed length strings. The width parameter controls the maximum of characters 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 dependent on your location. This format is usually YYYYMMDD.

datetime

Datetime fields store dates as character strings with the format YYYYMMDDHHMMSS.FFF

decimal(<width>,
<decimals>)

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 boolean data. Data read or written from/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 attribute type may also have ,indexed when the definition is specified for a writer. When specified, this results in the writer building an attribute index table for the columns that are indexed thereby making queries in MapInfo faster. This directive is only recognized by the writer module.

The following mapping file fragment defines two MapInfo files. Notice that neither definition specifies the geometric type of the entities it will contain because MapInfo files may contain any of the valid geometry types.

MAPINFO_DEF landcover 	\
	area              decimal(12,3)  \
	landcoverType     char(11)  \
	perimeter         float


MAPINFO_DEF roads	\
	numberOfLanes     smallint	\
	roadType          char(5)	\
	underConstruction logical  \
	divided           logical \
	travelDirection   char(6) 

IDs

Required/Optional

Optional

This specification is used to limit the MapInfo files that are read. If no IDs are specified, then all defined and available MapInfo files are read. The syntax of the IDs keyword is:

<ReaderKeyword>_IDs	<baseName1>  \
	<baseName2> \
	<baseNameN> 

The basenames must match those used in DEF lines.

The example below selects only the roads MapInfo file for input during a translation:

MAPINFO_IDs roads

Workbench Parameter

Feature Types to Read

FME_TABLE_PASSWORD

Required/Optional

Optional

This keyword is only applicable when opening datasets of Type FME. If the auxillary FME dataset is a database reader, then MapInfo willl not automatically put the password for the source database in the tab file. This directive allows the user to specify the password dynamically. Additionally, if the password is hardcoded into the tab file, then this directive will supercede that password.

The syntax of the FME_TABLE_PASSWORD directive is:

    <ReaderKeyword>_FME_TABLE_PASSWORD password

This directive is optional. However, if it is needed to open the FME dataset, then it will need to be provided on both generation and runtime.

Workbench Parameter

Password for FME Table

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