While the features of previous spatial types were created “from scratch” by specifying all parameters from the keyboard, when adding an image feature it is supposed that raster graphics already exist in the form of a file. Adding an image feature to the map means adding graphics from the file to the map structure (where it will be stored in a compressed format) and specifying coordinates, boundaries and other parameters of raster display.
A dialog box of editing an image feature is shown at figure 17-14. This dialog box differs from the boxes of editing other feature types considerably. Apart from the usual pane of selecting the layer and type of the feature it contains a graphic sample pane, a pane of control points and a toolbar. Since this dialog box does not contain menu bar, all the operations are performed using the toolbar buttons, mouse or context menu.
Figure 17-14. Adding an image feature
The first step of adding an image feature is loading raster graphics from the file. A file of BMP format, standard for Windows, or a file of TAB format can be used as a source for raster graphics. The TAB format is used by the system MapInfo for keeping different data, including image data. After pushing the button
the system opens a dialog box for selecting the file to be loaded. After performing the loading the raster graphics is displayed in the sample pane. The buttons
and
allow changing the scale of display in the sample pane (it is in no way connected to the scale of image feature display in the map structure, the matter concerns only display of the raster sample when creating a feature). The status bar displays the scale value expressed by the number of raster pixels per one pixel of the sample pane. For example, the scale “1:0.5” means that display in the pane is zoomed in by two times so that every pixel of the source raster covers the square of the size 2´2 pixels in the pane.
If the user changed the scale in the sample pane several times, he can use the buttons
and
to return to the previous scale value or pass to the next value.
For turning off the mode of zooming in or zooming out it is required to click the pushed button or a second time to return it to the normal released state.
When creating an image feature it is necessary to select not less than three control points on the raster, specify coordinates of these points on the map and also determine the feature interception boundaries.
The button
turns on the mode of displaying control points, the button
turns on the mode of editing them. The points are displayed in the form of a cross in a circle:
. The control point is displayed by red color until its coordinates are specified on the map. When the cursor is located close to the control point in the editing mode, the point becomes light-cyan. In such a position of the cursor a double click by the mouse will cause opening a dialog box for specifying control point coordinates in the map coordinate system. The point for which the coordinates have been specified is displayed by blue color.
Starting from adding coordinates of the third control point, the system offers default calculated coordinates value. The calculation is made supposing that the ratio of segment lengths remains unchanged in raster georegistration, that is, a rectangle raster will be displayed on a map as a rectangle with the same side ratio. The user can ignore the prompt and bind the control points arbitrarily turning the rectangle into an arbitrary parallelogram on the map.
Changing of specified control point coordinates is performed in the same way: a double click near the point opens a dialog box for specifying its coordinates.
After loading a raster from the file the system places three control points in the corners of the added raster. The user can move any control point to another place dragging it while holding down the left mouse button. Using the context menu command Add Control Point new points can be added, the point on which the cursor is placed can be removed by the command Remove Control Point. The system will prohibit leaving less than three control points.
The pane located at the bottom of the window when the tab “Georegistration” is selected contains coordinates of georegistration control points. In the case if the user specified coordinates of more than three control points, as a rule, the system is unable to perform precise binding of all points. In this case such a variant of raster georegistration is selected which gives minimum total inaccuracy of coordinates of all control points. In the pane of control point inaccuracy along the axes X and Y is displayed.
When the cursor is in the sample pane within the raster graphics boundaries, the status bar displays its coordinates in the raster coordinate system and in the map coordinate system (the latter are displayed only when coordinates of not less that three control points are specified).
The buttons and turn on the mode of displaying boundaries and the mode of editing them accordingly. Feature boundary is a polygon displayed by a dark gray line. The part of the raster graphics located outside the boundary will not be displayed in the course of map browsing, that is, it will be transparent. Initially, a rectangle covering all the raster graphics is the boundary for the feature that is being created. To change boundary configuration it is necessary to drag square handles located on the vertices of the boundary rectangle holding down the left mouse button. To add a new vertex it is required to click somewhere on the boundary line (a small circle will appear), then call context menu and perform the command Add vertex. After that it is possible to drag the new vertex to the necessary place.
It is impossible to turn on the mode of editing control points and the mode of editing boundaries simultaneously.
To remove an unnecessary vertex it should be selected by a mouse click and the context menu command Remove element should be performed. This command also permits removal of two neighboring vertices simultaneously if any point on the edge connecting them is selected.
An image feature can have several boundaries. To add a new boundary it is necessary to perform the context menu command Add boundary and then indicate the polygon vertices clicking on them. Adding a new boundary is completed by a double click.
To remove the boundary any point of this boundary should be selected and the command Remove boundary performed.
Image feature boundaries as well as area feature boundaries should not intersect each other and themselves. All inner boundaries should lie inside the outer boundary.
The button
is active only when a monochrome raster is loaded. Pushing this button causes color inversion, i.e. all white pixels become black and vice versa.
All operations performed after turning on the mode of editing boundaries can be canceled one by one beginning from the last operation. To do this it is enough to perform the context menu command Undo.
The preview mode of an image feature is turned on by the button
if coordinates of at least three control points are specified and the editing modes are turned off. The preview mode is a mode of viewing taking into account the actions of added boundaries, that is, areas outside the boundaries will be transparent.
Pushing the button OK completes adding an image feature, after pushing the button Cancel feature adding is canceled.
After the image feature has been created it doesn't keep its links with the source file. Usually the feature is stored in GDB in compressed format which requires much less space than the source file. If necessary, it is possible to unload the raster graphics in any of the graphic formats supported using the button
.
One more important operation which can be performed with an image feature is raster transformation. This operation will be described together with a contiguous operation of map transformation in chapter 20 “Transformation of coordinates”.