Writes an object into an object file that was not from a BNA, MIF/MID, SHP, or TAB file.
Syntax
intl pipImportInsert ( pipImporter imp_h, pipObjectInfoStruct
*pInfo, intl *points, intl *pointsPerPoly, intl nPolys
);
Arguments
imp_h The handle returned by pipImportInit for the current import process. Input.
*pInfo Structure containing attribute information about an object. Input.
*points An array of long, lat or x,y pairs. Longitude and Latitude should be in millionths of degrees, or in user coordinates. Not used if the object type is PIP_POINT. Input.
*pointsPerPoly An array containing the number of points in each polygon of a region. In the case of a Line object, it is the number of points in each chain. Not used if the object type is PIP_POINT. Input.
nPolys The number of polygons in this region or number of chains in the line object. Not used if the object type is PIP_POINT. Input.
Return Value
PIP_OK PIP_ERROR
Prerequisites
pipImportInit.
Alternates
None.
Notes
This function provides a mechanism to import objects into an object file that are not from a BNA, MIF/MID, SHP, or TAB file.
The *pInfo structure contains the necessary information to initialize the import. The structure is described below.
char name[128] | Primary name—included in name index. |
char name2[128] | Secondary name—not indexed. |
intl type | PIP_REGION, PIP_LINE, or PIP_POINT. |
intl layer | Layer code. |
intl xCenter, yCenter | Point location or label position. |
intl xMin, yMin, xMax, yMax | MBR, not used for points. |
intl penStyle, penWidth, penColor | Line style, border style, or symbol style for points. |
intl brushStyle, brushColor, brushBackgroundColor | Fill style, used only for regions. |
These parameters are explained in detail below:
Parameter | Explanation |
---|---|
name and name2 | The primary (indexed) and secondary (non- indexed) names of the object. |
type |
The objects type—PIP_REGION, PIP_LINE or PIP_POINT. |
layer | The layer code. Valid values are between 0 and 255. |
xCenter, yCenter | If feature is a point, then this is how you specify the point location. If the feature is a line or a polygon, then this is optional and is stored as the "label" position of the object. You can set these parameters to 0,0 to have Spatial+ calculate the position. Note that the label position is not used directly by Spatial+ |
xmin, ymin, xmax, ymax | These parameters are not used on input and are ignored. |
penStyle, penWidth, penColor | Line drawing attributes for lines and polygons, or symbol attribute for points. Roughly approximates MapInfo's settings. The settings are stored, but not used directly in Spatial+. |
brushStyle, brushColor, brushBackgroundColor | Polygon fill attributes. Roughly approximates MapInfo's settings. The settings are stored, but not used directly in Spatial+. |
The points, pointsPerPolygon and nPolys parameters are ignored if the type parameter is a PIP_POINT. See on page 206 for complete details on the use of this function.
You must read points into the *points, *pointsPerPoly, and nPolys variables. There is no function provided to do this for non-GSB files.
You must call pipImportInsert for each object in the file.