ImportFromView()
Summary
Creates a geographic file of point features from coordinates in a view.
Syntax
ImportFromView(string view_set_name, array fields, string new_db_name, array options)
| Argument | Contents |
|---|---|
| view_set_name | The view or selection set to import |
| fields | An array of three field names (strings) for the ID, the X-value, and the Y-value |
| new_db_name | The name of the new geographic file |
| Option | Type | Contents |
|---|---|---|
| Label | String | A descriptive label for the geographic file |
| Layer Name | String | The name of the layer in the geographic file |
| NAD Conversion | 3 strings | Input datum, output datum, and conversion file (if needed); the input and output datums should be different |
| 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 |
| 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
ImportFromView() is the GISDK function that is used to implement the Tools>Locate>Locate By Coordinate command.
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.
ImportFromView() displays a progress bar. To add a Cancel button to the progress bar, precede the function call with an "on escape" clause. For more information, see Error Handling.
Example
ImportFromView("Customers|", {"ID", "X", "Y"}, "customer.dbd", {
{"Label", "Customer Database"},
{"Layer Name", "Customers"},
{"Optimize", "True"},
{"Projection", "utm", {"zone=12", "units=m"}},
{"NAD Conversion", "NAD27", "NAD83",}
})
Error Codes
| Error Type | Meaning |
|---|---|
| Error | The coordinates are of the wrong type or invalid |
| NotFound | There is no view with the specified name, or one or more of the fields does not exist in the view |
| Escape | The user clicked Cancel |