ImportMIF()
Summary
Imports features from an MIF file into a geographic file.
Syntax
ImportMIF(string filename, string new_db_name, string layer_type, array options)
| Argument | Contents |
|---|---|
| filename | The path and file name of the file to import |
| new_db_name | The path and file name of the new geographic file |
| layer_type | The type of features to import: "Point", "Line", or "Area" |
| Option | Type | Contents |
|---|---|---|
| Entity Types | Array | An array of strings listing the types of entities to import; omit this option to import all entities of a type consistent with the layer type specified |
| Fields | Varies | The string "All" to import all attributes, or an array of attribute field names indicating the ones to be imported; omit this option to import none of the attributes; the Table Filename option is required if this option is used |
| Label | String | A descriptive label for the geographic file |
| Layer Name | String | The name of the layer in the geographic file; this option is required to hard link the attribute table |
| Median Split | Boolean | If "True" special handling ensures that entities which cross the 180 degree longitude line are imported properly; if "False" (the default), no special handling is invoked |
| NAD Conversion | 3 strings | Input datum, output datum, and conversion file (if needed); the input and output datums should be different |
| Node Layer Name | String | The desired name for the endpoint layer (only when importing a line layer) |
| Optimize | Boolean | Whether to optimize the geographic file automatically after the import (defaults to "True") |
| Projection | String, array | The projection name and the array of options; this information is provided automatically by GetMIFInfo() for files that are in world coordinates |
| Table Filename | String | The path and name of the file in which attributes are stored; the file extension must be .BIN, .CSV, .DBF, .TXT or .MID; this option is required if the Fields option is used |
| Topology | Boolean | For area layers, a value of "True" indicates that the resulting geographic file should have true area topology, which involves substantial complex processing. A value of "False" means that boundary edges can be duplicated, so that larger files can be imported. This option does not apply to point and line layers |
| Transform | Array | Array specifying the coordinate transformation to apply to the file. This array can take one of three forms: (1) Control Point Transform an array of two or more four-element arrays containing local and world coordinates for control points. Example: {{real localX1, real localY1, real longitude1, real latitude1}, ...}. (2) Affine Transform an array of four elements: {real X_multiplier, real Y_multiplier, real X_offset, real Y_offset}. (3) Center and Extent Transform {c1_x, c1_y, width_1, c2_x, c2_y, width_2}, where the center shifts from (c1_x, c1_y) to (c2_x, c2_y), and a vector of length width_1 from c1 becomes a vector of length width_2 from c2. |
Notes
-
Attribute data stored in the MID file that is associated with the MIF is imported automatically if the Fields option is specified.
-
The attribute table is hard linked to the geography if it exists and Layer Name has been specified.
-
For more details on the NAD Conversion option, see Datum Conversions.
-
For more details on the Projection option, see Using Projections and Coordinate Systems.
-
If no transformation is applied, longitude and latitude coordinates can be integers with six implied decimal places (millionths of a degree). For more details, see Transformations.
Example
ImportMIF("c:\\miffiles\\sample.mif", "streets.dbd", "Line", {
{"Label", "Street Centerline File"},
{"Layer Name", "Centerline"},
{"Optimize", "True"},
{"Projection", "utm", {"zone=12", "units=m"}},
{"NAD Conversion", "NAD27", "NAD83",}
})
Error Codes
| Error Type | Meaning |
|---|---|
| Error | The file is not a valid MIF file |
| NotFound | There is no file by this name, or there are no entities in the designated layers of the desired type |
See Also
| Function | Summary |
|---|---|
| GetMIFInfo() | Collects summary information on the contents of an MIF file |