Method and apparatus for searching line data in graphic data base system

Abstract: A method for searching line data (7) to be transmitted to a terminal (6) which demands an output map. The line data (7) is obtained by selecting line segments within an output domain (2) from the entire line data (3) included in an object map (1) read from a graphic file (4). The selection of the line segments is performed by obtaining the coordinates of intersections (P i ') of lines specifying the output domain (2) and line segment specified by any two adjacent characteristic points (Pi) on a line associated with line data read out from the graphic file, and then by arranging the intersections (P i ') and the characteristic points (Pi) within the output domain (2) sequentially along the line. This makes it possible to shorten the response time between a demand from the terminal (6) and the actual output of the line data (7) within the output domain (2) to that terminal.

Description: The present invention relates to a method and apparatus for searching line data in a graphic data base system. Recently, computer mapping systems have been extensively used to retrieve graphic data of a desired area, and to display a map of that area based on the graphic data in response to access to a graphic data base system from a terminal. The graphic data base system is built by representing each line or graphic element on a map in the form of line data, and by storing the line data into a file. Here, the line data usually consists of sequentially arranged coordinates of characteristic points on a line. Such computer mapping systems have already been used in the fields of public facility management systems, road management systems, housing management systems, administrative management systems or the like. Thus, the graphic data base systems have been built with regard to maps representing the state of burial facilities such as gas pipeline networks, water pipes, communication lines, power lines or the like, and with regard to road maps and maps representing the state of allocation of real estate. Fig. 1 is a block diagram illustrating a general computer mapping system. In this figure, reference numeral 70 designates a host computer; 71, a large capacity disk storage containing a graphic data base; 72, another large capacity disk storage comprising a work area 72b and an area for storing an application program 72a executing the input, searching or the like of the line data; 73, an attribution data input portion; 74, a display portion for confirming the input of the line data; 75, a digitizer for inputting the coordinates of each characteristic point on each line to be inputted; 76, a terminal used for searching and outputting the line data; and 77, a plotter for printing on recording paper a displayed map. The line data comprises coordinate data and attribution data (that is, line type tag). The coordinate data is inputted by sequentially designating the characteristic points on a line, which is a graphic element, on a map which is set on the digitizer 75. The attribution data is obtained by designating the type of a line segment, such as a solid line, a broken line, straight line or a semicircle, between two adjacent characteristic points by the attribution data input portion 73. The attribution data may be omitted when the entire lines to be inputted are represented by a single type of a line such as a solid straight line. Fig. 2 illustrates a line data format cited from page 44 of "Digital Mapping", directed by the Geographical Survey Institute of Japan, and published by Kajima Institute Publishing Co., LTD., 1991. The line data format comprises a header 81 followed by a data area 82. Each sector of the data area 82 includes three kinds of data: the x-coordinate and y-coordinate of each characteristic point stored in the first and second portions of the sector, and a line type tag as the attribution data stored in the third portion. Since the area to be handled by the graphic data base system is very broad such as Tokyo, the area is usually divided into many rectangular unit areas, each of which is represented by a piece of map. For example, the unit area is defined as a rectangular area 2 km from east to west by 1.5 km from north to south, that is, the map of a unit area is 80 cm × 60 cm on a national large scale map of Japan whose reduced scale is 1/2500. The line data of such maps are generally stored in the disk storage 71 on the block basis. Each of the blocks contains the line data of each one map. Each map has a map number which is used as a key for searching the map. Fig. 3 illustrates an example of the map which is accessed from the terminal 76. When the host computer 70 issues a command demanding the output of the map 85 by using a street name or the like as a key, a rectangular output domain 86 is set in the object map 85 (the object map here refers to a map which is retrieved from the file, and whose portion or portions are outputted from the terminal 76). The application program 72a reads the line data group stored in a block of the graphic file associated with the number of the map 85 from the disk storage 71, that is, reads the entire line data of the line data group associated with the object map 85 including those of the output domain 86, and transmits the line data group to the terminal 76. When the terminal 76 receives the line data group, it selects only the line data necessary to output the output domain 86. Incidentally, the term "rectangle" includes a square in this specification. Thus, even if only a part of the line data of the object map 85 is demanded from the terminal 76, the host computer 70 in the conventional system must transmit the entire line data associated with the object map 85. In other words, line data unnecessary for outputting the output domain 86 is transmitted to the demanding terminal 76 through a communication line, and the terminal 76 selects the line data necessary for outputting the output domain 86. As a result, the response time from the demand to the output of the output domain 86 is lengthened. To overcome this problem, an expensive serial line of 64 kbps must be used instead of an inexpensive serial line of 9.6 kbps, for example. In addition, the terminal must temporarily store the line data unnecessary for outputting the output domain, which requires a large capacity storage in the terminal 76. For example, let us suppose that an area of 20 cm × 15 cm is selected from the 80 cm × 60 cm map of a unit area of 2 km × 1.5 km on the national large scale map of Japan whose reduced scale is 1/2500 so that the selected area is to be displayed on a screen without reduction. In this case, if the line density is uniform, the line data as much as 16 times the necessary amount for outputting the area of interest (that is, (80cm × 60cm)/(20cm × 15cm)) must be transmitted from the host computer 70 to the terminal 76. "Displays, Technology and Applications", Vol. 8, No. 2, April 1987, UK, pages 87 to 97, BELCH: "Analysis of the raster-based 2D vector graphics system", discloses a technique for scrolling over a large coordinate system and displaying vectors on a view port. All vectors within a display file are subjected, on each scanning, to the computational processes of transformation, clipping and drawing. The first process involves a translation, scaling and rotating of component vectors according to the diagram's position relative to the view port. The second process rejects vectors which are not visible through the view port, accepts those which are entirely visible, and clips those which are only partly visible. Each visible vector is then drawn by calculating the address of each pixel along it. This procedure involves a large computational load. It is an object of the present invention to provide a method and apparatus for searching line data in a graphic data base system, which can shorten the response time from a demand to the output of the map, and can decrease the capacity of the storage of the terminal. According to the present invention, there is provided a method for searching line data in accordance with claim 1. The method may further comprise a step of forming new second line data by affixing the maximum values and minimum values to the second line data. Moreover, the present invention provides an apparatus in accordance with claim 3. According to the present invention, a host computer which executes the claimed steps or which functions as the claimed means with the application program, receives a demand for outputting a partial area (output domain) of a map from the terminal, and transmits the line data having a possibility that at least a part of the line associated with that line data may be included in the output domain. In other words, the host computer removes the line data having no possibility to be used for outputting the partial area, and then transmits only the selected line data to the terminal. The above and other objects, effects, features and advantages of the present invention will become more apparent from the following description of the embodiments thereof taken in conjunction with the accompanying drawings. Fig. 1 is a block diagram showing a general computer mapping system; Fig. 2 is a diagram showing an example of a general data format of line data; Fig. 3 is a diagram illustrating the relationship between an object map and an output domain; Fig. 4 is a block diagram showing the principle of an embodiment of a method and apparatus for searching line data in a graphic data base system in accordance with the present invention; Fig. 5 is a diagram illustrating the relationship between the output domains and rectangular areas 22 and 24 configured by representative values (maximum and minimum values) of each line data of the embodiment; Fig. 6 is a diagram illustrating the relationship between a line as a graphic element and its representative values x 1 , y 1 x 13 and y 11 in the embodiment; Fig. 7 is a diagram illustrating an example of a data format of line data used by the embodiment; Fig. 8 is a flowchart showing the procedure for obtaining the representative values in the process for generating a coordinate data sequence to be transmitted to a terminal in the embodiment; and Fig. 9 is a flowchart showing the procedure for selecting line data to be transmitted to a terminal from the line data read out of a graphic file in the embodiment. The invention will now be described with reference to the accompanying drawings. Before explaining the details of an embodiment in accordance with the present invention, the principle thereof will be described. Fig. 4 shows the principle of the embodiment. In this figure, an object map 1 is identified by its number or address information entered from a terminal by an operator. An output domain 2 is also designated by the operator who enters more detailed address information into a terminal, or who sets a rectangular domain arbitrarily on the object map 1 displayed on the screen of the terminal. In this case, supplementary figures providing information on facility management or the like are not included in the map. A line data group 3 is formed for all lines ℓ 1 , ℓ 2 , ℓ 3 ,... in the object map 1. Each line data of the line data group 3 includes representative values followed by a coordinate data array. The representative values are the maximum and minimum values of the coordinate data array associated with each line, and is obtained for each coordinate axis. The coordinate data array is formed by arranging coordinates of characteristic points on each line sequentially along the line. The entire line data of each line data group associated with a map is stored in each one block of a graphic file 4. Thus, the graphic file 4 stores the line data group 3 for each map individually. An application program 5 builds the graphic file 4 consisting of the line data, selects the line data that can probably be contained in the output domain 2 from the line data group 3 read from the graphic file 4, and transmits only the selected line data to a terminal 6. The terminal 6 is provided for the purpose of requiring desired data and outputting a desired map. It issues to a host computer a command which designates the number of a desired map and the output domain 2, arranges the output map based on the received line data, and displays or prints the output map. The rectangular output domain 2 is defined by the bottom left vertex (x A , y A ) and the top right vertex (x B , y B ), and the maximum value and the minimum value of the line ℓ 2 along the x-coordinate are x4 and x 1 , and those along the y-coordinate are y 4 and y 3 . The four values are referred to as representative values of the line data associated with the line ℓ 2 . The application program 5 carries out the following steps to meet the demand of the terminal for outputting a desired map. STEP S1: The application program 5 reads out the entire line data of the line data group 3 of the designated object map 1 from the graphic file 4, and proceeds to the next step. STEP S2: The application program 5 retrieves the next line data to be processed from the line data group 3, and proceeds to the next step. STEP S3: The application program 5 obtains representative values, that is, the maximum values and minimum values of the line data for respective coordinate axes (for example, x 4 , y 4 , x 1 , y 3 ), and the coordinates of the setting points of the output domain 2 (for example, x A , y A , x B , y B ), and then compares the representative values and the coordinates of the setting points in a predetermined manner. After that, it proceeds to the next step. STEP S4: The application program 5 tests to determine whether at least a part of the line associated with the line data can probably be contained in the output domain 2. For example, it determines whether or not the conditions x max > x A , x min < x B , y max > y A and y min < y B are simultaneously met, and proceeds to the next step if the conditions are satisfied, and returns to step S2 if the conditions are not satisfied. STEP S5: The application program 5 transmits the line data that satisfies the conditions of step S4 to the terminal 6, and returns to step S2. Thus, the line data needed for outputting the line segments in the output domain 2 is selected from the line data group 3 retrieved from the graphic file 4. More specifically, the graphic elements in a designated object map 1 consisting of many lines ℓ 1 , ℓ 2 , ℓ 3 ,... are divided into three classes in terms of the relative positions to the output domain 2: lines which are entirely included in the output domain 2 like the line ℓ 1 ; lines which are partially included in the output domain 2 like the line ℓ 2 ; and lines which are entirely outside the output domain 2 like the line ℓ 3 . In this embodiment, the line data associated with the lines ℓ 1 and ℓ 2 are selected, whereas the line data associated with the line ℓ 3 are removed. The method for selecting the line data is not restricted to the above-described method wherein the representative values, that is, the maximum values and minimum values (x 4 , x 1 , y 4 , y 3 ) of the respective coordinate axes are compared with the coordinates (x A , y A , x B , y B ) of the setting points of the output domain 2 in order to determine whether the conditions x max > x A , x min < x B , y max > y A and y min < y B are satisfied. For example, when the output domain is located at a corner of the object map 1 as designated by reference numeral 21 of Fig. 5, the conditions x min < x B and y max > y A can be employed as a criterion of determining whether the line ℓ 6 is included in the output domain 21. In Fig. 5, a line ℓ 4 is entirely outside the output domain 23, and a line ℓ 5 is partially included in the output domain 23, although the two lines ℓ 4 and ℓ 5 have common maximum values and minimum values (x 9 , x 6 , y 9 , y 6 ) for respective coordinate axes. In such a case, the application program 5 selects both line data associated with the lines so as to be sent to the terminal. In other words, the application program 5 does not discriminate the line ℓ 4 which is located completely outside the output domain 23 from the line ℓ 5 which in part is contained in the output domain 23. Thus, this embodiment tests to determine only a possibility whether at least a part of the line associated with a line data can be contained in the output domain. In summary, the selection method described above checks whether the rectangular area formed by the representative values of each line data can overlap with the output domain. For example, with regard to the lines ℓ 4 and ℓ 5 , the method checks whether a rectangular area 24 overlaps the output domain 23, and with regard to the line ℓ 6 , whether a rectangular area 22 overlaps the output domain 21. The embodiment will now be described in more detail referring to Figs. 6 - 9. Fig. 6 is a diagram illustrating the relationship between a line as a graphic element and its representative values. The line data of the line consists of a coordinate data array formed by sequentially arranging the x- and y-coordinates of characteristic points P 1 - P 15 and their representative values which are the maximum values and minimum values of the coordinates of the characteristic points. In this case, the representative values are the x- and y-coordinates x 1 and y 1 of the point P 1 as the minimum values, and the x-coordinate x 13 of the point P 13 and y-coordinate y 11 of the point P 11 as the maximum values. Fig. 7 is a diagram illustrating an example of a line data format of the present invention. This line data format is a revised version of that shown in Fig. 2. The header 31 is followed by a representative value area 32 recording the representative values consisting of the maximum values and minimum values which are obtained, for each coordinate axis, from the coordinates of the characteristic points on the line, which coordinates are stored in the following data area 33. For example, with regard to the line data of the line of Fig. 6, the coordinate data (x 13 , y 11 ) and (x 1 , y 1 ) are recorded in the area 32 as the maximum values and minimum values, respectively. Fig. 8 is a flowchart showing the steps for obtaining the representative values (x max , y max , x min , y min ) in the process of forming the coordinate data array. The application program 5 performs the following steps on each line as a graphic element. STEP S11: The application program 5 sets initial values of the representative values x max , y max , x min and y min . For example, it sets the x-and y-coordinates of the bottom left vertex of the object map 1 as the initial values of the representative values x max and y max , and the x- and y-coordinates of the top right vertex of the object map 1 as the initial values of the representative values x min and y min . In addition, it substitutes "1" into i as the initial value of characteristic points to be processed, and then proceeds to the next step. STEP S12: The application program 5 tests to determine whether processing of all the characteristic points on the line has been completed. If the answer is positive, it proceeds to step S23, whereas if the answer is negative, it proceeds to the next step. STEP S13: The application program 5 reads the x- and y-coordinates of the characteristic point P i , and proceeds to the next step. STEP S14: The application program 5 tests to determine if the condition x i > x max holds, and proceeds to the next step if the answer is positive, whereas it proceeds to step S16 if the answer is negative. STEP S15: The application program 5 substitutes x i into x max , and proceeds to the next step. STEP S16: The application program 5 tests to determine if the condition x i < x min holds, and proceeds to the next step if the answer is positive, whereas it proceeds to step S18 if the answer is negative. STEP S17: The application program 5 substitutes x i into x min , and proceeds to the next step. STEP S18: The application program 5 tests to determine if the condition y i > y max holds, and proceeds to the next step if the answer is positive, whereas it proceeds to step S20 if the answer is negative. STEP S19: The application program 5 substitutes y i into y max , and proceeds to the next step. STEP S20: The application program 5 tests to determine if the condition y i < y min holds, and proceeds to the next step if the answer is positive, whereas it proceeds to step S22 if the answer is negative. STEP S21: The application program 5 substitutes y i into y min , and proceeds to the next step. STEP S22: The application program 5 increments the value i to i+1, and proceeds to step S12. STEP S23: The application program 5 specifies the representative values x max , x min , y max and y min . Thus, the maximum values and minimum values for respective coordinate axes have been obtained. The sequence of each pair of steps S14 and S15, S16 and S17, S18 and S19, and S20 and S21 can be arbitrarily changed. Fig. 9 is a flowchart showing the steps for searching the line data group 3 retrieved from the graphic file 4 in order to select line data to be transmitted to the terminal. STEP S31: The application program 5 specifies a range of search by using the setting points of the output domain 2 designated by an operator. For example, when a rectangular area is used as the output domain 2 as in a normal case, the x- and y-coordinates (x A , y A ) of its bottom left vertex, and the x- and y-coordinates (x B , y B ) of its top right vertex are used as the setting points of the output domain 2 (see, Fig. 4). After that, the application program 5 proceeds to the next step. STEP S32: The application program 5 reads from the graphic file 4 the line data group 3 of the object map 1 designated by the terminal 6, and proceeds to the next step. STEP S33: The application program 5 tests to determine whether the selection procedure, which selects the line data to be transmitted to the terminal, has been completed with regard to all the line data, and terminates the search if the answer is positive, whereas it proceeds to the next step if the answer is negative. STEP S34: The application program 5 chooses from the line data group 3 the next line data to be subjected to the selection procedure, obtains the representative values (x max , y max , x min , y min ) by using steps S11-S23 of Fig. 8, and proceeds to the next step. STEP S35: The application program 5 tests to determine whether the condition x max > x A holds, and proceeds to the next step if the answer is positive, whereas it returns to step S33 if the answer is negative. STEP S36: The application program 5 tests to determine whether the condition x min < x B holds, and proceeds to the next step if the answer is positive, whereas it returns to step S33 if the answer is negative. STEP S37: The application program 5 tests to determine whether the condition y max > y A holds, and proceeds to the next step if the answer is positive, whereas it returns to step S33 if the answer is negative. STEP S38: The application program 5 tests to determine whether the condition y min < y B holds, and proceeds to the next step if the answer is positive, whereas it returns to step S33 if the answer is negative. STEP S39: The application program 5 transmits the line data to the terminal 6, and returns to step S33. In such a way, the application program 5 selects only the line data associated with the output domain 2, which is designated by the operator, from the line data group 3 read from the graphic file 4. The sequence of the steps S35 - S38 can be arbitrarily changed. The method for searching line data of the embodiment selects the line data which seems to be necessary for outputting the map within the output domain 2 from the line data group 3 associated with the object map 1. In other words, the application program 5 transmits the line data to the terminal 6 after removing the line data which is unnecessary for outputting the map in the output domain 2. As a result, the first embodiment can shorten the response time from the demand for outputting the map in the output domain 2 to the actual output thereof. In addition, it can reduce the memory capacity of the terminal.

Claims: A method for searching line data in a graphic data base system, comprising the steps of: (a) reading first line data associated with each line included in an object map (1) from a graphic file (4) as second line data, each of said first line data being formed by arranging coordinates of characteristic points (P i ) on a continuous line (ℓ 1 to ℓ 6 ) sequentially along the line, and by storing the arranged coordinates in said graphic file (4); the axes of said coordinates being x-coordinate axis and y-coordinate axis; (b) storing coordinates of setting points (x A , x B , y A , y B ) defining an output domain (21, 23) which is arbitrarily set in said object map (1), said output domain (21, 23) being a rectangle whose diagonal vertices are (x A , y A ) and (x B , y B ) where x A < x B and y A < y B ; (c) obtaining for each of said second line data, maximum values (x max , Y max ) and minimum values (x min , y min ) of said characteristic points (P i ) constituting the second line, data, each said maximum value and minimum value being obtained for each coordinate axis of said coordinates; (d) comparing each of said maximum values (x max , y max ) and minimum values (x min , y min ) with the coordinates of said setting points (x A , x B , y A , y B ); (e) determining for each line represented by said second line data whether there is a possibility that at least a part of the line can be included in said output domain when the following conditions are simultaneously satisfied: x max > x A , x min < x B , y max > y A , and y min < y B ; and selecting said second line data associated with the line as third line data only when there is said possibility; and (f) transmitting said third line data to an external terminal. A method for searching line data in a graphic data base system as claimed in claim 1, characterized in that said step (c) further comprises a step of forming new second line data by affixing said maximum values and minimum values to said second line data. An apparatus for searching line data in a graphic data base system, comprising: (a) means for reading first line data associated with each line included in an object map (1) from a graphic file (4) as second line data, each of said first line data being formed by arranging coordinates of characteristic points (P i ) on a continuous line (ℓ 1 to ℓ 6 ) sequentially along the line, and by storing the arranged coordinates in said graphic file (4); the axes of said coordinates are x-coordinate axis and y-coordinate axis; (b) means for storing coordinates of setting points (x A , x B , y A , y B ) defining an output domain (21, 23) which is arbitrarily set in said object map (1), said output domain (21, 23) being a rectangle whose diagonal vertices are (x A , y A ) and (x B , y B ) where x A < x B and y A < y B ; (c) means for obtaining, for each of said second line data, maximum values (x max , y max ) and minimum values (x min , y min ) of said characteristic points (P i ) constituting the second line data, each said maximum value and minimum value being obtained for each coordinate axis of said coordinates; (d) means for comparing each of said maximum values (x max , y max ) and minimum values (x min , y min ) with the coordinates of said setting points (x A , x B , y A , y B ); (e) means for determining for each line represented by said second line data whether there is a possibility that at least a part of the line can be included in said output domain when the following conditions are simultaneously satisfied: x max > x A , x min < x B , y max > y A , and y min < y B ; and selecting said second line data associated with the line as third line data only when there is said possibility; and (f) means for transmitting said third line data to an external terminal.

Inventors: SATO HIROTO, SHINOAKI SAKURA, TANAKA KYOZO, SATO, HIROTO, SHINOAKI, SAKURA, TANAKA, KYOZO
Applicants: TOKYO GAS CO LTD, TOKYO GAS CO., LTD.
Application year: 1993
Main classification: G06T11
IPC codes: G06T1, G06F17, G06T11