• Nem Talált Eredményt

Creating data generated partly automatically based on imported data

In document Environmental Informatics (Pldal 124-128)

6. Connecting geometrical and attribute data

6.2. Creating data generated partly automatically based on imported data

Imported maps can contain several types of data from which new attributes can be generated in the geoinformatic system. This method is presented on the basis of attributing values to the contours of topographic maps.

First of all the appropriately prepared vector maps (e.g. dwg format) map is imported. Preparation in this case means that only the contour lines from the original map are stored in a separate file (for details see chapter 6.2.1). The initial step for importing (using the command View → Add Theme) is discussed in detail in chapter 11.2 of the Geoinformatic Applications textbook. Make sure that contour lines are imported as Lines! (Do not be confused by the totally different meaning of the same expression in different surroundings: Line means line segment type in AutoCAD.) The aim of the procedure is to convert the vector file into shape (shp) format.

Following this when the command Open Theme Table is selected the data table of the vector file appears. The default data of the table are the following (Figure 7.1):

• Shape: object type of the shape file (it can be Point - point, PolyLine - line and Polygon - area).

• Entity: the object type from which the given element is composed (in the present case the polygon is composed of closing a polyline).

• Layer: layer of the object in the original vector file.

• Elevation: default value of elevation above sea level is 0. Determination of the real value will be the next step.

• Thickness: value of line thickness. If not defined separately it is 0. The default 0 value is practical for future analyses when line thickness is important.

• Color: colour of the object (indicated by a code).

Figure 7.1: Original data table of contour lines

With the Table → Start Editing command the data table can be edited (this is indicated by that the letters of the column captions become normal). Deleting unnecessary columns is not essential but recommended for better arrangement. Click on the caption of the column to be deleted. Successful highlighting is indicated by white letters with grey background in the caption (as can be seen in the case of column named Elevation in Figure 7.2). With the command Edit → Delete Field the column will be deleted. Any column can be deleted except for the one describing the type of the object (Shape). Note, that delete cannot be reversed therefore rather delete less data than miss any important ones later! When digital elevation models are prepared the Layer column has to be retained as contour lines were taken in the layers according to their values in the original vector file. Retaining the Elevation column is also practical as contour line values will be placed here in the next step (Figure 7.2).

Figure 7.2: Modified data table of contour lines (only the unnecessary columns were deleted)

The next step is to determine the elevation value of the contour lines. In the case of a properly prepared vector file (see chapter 6.2.1) this is a relatively easy and fast procedure. According to the recommended method, in the imported vector file the name of the Layer means the value of the contour and this can be found in the data Table of shape (Layer column). Here, however, the value is regarded to be text (this is indicated by their left alignment - like for example in Microsoft Excel). This has to be converted into number. The procedure can only be successful if there are no other characters than numbers and decimal points - as the English regional setting is active. In case underlining (or any other character) indicated the decimal point (as is recommended in the course of vectorizing, for more details see chapter 6.2.1) it has to be replaced by point before conversion. This cannot be done automatically for all characters in ArcView, we have to open the data table and re-write the characters

one-by-one (see chapter 11.4 of Geoinformatic Applications). It is much faster if we open the dbf format (database) file associated with the shape in a software suitable for editing tables (e.g. Microsof Excel) and replace the characters. Make sure all characters are replaced otherwise completing the following steps will not be possible.

Converting the name of the layers into numbers is next. For this highlight the column that will contain the values of elevation above seal level. This can be the (already existing) Elevation column but new columns can be formed as well (for more details see chapter 11.4 of Geoinformatic Applications). Then when the Field → Calculate…command is given the Field Calculator window will appear. It contains the following parts (Figure 7.3):

• Fields (column): The column from the data of which calculation is made.

• Type: Data type of the column containing the data. This can be Number, String (text) or Date.

• Request: List of the possible procedures

The columns into which data will be entered can be seen above the procedure window on the left bottom (the white, rectangle shape part). This can be seen in black colour in the grey background and cannot be changed in this phase of the procedure (the Elevation column in our example). The procedure window shows the requested procedure series for which select first the column the data of which are used from the Fields part: it will appear in the procedure window after a double left click. Then highlight the original data type in the Type part (left click) - this will not appear in the procedure window. Finally choose the demanded procedure from the Request part: this will also appear in the procedure window after a double left click. In our current example the following procedures are selected (Figure 7.3):

• Fields (column): Layer - elevation values are contained by the name of the layer.

• Type: String - the layer name is text (it cannot be number).

• Request: AsNumber - this is the command transforming text into number. (Paying attention to that it contains only numbers and decimal points as discussed above!)

Figure 7.3: The Field Calculator window

As a result of the procedure the elevation values of the contour lines will appear in the Elevation column.

Number data type is indicated by their right alignment in the cells (like in Microsoft Excel) (Figure 7.4).

Figure 7.4: Modified data table of contour lines with the elevation values

In case any data was not in the appropriate format in the Layer column (i.e. contained not only numbers and decimal points) an error message appears (Figure 7.5).

Figure 7.5: Conversion error message

Conversion is executed but improperly: the software stops the process after the first failed row (Figure 7.6). In this way, apparently this is unsuitable for further procedures. The mistake has to be corrected (by replacing the faulty characters).

Figure 7.6: Modified data table of the contour lines with the elevation values in the case of faulty original data It is very important to eliminate all highlighting at the end of construction using the Edit → Select None command as any object that remained highlighted will not be presented when the thematic map is constructed!

Closing the construction and saving the data are made by the Table → Stop Editing command. At this time a warning appears in the Stop Editing pop-up window (Figure 7.7) asking whether we want to save the changes (Save Edits?): apparently select Yes if the changes are regarded to be appropriate.

Figure 7.7: Warning before saving the data table

In document Environmental Informatics (Pldal 124-128)