Summary of the invention
The embodiment of the present invention provides a kind of display level defining method and device of polygon object, determining the mode of the display level of polygon object in order to the corresponding relation solved between the existing display level by pre-setting different file layout map, causing the problem that polygon object cannot correctly show.
The display level defining method of a kind of polygon object that the embodiment of the present invention provides, comprising:
According to the map datum of the map file of the first form, determine the actual geographic area that in described map datum, each polygon object takies;
According to the actual geographic area that each polygon object takies, and the minimum actual geographic area that the display level of the map file of the second form preset is corresponding, determine polygon object at least one display level in the map file of the second form, wherein said minimum actual geographic area refers to the actual geographic area of the minimum polygon object that display level can show.
Alternatively, according to the map datum of the map file of the first form, determine the actual geographic area that in described map datum, each polygon object takies, comprising:
From the map datum of the map file of the first form, obtain the latitude and longitude coordinates of each boundary node of each polygon object;
According to the latitude and longitude coordinates of each boundary node of each polygon object, determine the actual geographic area that each polygon object takies.
Alternatively, the map datum of the described map file from the first form, the latitude and longitude coordinates obtaining each boundary node of each polygon object specifically comprises:
From in the map datum the first map file, obtain the polygon information of each polygon object and the nodal information of boundary node thereof;
From the polygon information of polygon object, obtain the node identification of each boundary node of polygon object;
According to the node identification of each boundary node of polygon object, from the nodal information of described polygon object, obtain the latitude and longitude coordinates of each boundary node of polygon object.
Alternatively, if polygon object is convex polygon object, then the described latitude and longitude coordinates according to each boundary node of polygon object, determine to comprise the actual geographic area that polygon object takies:
An interim point is selected from convex polygon object;
According to the latitude and longitude coordinates of described interim point, and the latitude and longitude coordinates of each boundary node of described convex polygon object, determine by described interim point and the described convex polygon object often area of each triangle object that forms of adjacent two boundary nodes;
By the area of all triangle object and, be defined as the area of described convex polygon object.
Alternatively, if polygon object is concave polygon object, then the described latitude and longitude coordinates according to each boundary node of polygon object, determine to comprise the actual geographic area that polygon object takies:
Obtain the convex polygon object that described concave polygon object is corresponding;
An interim point is selected from described convex polygon object;
According to the latitude and longitude coordinates of described interim point, and the latitude and longitude coordinates of each boundary node of described convex polygon object, determine by described interim point and the described convex polygon object often area of each triangle object that forms of adjacent two boundary nodes;
According to the area of all triangle object and, and the difference of the area of described convex polygon object and described concave polygon object, determines the area of described concave polygon object.
Alternatively, select one to put from described convex polygon object to be specially temporarily:
Elect arbitrary boundary node of described convex polygon object as described interim point.
Alternatively, the described actual geographic area taken according to each polygon object, and the minimum actual geographic area that the display level of the map file of the second form preset is corresponding, determine that polygon object at least one display level in the map file of the second form specifically comprises:
The minimum actual geographic area that the actual geographic area taken by polygon object is corresponding with the display level of the map file of the second form preset compares, if the actual geographic area that described polygon object takies is more than or equal to described minimum actual geographic area, then determine that the display level of described polygon object comprises display level corresponding to described minimum actual geographic area.
The display level determining device of a kind of polygon object that the embodiment of the present invention provides comprises:
First determination module, for the map datum of the map file according to the first form, determines the actual geographic area that in described map datum, each polygon object takies;
Second determination module, for the actual geographic area taken according to each polygon object, and the minimum actual geographic area that the display level of the map file of the second form preset is corresponding, determine polygon object at least one display level in the map file of the second form, wherein said minimum actual geographic area refers to the actual geographic area of the minimum polygon object that display level can show.
The actual geographic area of the polygon object that can show due to electronic chart each display level must be more than or equal to the actual geographic area of the minimum polygon object that corresponding display level can show, if the actual geographic area of polygon object is less than described minimum actual geographic area, then this polygon object there is no need to show in this display level, therefore, the present invention utilizes the actual geographic area of polygon object and display level to determine the display level of this polygon object with corresponding minimum actual geographic area, what each display level was shown is be necessary at this layer the polygon object that carries out showing, thus ensure that each polygon object can show in correct display layer level, overcoming prior art polygon object cannot the appearance of correct display problem in electronic chart.
Embodiment
The basic thought of the embodiment of the present invention is: the actual geographic area of the polygon object that can show due to electronic chart each display level must be more than or equal to the actual geographic area of the minimum polygon object that corresponding display level can show, therefore, the present invention utilizes the actual geographic area of polygon object and display level and corresponding minimum actual geographic area to determine the display level of this polygon object, and what each display level was shown is be necessary at this layer the polygon object that carries out showing.
Below in conjunction with Figure of description, the embodiment of the present invention is described in further detail.
As shown in Figure 1, be the display level defining method process flow diagram of the polygon object that the embodiment of the present invention provides, comprise the following steps:
S101: according to the map datum of the map file of the first form, determines the actual geographic area that in described map datum, each polygon object takies.
In this step, from the map datum of the map file of the first form, obtain the latitude and longitude coordinates of each boundary node of each polygon object; According to the latitude and longitude coordinates of each boundary node of each polygon object, determine the actual geographic area that each polygon object takies.Here polygon object refers to the Background factors in map, such as lake, river, park etc.
S102: the actual geographic area taken according to each polygon object, and the minimum actual geographic area that the display level of the map file of the second form preset is corresponding, determine polygon object at least one display level in the map file of the second form, wherein said minimum actual geographic area refers to the actual geographic area of the minimum polygon object that display level can show.
In step S101 and S102, the map file of described first form and the map file of the second form are the map file of different-format, and such as, the map file of the first form is PDF, and the map file of the second form is EMF form.
In this step, the map of different display level has the engineer's scale of different zoom ratio, is also the engineer's scale of the corresponding scaling of each display level; Display level is higher, and engineer's scale is larger, and also, display level is higher, and the map content of display is more detailed, geometric accuracy is higher.
In this step, the minimum actual geographic area that the actual geographic area taken by polygon object is corresponding with the display level of the map file of the second form preset compares, if the actual geographic area that described polygon object takies is more than or equal to described minimum actual geographic area, then determine that the display level of described polygon object comprises display level corresponding to described minimum actual geographic area.
Under above-mentioned embodiment, the actual geographic area that this polygon object can be taken compares respectively with the minimum actual geographic area corresponding to each display level of map file of the second form preset, and determines that whether each display level of the map file of the second form preset is the display level of this polygon object successively.
Preferably, owing to being bound to show in higher than other display level of this display level at the polygon object of certain display level display, therefore, in reality is implemented, if determine, the display level of this polygon object comprises a display level, then can determine that the display level of this polygon object in the map file of the second form also comprises other display level higher than this display level simultaneously.Based on this, actual specific compared with process in, can according to the display level order from low to high of the map file of the second form, compare the size of the actual geographic area that the minimum actual geographic area corresponding to each display level of the map file of the second form and this polygon object take successively, until determine that actual geographic area that this polygon object takies is more than or equal to a certain display level x of the map file of the second form, then determine that the display level of this polygon object in the map file of this second form comprises this display level x and all display levels higher than display level x.Or, can according to the display level order from high to low of the map file of the second form, compare the size of the actual geographic area that the minimum actual geographic area corresponding to each display level of the map file of the second form and this polygon object take successively, until determine that actual geographic area that this polygon object takies is less than a certain display level x of the map file of the second form, then determine that the display level of this polygon object in the map file of this second form comprises all display levels higher than display level x.
As shown in following table one, it is the mapping table of each display level of the map file of the second form in the present invention's specific embodiment and minimum actual geographic area (unit: square metre).In table one, display level is followed successively by Lv1 ~ Lv11 from high to low.Also namely, in table one, Lv11 is minimum display level, and engineer's scale corresponding to this display level is minimum, and the map content of display is summarized most, and the minimum actual geographic area that therefore this display level is corresponding is maximum; Lv1 is the highest display level, and engineer's scale corresponding to this display level is maximum, and the map content of display is the most detailed, and the minimum actual geographic area that therefore this display level is corresponding is minimum.
Level |
Lv11 |
Lv10 |
Lv9 |
Lv8 |
Lv7 |
Lv6 |
Lv5 |
Lv4 |
Lv3 |
Lv2 |
Lv1 |
Minimum actual geographic area |
15000 |
10000 |
5400 |
3600 |
2400 |
1500 |
800 |
600 |
300 |
150 |
50 |
Table one
From table one, if the actual geographic area that polygon object takies is 500 square metres, its area is greater than the actual geographic area of its minimum polygon object that can show corresponding to these display levels of Lv3, Lv2, Lv1, therefore, can determine that the display level of this polygon object in the map file of the second form is Lv1 ~ Lv3.
In above-mentioned S101, need the map datum of the map file according to the first form, determine the actual geographic area that in described map datum, each polygon object takies.In concrete enforcement, can first from the map datum of the map file of the first form, obtain the latitude and longitude coordinates of each boundary node of each polygon object and store, afterwards, the latitude and longitude coordinates based on each boundary node of each polygon object stored determines the actual geographic area that this polygon object takies.But; due to a boundary node usually can share by multiple polygon object (there is between different polygon object common point or common edge); if store respectively the latitude and longitude coordinates of each boundary node of each polygon object; the latitude and longitude coordinates of same boundary node will be caused to be redundantly stored repeatedly; so, a large amount of storage spaces can be wasted.Based on this, in the preferred embodiment of the present invention, give the storage mode as shown in table two and table three.Shown in table two, being the polygon information of the polygon object a1 of record, shown in table three, is the nodal information of boundary node p1, p2, p3 and p4 of record.
Major key |
Polygon identifies |
The sequence number of boundary node |
The node identification of boundary node |
1 |
a1 |
1 |
p1 |
2 |
a1 |
2 |
p2 |
3 |
a1 |
3 |
p3 |
4 |
a1 |
4 |
p4 |
Table two
Major key |
The node identification of boundary node |
Longitude coordinate |
Latitude coordinate |
1 |
p1 |
Lon1 |
Lat1 |
2 |
p2 |
Lon2 |
Lat2 |
3 |
p3 |
Lon3 |
Lat3 |
4 |
p4 |
Lon4 |
Lat4 |
Table three
In above-mentioned table two and table three, the nodal information of the polygon information of each polygon object and the boundary node of polygon object is stored respectively; Concrete execution step is as follows:
From in the map datum the first map file, obtain the polygon information of each polygon object and the nodal information of boundary node thereof;
From the polygon information of polygon object, obtain the node identification of each boundary node of polygon object;
According to the node identification of each boundary node of polygon object, from the nodal information of described polygon object, obtain the latitude and longitude coordinates of each boundary node of polygon object.
In specific implementation process, the polygon information of polygon object and the nodal information of boundary node can be obtained respectively from the map datum the map file of the first form, and store.Store the polygon mark of this polygon object and the node identification of each boundary node of this polygon object in the polygon information of each polygon object, in the nodal information of each boundary node, store node identification and the latitude and longitude coordinates of this boundary node.Like this, can be contacted by node identification foundation between polygon information and nodal information; Also be, can according to the node identification of boundary node each in the polygon information of arbitrary polygon object, the latitude and longitude coordinates of each boundary node of this polygon object is searched in the nodal information of each boundary node, afterwards, according to the latitude and longitude coordinates of each boundary node of this polygon object found, determine the area of this polygon object.
Adopt the embodiment of the present invention above-mentionedly polygon information and nodal information to be stored respectively, between polygon information and nodal information, set up the mode contacted by node identification, can reduce and the repeatability of some map datum is stored, save a large amount of storage spaces.
In specific implementation process, the polygon information of each polygon object can also comprise each boundary node that this polygon object comprises limit along this polygon object by the sequence number clockwise or after counterclockwise arrangement, as shown in Table 2.For some polygon object (such as triangle object), as long as obtain the latitude and longitude coordinates of each boundary node of this polygon object, just can determine the shape of this polygon object, but, for other polygon object, affect the information of polygon object shape except comprising the latitude and longitude coordinates of each boundary node, also comprise each boundary node putting in order in this polygon object, as shown in Fig. 2 (a) He 2 (b), the boundary node that Fig. 2 (a) is identical with each self-contained four latitude and longitude coordinates of polygon object W1 with W2 of two in 2 (b), but because the order connecting each boundary node is successively different, two polygon object are caused to have different shapes.Therefore, for this situation, can by the limit of each boundary node of polygon object along polygon object, after clockwise or counterclockwise arrangement, determine sequence number, when carrying out map and playing up, according to the sequence number of each boundary node, connect each boundary node successively, form polygon object.The latitude and longitude coordinates of sequence number to be the node of 1,2,3,4 with sequence number in Fig. 2 (b) be the respectively node of 1,2,4,3 is identical in Fig. 2 (a).
In specific implementation process, in order to improve the efficiency of the nodal information taking out each boundary node that the polygon information of arbitrary polygon object and this polygon object comprise from all polygon information stored and nodal information, index can be set up, such as b-tree indexed for polygon information and nodal information.Particularly, for above-mentioned polygon information arranges major key (primary key), as shown in Table 2.Wherein arbitrary polygon object has many polygon information of corresponding different boundary nodes, the major key key assignments that every bar polygon information correspondence one is unique, like this, every bar polygon information comprises major key key assignments, polygon mark, the polygon object sequence number of a boundary node, the node identification of this boundary node that comprise.Correspondingly, major key can be set for nodal information, as shown in Table 3.Wherein each boundary node has a nodal information, the major key key assignments that every bar nodal information correspondence one is unique, and like this, every bar nodal information comprises major key key assignments, the node identification of this boundary node and the latitude and longitude coordinates of this boundary node.After setting up b-tree indexed for polygon information and nodal information, based on the index set up, every bar polygon information or every bar nodal information can be searched, greatly improve search efficiency.
After obtaining the latitude and longitude coordinates of each boundary node of arbitrary polygon object, according to the type of this polygon object, the area of this polygon object specifically can be determined in the following ways:
If a described polygon object is convex polygon object, then
An interim point is selected from convex polygon object; Wherein, described from convex polygon object select one temporarily point be included in convex polygon inside and choose an interim point, also comprise from the border of convex polygon and choose an interim point;
According to the latitude and longitude coordinates of described interim point, and the latitude and longitude coordinates of each boundary node of described convex polygon object, determine by described interim point and the described convex polygon object often area of each triangle object that forms of adjacent two boundary nodes;
By the area of all triangle object and, be defined as the area of described convex polygon object.
As shown in Fig. 3 (a), in specific implementation process, can be optional a bit as interim point in convex polygon object, be set to P.Particularly, can first according to the latitude and longitude coordinates of each boundary node of this convex polygon object, determine the maximum latitude coordinate value of each boundary node of this convex polygon object and minimum latitude coordinate value, and the maximum latitude coordinate values of each boundary node of this convex polygon object and minimum latitude coordinate values.Afterwards, in convex polygon object optionally a bit, its latitude coordinate value is less than or equal to the maximum latitude coordinate value of each boundary node of this convex polygon object, be more than or equal to the minimum latitude coordinate value of each boundary node of this convex polygon object, and latitude coordinate is less than or equal to the maximum latitude coordinate of each boundary node of this convex polygon object, be more than or equal to the minimum latitude coordinate of each boundary node of this convex polygon object, using this point as putting P temporarily.Afterwards, determine the area of each triangle object be made up of this interim some P and every two adjacent Border Node of this convex polygon object, the area of each triangle object determined is added summation, is the area of this convex polygon object, that is, area S (A1, A2, the A3 of convex polygon object, A4, A5)=S (P, A1, A2)+S (P, A2, A3)+S (P, A3, A4)+S (P, A4, A5)+S (P, A5, A1).
In specific implementation process, can using arbitrary boundary node of described convex polygon object as described interim point, like this, this latitude and longitude coordinates temporarily put is known, with compared with convex polygon object inside optionally a bit, benefit is the number of the triangle object that can reduce composition, thus reaches raising treatment effeciency.As shown in Fig. 3 (b), using the boundary node A3 of convex polygon object as described interim point, determine the area of each triangle object be made up of this interim some A3 and every two adjacent Border Node of this convex polygon object except A3, the area of each triangle object determined is added summation, that is, the area S (A1 of convex polygon object, A2, A3, A4, A5)=S (A3, A1, A2)+S (A3, A4, A5)+S (A3, A1, A5).
If two any one polygon object described are concave polygon object, then
Obtain the convex polygon object that described concave polygon object is corresponding;
An interim point is selected from described convex polygon object;
According to the latitude and longitude coordinates of described interim point, and the latitude and longitude coordinates of each boundary node of described convex polygon object, determine by described interim point and the described convex polygon object often area of each triangle object that forms of adjacent two boundary nodes;
According to the area of all triangle object and, and the difference of the area of described convex polygon object and described concave polygon object, determines the area of described concave polygon object.
In specific implementation process, if above-mentioned polygon object is concave polygon object, the mode that this concave polygon object supplements area can be adopted as, be transformed to convex polygon object, the mode of above-mentioned calculating convex polygon object area is adopted to calculate the area of the convex polygon object after this conversion, afterwards, then by the area calculated supplementary area is deducted.As shown in Figure 4, concave polygon object Q (p1, p2 is being determined, p3, p4, p5) area time, first can supplement area for this concave polygon object, be transformed to convex polygon object Q'(p1, p2, p4, p5), adopt the method for the calculating convex polygon object area of above-mentioned introduction, at convex polygon object Q'(p1, p2, p4, p5) optional a bit as interim point in, be set to P'; Determine the area of each triangle object be made up of this interim some P' and every two adjacent Border Node of this convex polygon object, the area of each triangle object determined is added summation, is the area of this convex polygon object, that is, area S (p1, the p2 of this convex polygon object, p4, p5)=S (P', p1, p2)+S (P', p2, p4)+S (P', p4, p5)+S (P', p5, p1).Alternatively, arbitrary boundary node of convex polygon object also can be adopted as described interim point, specifically implement see the description about Fig. 3 (b), repeat no more here.Determine the area S of this convex polygon object Q'
q'after, by this area S
q'deduct the area that namely supplementary area obtains required concave polygon object, namely this area supplemented is the area of the triangle object be made up of p2, p3, p4 tri-boundary nodes.
Based on same inventive concept, a kind of display level determining device of the polygon object corresponding with the display level defining method of polygon object is additionally provided in the embodiment of the present invention, the principle of dealing with problems due to this device is similar to the display level defining method of embodiment of the present invention polygon object, therefore the enforcement of this device see the enforcement of method, can repeat part and repeats no more.
As shown in Figure 5, be the display level determining device structural representation of the polygon object that the embodiment of the present invention provides, comprise:
First determination module 51, for the map datum of the map file according to the first form, determines the actual geographic area that in described map datum, each polygon object takies;
Second determination module 52, for the actual geographic area taken according to each polygon object, and the minimum actual geographic area that the display level of the map file of the second form preset is corresponding, determine polygon object at least one display level in the map file of the second form, wherein said minimum actual geographic area refers to the actual geographic area of the minimum polygon object that display level can show.
Alternatively, described first determination module 51 specifically for:
From the map datum of the map file of the first form, obtain the latitude and longitude coordinates of each boundary node of each polygon object; According to the latitude and longitude coordinates of each boundary node of each polygon object, determine the actual geographic area that each polygon object takies.
Alternatively, described first determination module 51 specifically for: from the map datum the first map file, obtain the polygon information of each polygon object and the nodal information of boundary node thereof; From the polygon information of polygon object, obtain the node identification of each boundary node of polygon object; According to the node identification of each boundary node of polygon object, from the nodal information of described polygon object, obtain the latitude and longitude coordinates of each boundary node of polygon object.
Alternatively, if polygon object is convex polygon object, then described first determination module 51 specifically for: select an interim point from convex polygon object; According to the latitude and longitude coordinates of described interim point, and the latitude and longitude coordinates of each boundary node of described convex polygon object, determine by described interim point and the described convex polygon object often area of each triangle object that forms of adjacent two boundary nodes; By the area of all triangle object and, be defined as the area of described convex polygon object.
Alternatively, if polygon object is concave polygon object, then described first determination module 51 specifically for: obtain the convex polygon object that described concave polygon object is corresponding; An interim point is selected from described convex polygon object; According to the latitude and longitude coordinates of described interim point, and the latitude and longitude coordinates of each boundary node of described convex polygon object, determine by described interim point and the described convex polygon object often area of each triangle object that forms of adjacent two boundary nodes; According to the area of all triangle object and, and the difference of the area of described convex polygon object and described concave polygon object, determines the area of described concave polygon object.
Alternatively, described first determination module 51 is specifically for electing arbitrary boundary node of described convex polygon object as described interim point.
Alternatively, described second determination module 52 compares specifically for the minimum actual geographic area that: the actual geographic area taken by polygon object is corresponding with the display level of the map file of the second form preset, if the actual geographic area that described polygon object takies is more than or equal to described minimum actual geographic area, then determine that the display level of described polygon object comprises display level corresponding to described minimum actual geographic area.
Those skilled in the art should understand, embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt the form of complete hardware embodiment, completely software implementation or the embodiment in conjunction with software and hardware aspect.And the present invention can adopt in one or more form wherein including the upper computer program implemented of computer-usable storage medium (including but not limited to magnetic disk memory, CD-ROM, optical memory etc.) of computer usable program code.
The present invention describes with reference to according to the process flow diagram of the method for the embodiment of the present invention, device (system) and computer program and/or block scheme.Should understand can by the combination of the flow process in each flow process in computer program instructions realization flow figure and/or block scheme and/or square frame and process flow diagram and/or block scheme and/or square frame.These computer program instructions can being provided to the processor of multi-purpose computer, special purpose computer, Embedded Processor or other programmable data processing device to produce a machine, making the instruction performed by the processor of computing machine or other programmable data processing device produce device for realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be stored in can in the computer-readable memory that works in a specific way of vectoring computer or other programmable data processing device, the instruction making to be stored in this computer-readable memory produces the manufacture comprising command device, and this command device realizes the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
These computer program instructions also can be loaded in computing machine or other programmable data processing device, make on computing machine or other programmable devices, to perform sequence of operations step to produce computer implemented process, thus the instruction performed on computing machine or other programmable devices is provided for the step realizing the function of specifying in process flow diagram flow process or multiple flow process and/or block scheme square frame or multiple square frame.
Although describe the preferred embodiments of the present invention, those skilled in the art once obtain the basic creative concept of cicada, then can make other change and amendment to these embodiments.So claims are intended to be interpreted as comprising preferred embodiment and falling into all changes and the amendment of the scope of the invention.
Obviously, those skilled in the art can carry out various change and modification to the present invention and not depart from the spirit and scope of the present invention.Like this, if these amendments of the present invention and modification belong within the scope of the claims in the present invention and equivalent technologies thereof, then the present invention is also intended to comprise these change and modification.