Parent Topic: Supported File Formats

MapInfo Data Interchange Format (MIF)

MapInfo layers in the form of .mif/.mid files are supported by the GeoGateway library for both read and write with RST support, with some limitations listed below.

All graphical object types are imported with all their attributes, however, ARCs and ELLIPSEs are emulated with line segments 3 degrees long (up to 120 segments in one complete ellipse). Rounded Rectangles are also treated as simple rectangles. PLINEs and REGIONs are converted to one single GeoGateway Shape with a RingStart attribute specifying the index where the sub-regions start in the array of vertices of the shape.

Projections are remapped to best match while reading and writing. However, it is possible that some specific projections have no equivalent. In such cases the projection will be set to "METRE" on import (with the coordinates converted to metres as well) or to "COORDSYS NonEarth" on export.

In write mode, vertices and all attribute types (except CountedInts) are written out. A RST can also be provided as long as it is in Ground Units, and GeoGateway will export the representation information. When you import a file, the best results will be obtained with RSTs that have been generated by this same translator.

Export of MapInfo files is supported. These files are exported with a type of "MIF".

The translator will give better results if an RST (in Ground Units) with the following attributes is available. Note that these are optional and that the export operation will work but without representation information (colours, line widths, etc) if they are not provided:

See Also: FIMPORT, FEXPORT

Advanced Information About Read Access
While reading, a Representation Table (RST) is built based on the drawing information that is available (line width, colour, etc.). Each object read is given a "REPCode" attribute that points to an entry in this RST. TEXT objects also have a "TextString" and "Angle" attribute in the GeoGateway shape containing the character string and its orientation.

On Import, if there are columns with the names "REPCode", "Angle", "TextString", or "RingStart" in the MAPInfo table structure, then these attributes will not be imported, instead they will be replaced by special GeoGateway attributes with the following contents:

  REPCode       (Integer)      Index to a REPCode in the generated RST.
  Angle         (Double)       Orientation for TEXTs.
  TextString    (String)       TEXT value.
  RingStart     (CountedInt)   Used by GeoGateway to regenerate polygons and
                               polylines.
These special attributes are fetched by GeoGateway in the following order:

1) If the application provides setting for these attributes (through the layer's iXXXField members) then these will be used.

2) If an attribute with the right name and type exists, then it will be used.

3) Finally, if the 2 cases above failed, then some default values will be used instead of attribute values.

GeoGateway needs the layer extents at the beginning of the export operation to give the best results when exporting with a RST. If the application does not provide that information to GeoGateway, then default values will be used for line widths (always 1 pixel) and symbol sizes (always 10 points). If you have such columns in your dataset and want to keep them untouched, then you should change their name with MAPInfo's Table Structure tool.

Note: The test on the names is not case sensitive.

The column types that do not have a direct equivalent in GeoGateway are remapped without any data loss. DATEs are imported as Strings, LOGICALs are imported as Integers with 0=False/No and 1=True/Yes, and DECIMALs are imported as Floats.

Advanced Information About Write Access
On Export, the translator will give better results if a RST (in Ground Units) with the following attributes are available. Note that these are only optional, and that the export operation will work but without representation information (colours, line widths, etc.) if they are not provided:

  REPCode       (Integer)      Index to a REPCode in the provided RST.
  Angle         (Double)       Orientation for TEXTs.
  TextString    (String)       TEXT value.
  RingStart     (CountedInt)   Used by GeoGateway to regenerate REGIONs and PLINEs.
These special attributes are fetched by GeoGateway in the following order:

1) If the application provides setting for these attributes (through the layer's iXXXField members) then these will be used.

2) If an attribute with the right name and type exists, then it will be used.

3) Finally, if the 2 cases above failed, then some default values will be used instead of attribute values.

GeoGateway needs the layer extents at the beginning of the export operation to give the best results when exporting with a RST. If the application does not provide that information to GeoGateway, then default values will be used for line widths (always 1 pixel) and symbol sizes (always 10 points).

Limitations Due To RST Units
Since GeoGateway deals with a RST in which the units are Metres on the Ground, while MapInfo uses line widths in pixels and symbol sizes in points, GeoGateway must perform an approximation while converting between the MapInfo file and the RST. Fortunately, text sizes are already attached to Ground units in MapInfo, therefore in this case GeoGateway does an exact conversion.

To map pixel and points sizes to ground metres, GeoGateway makes the assumption that the dataset is intended to be viewed on a 1280 pixel wide screen, where each pixel is 0.28mm wide. With these values and the file's extents, GeoGateway can convert MapInfo line widths and symbol sizes to/from the RST.

Another approximation is required if the dataset's projection is LAT/LONG. In this case, GeoGateway must remap the representation information (for text height) from degrees to metres in the RST. The heights in degrees are converted as though we were dealing with a perfect sphere with a radius of 6370997m. Thus, a text height of 1 degree is approximated to 111195 metres in the RST.

Note: These limitations only apply to the RST. Datasets in LAT/LONG are imported and exported directly, without any conversion of their coordinates.


Parent Topic: Supported File Formats
About PCI Help Gateway