Invention content
The embodiment of the present invention provides a kind of display level of polygon object and determines method and device, existing to solve
The correspondence between display level by pre-setting different file format maps determines the display layer of polygon object
The mode of grade, the problem of causing polygon object not show correctly.
A kind of display level of polygon object provided in an embodiment of the present invention determines method, including:
According to the map datum of the map file of the first format, determine that each polygon object accounts in the map datum
Actual geographic area;
The map file of the actual geographic area and preset second format that are occupied according to each polygon object
Show the corresponding minimum actual geographic area of level, determine polygon object the second format at least one of map file
Level is shown, wherein the minimum actual geographic area refers to the reality for the minimum polygon object for showing that level can be shown
Geographic areas.
Optionally, according to the map datum of the map file of the first format, determine that each in the map datum is polygon
The actual geographic area that shape object occupies, including:
From the map datum of the map file of the first format, the longitude and latitude of each boundary node of each polygon object is obtained
Spend coordinate;
According to the latitude and longitude coordinates of each boundary node of each polygon object, determine what each polygon object occupied
Actual geographic area.
Optionally, in the map datum of the map file from the first format, each side of each polygon object is obtained
The latitude and longitude coordinates of boundary's node specifically include:
From the map datum in the first map file, polygon information and its boundary of each polygon object are obtained
The nodal information of node;
From the polygon information of polygon object, the node identification of each boundary node of polygon object is obtained;
According to the node identification of each boundary node of polygon object, from the nodal information of the polygon object, obtain
The latitude and longitude coordinates of each boundary node of polygon object.
Optionally, if polygon object is convex polygon object, the warp according to each boundary node of polygon object
Latitude coordinate determines the actual geographic area that polygon object occupies, including:
An interim point is selected from convex polygon object;
It is sat according to the longitude and latitude of the latitude and longitude coordinates put and each boundary node of convex polygon object temporarily
Mark determines the face for each triangle object being made of the interim point and convex polygon object each adjacent two boundary node
Product;
By the sum of the area of all triangle objects, it is determined as the area of the convex polygon object.
Optionally, if polygon object is concave polygon object, the warp according to each boundary node of polygon object
Latitude coordinate determines the actual geographic area that polygon object occupies, including:
Obtain the corresponding convex polygon object of the concave polygon object;
An interim point is selected from the convex polygon object;
It is sat according to the longitude and latitude of the latitude and longitude coordinates put and each boundary node of convex polygon object temporarily
Mark determines the face for each triangle object being made of the interim point and convex polygon object each adjacent two boundary node
Product;
According to the sum of the area of all triangle objects and the convex polygon object and the concave polygon object
The difference of area determines the area of the concave polygon object.
Optionally, the interim point is selected to be specially from the convex polygon object:
The either boundary node of the convex polygon object is selected as the interim point.
Optionally, the actual geographic area occupied according to each polygon object and preset second format
Map file the corresponding minimum actual geographic area of display level, determine polygon object the second format map file
At least one of display level specifically include:
The display level pair of the actual geographic area that polygon object is occupied and the map file of preset second format
The minimum actual geographic area answered is compared, if the actual geographic area that the polygon object occupies be more than or equal to it is described most
Small actual geographic area, it is determined that the display level of the polygon object includes that the minimum actual geographic area is corresponding aobvious
Show level.
A kind of display level determining device of polygon object provided in an embodiment of the present invention includes:
First determining module is used for the map datum of the map file according to the first format, determines in the map datum
The actual geographic area that each polygon object occupies;
Second determining module, actual geographic area for being occupied according to each polygon object and preset the
The corresponding minimum actual geographic area of display level of the map file of two formats, determines polygon object on the ground of the second format
At least one of map file shows level, wherein the minimum actual geographic area refers to the minimum that shows level and can show
Polygon object actual geographic area.
Since electronic map each shows that the actual geographic area for the polygon object that level can be shown has to be larger than
In the actual geographic area for the minimum polygon object that accordingly display level can be shown, if the actual geographic of polygon object
Area is less than the minimum actual geographic area, then the polygon object is not necessarily to show in the display level, therefore, this hair
It is bright to determine that this is polygon with corresponding minimum actual geographic area using the actual geographic area and display level of polygon object
The display level of shape object so that each display level was shown be in this layer polygon object that it is necessary to be shown,
To ensure that each polygon object can be shown in correct display layer grade, overcome prior art polygon object without
The appearance of method correct display problem in electronic map.
Specific implementation mode
The basic thought of the embodiment of the present invention is:Since electronic map each shows the polygon object that level can be shown
Actual geographic area have to be larger than the actual geographic face of the minimum polygon object that can be shown equal to corresponding display level
Product, therefore, the present invention utilize the actual geographic area and display level of polygon object and corresponding minimum actual geographic face
Product determines the display level of the polygon object so that each display level show in this layer, it is necessary to be shown
Polygon object.
The embodiment of the present invention is described in further detail with reference to the accompanying drawings of the specification.
As shown in Figure 1, the display level for polygon object provided in an embodiment of the present invention determines method flow diagram, including
Following steps:
S101:According to the map datum of the map file of the first format, each polygon in the map datum is determined
The actual geographic area that object occupies.
In the step, from the map datum of the map file of the first format, each boundary of each polygon object is obtained
The latitude and longitude coordinates of node;According to the latitude and longitude coordinates of each boundary node of each polygon object, each polygon is determined
The actual geographic area that object occupies.Here polygon object refers to the Background factors in map, such as lake, river, public affairs
Garden etc..
S102:The map of the actual geographic area and preset second format that are occupied according to each polygon object
The corresponding minimum actual geographic area of display level of file, determines polygon object in the map file of the second format extremely
Few display level, wherein the minimum actual geographic area refers to the minimum polygon object that shows level and can show
Actual geographic area.
In step S101 and S102, the map file of first format and the map file of the second format are different-format
Map file, for example, the map file of the first format is PDF format, the map file of the second format is EMF formats.
In the step, difference shows that the map of level has the engineer's scale of different zoom ratio, namely each shows level
The engineer's scale of a corresponding scaling;Showing that level is higher, engineer's scale is bigger, that is, display level is higher, the map of display
Content is more detailed, geometric accuracy is higher.
In this step, actual geographic area polygon object occupied and the map file of preset second format
The corresponding minimum actual geographic area of display level is compared, if the actual geographic area that the polygon object occupies is more than
Equal to the minimum actual geographic area, it is determined that the display level of the polygon object includes the minimum actual geographic face
The corresponding display level of product.
It, can be by actual geographic area that the polygon object occupies and preset second format under the above embodiment
Each of map file display level corresponding to minimum actual geographic area be compared respectively, determine preset the successively
Each of map file of two formats show level whether be the polygon object display level.
Preferably due to which the polygon object shown in some display level is bound to other higher than the display level
It being shown in display level, therefore, in actual implementation, however, it is determined that the display level of the polygon object includes a display level,
It can then determine that display level of the polygon object in the map file of the second format further includes being higher than the display layer simultaneously
Other display levels of grade.It can be according to the display layer of the map file of the second format during actually relatively based on this
The sequence of grade from low to high compares the minimum actual geographic corresponding to each of map file of the second format display level successively
The size for the actual geographic area that area is occupied with the polygon object, the actual geographic occupied until determining the polygon object
Area is more than or equal to a certain display level x of the map file of the second format, it is determined that the polygon object is in second format
Map file in display level include the display level x and than show level x high all display levels.Alternatively, can
With the sequence according to the display level of the map file of the second format from high to low, compare the map file of the second format successively
The size for the actual geographic area that minimum actual geographic area corresponding to each display level is occupied with the polygon object, directly
The actual geographic area occupied to the determining polygon object is less than a certain display level x of the map file of the second format, then
Determine that display level of the polygon object in the map file of second format includes all displays than showing level x high
Level.
As shown in following table one, for each display level of the map file of the second format in a specific embodiment of the invention
With minimum actual geographic area (unit:Square metre) mapping table.In table one, display level is followed successively by Lv1 from high to low
~Lv11.That is, Lv11 is minimum display level in table one, the corresponding engineer's scale of the display level is minimum, the map of display
Content is most summarized, therefore the corresponding minimum actual geographic area of the display level is maximum;Lv1 is highest display level, this is aobvious
Show that the corresponding engineer's scale of level is maximum, the map content of display is most detailed, therefore the corresponding minimum actual geographic of the display level
Area 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
If from table one it is found that the actual geographic area that a polygon object occupies is 500 square metres, area is more than
The actual geographic area of its corresponding minimum polygon object that can be shown of these display levels of Lv3, Lv2, Lv1, therefore,
It can determine that display level of the polygon object in the map file of the second format is Lv1~Lv3.
In above-mentioned S101, the map datum of the map file according to the first format is needed, is determined in the map datum
The actual geographic area that each polygon object occupies.It in specific implementation, can be first from the map file of the first format
Map datum in obtain the latitude and longitude coordinates of each boundary node of each polygon object and stored, later, based on depositing
Storage each boundary node of each polygon object latitude and longitude coordinates come determine the polygon object occupy actual geographic face
Product.But (there are public affairs between different polygon objects since a boundary node would generally be shared by multiple polygon objects
Concurrent or common edge), if being stored respectively to the latitude and longitude coordinates of each boundary node of each polygon object, it will cause
The latitude and longitude coordinates of the same boundary node are redundantly stored repeatedly, in this way, a large amount of memory space can be wasted.Based on this,
In the preferred embodiment of the present invention, the storage mode as shown in table two and table three is given.Shown in table two, for the polygon of record
The polygon information of shape object a1, shown in table three, for 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, by the boundary node of the polygon information of each polygon object and polygon object
Nodal information is stored respectively;Steps are as follows for specific execution:
From the map datum in the first map file, polygon information and its boundary of each polygon object are obtained
The nodal information of node;
From the polygon information of polygon object, the node identification of each boundary node of polygon object is obtained;
According to the node identification of each boundary node of polygon object, from the nodal information of the polygon object, obtain
The latitude and longitude coordinates of each boundary node of polygon object.
In specific implementation process, polygon can be obtained respectively from the map datum in the map file of the first format
The polygon information of object and the nodal information of boundary node, and stored.The polygon information of each polygon object
The node identification of middle the polygon mark and each boundary node of the polygon object for storing the polygon object, on each boundary
The node identification and latitude and longitude coordinates of the boundary node are stored in the nodal information of node.In this way, polygon information is believed with node
It can be established and be contacted by node identification between breath;That is, can each side in the polygon information according to any polygon object
The node identification of boundary's node, the longitude and latitude that each boundary node of the polygon object is searched in the nodal information of each boundary node are sat
Mark, later, according to the latitude and longitude coordinates of each boundary node of the polygon object found, determines the face of the polygon object
Product.
Using the embodiment of the present invention it is above-mentioned polygon information and nodal information are stored respectively, polygon information and node letter
Between breath in such a way that node identification establishes contact, it is possible to reduce store, save a large amount of to the repeatability of certain map datums
Memory space.
In specific implementation process, the polygon information of each polygon object can also include the polygon object institute
Including each boundary node along the side of the polygon object by clockwise or counterclockwise arrange after sequence number, such as two institute of table
Show.For some polygon objects (such as triangle object), as long as obtaining the longitude and latitude of each boundary node of the polygon object
Coordinate, so that it may to determine that the shape of the polygon object still for other polygon objects, influences polygon object shape
The information of shape further includes row of each boundary node in the polygon object other than the latitude and longitude coordinates including each boundary node
Row sequence, as shown in Fig. 2 (a) and 2 (b), two polygon objects W1 and W2 in Fig. 2 (a) and 2 (b) respectively contain four warps
The identical boundary node of latitude coordinate, but since the sequence for being sequentially connected each boundary node is different, lead to two polygons pair
As with different shapes.It therefore, can be by each boundary node of polygon object along polygon object for such case
Side, by clockwise or counterclockwise arrange after, sequence number is determined, when carrying out map rendering, according to each boundary node
Sequence number is sequentially connected each boundary node, forms polygon object.In Fig. 2 (a) node of Serial No. 1,2,3,4 respectively with
The latitude and longitude coordinates of the node of Serial No. 1,2,4,3 are identical in Fig. 2 (b).
In specific implementation process, in order to improve taken out from all polygon informations and nodal information of storage it is any more
The efficiency of the nodal information for each boundary node that the polygon information and the polygon object of side shape object are included, can be more
Side shape information and nodal information establish index, such as b-tree indexed.Specifically, it is that major key (main key is arranged in above-mentioned polygon information
Word), as shown in Table 2.A plurality of polygon information of any of which polygon object with corresponding different boundary node, every
Polygon information correspond to a unique major key key assignments, in this way, every polygon information include major key key assignments, polygon identify,
The sequence number for the boundary node that polygon object is included, the node identification of the boundary node.Correspondingly, it can be node
Major key is arranged in information, as shown in Table 3.There is wherein each boundary node a nodal information, every nodal information to correspond to one
Unique major key key assignments, in this way, every nodal information includes the node identification and the boundary node of major key key assignments, the boundary node
Latitude and longitude coordinates.After establishing b-tree indexed for polygon information and nodal information, it can be searched every based on the index of foundation
Polygon information or every nodal information, greatly improve search efficiency.
After obtaining the latitude and longitude coordinates of each boundary node of any polygon object, according to the class of the polygon object
The area that following manner determines the polygon object specifically may be used in type:
If one, the polygon object is convex polygon object,
An interim point is selected from convex polygon object;Wherein, described that an interim point packet is selected from convex polygon object
One interim point of selection inside convex polygon is included, also includes one interim point of selection from the boundary of convex polygon;
It is sat according to the longitude and latitude of the latitude and longitude coordinates put and each boundary node of convex polygon object temporarily
Mark determines the face for each triangle object being made of the interim point and convex polygon object each adjacent two boundary node
Product;
By the sum of the area of all triangle objects, it is determined as the area of the convex polygon object.
As shown in Fig. 3 (a), in specific implementation process, interim point optionally can be a little used as in convex polygon object,
It is set as P.Specifically, the convex polygon can be determined first according to the latitude and longitude coordinates of each boundary node of convex polygon object
The maximum latitude coordinate value of each boundary node of object and minimum latitude coordinate value and each boundary node of convex polygon object
Maximum latitude coordinate values and minimum latitude coordinate values.Later, in convex polygon object optionally a bit, latitude coordinate value is less than
Equal to the maximum latitude coordinate value of each boundary node of convex polygon object, it is more than or equal to each boundary node of convex polygon object
Minimum latitude coordinate value, and latitude coordinate be less than or equal to each boundary node of convex polygon object maximum latitude coordinate, greatly
In the minimum latitude coordinate equal to each boundary node of convex polygon object, using the point as interim point P.Later, it determines by this
The area for each triangle object that interim point P is formed with the convex polygon object each two adjacent Border Node, will be determining each
The area of triangle object is added summation, the as area of the convex polygon object, that is, the area S of convex polygon object (A1,
A2, A3, 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 the either boundary node of the convex polygon object as the interim point,
In this way, the latitude and longitude coordinates put are known temporarily, optionally compared with a bit, it is advantageous in that with inside convex polygon object
The number that the triangle object of composition can be reduced, to reach raising treatment effeciency.As shown in Fig. 3 (b), by convex polygon pair
The boundary node A3 of elephant is determined as the interim point by each two phases of the interim point A3 with the convex polygon object in addition to A3
The area of each triangle object of adjacent boundary node composition, is added summation, that is, convex more by the area of determining each triangle object
The area S (A1, A2, A3, A4, A5) of side shape object=S (A3, A1, A2)+S (A3, A4, A5)+S (A3, A1, A5).
If two, any one described polygon object is concave polygon object,
Obtain the corresponding convex polygon object of the concave polygon object;
An interim point is selected from the convex polygon object;
It is sat according to the longitude and latitude of the latitude and longitude coordinates put and each boundary node of convex polygon object temporarily
Mark determines the face for each triangle object being made of the interim point and convex polygon object each adjacent two boundary node
Product;
According to the sum of the area of all triangle objects and the convex polygon object and the concave polygon object
The difference of area determines the area of the concave polygon object.
In specific implementation process, if above-mentioned polygon object is concave polygon object, it may be used as the concave polygon
Object supplements the mode of area, convex polygon object is transformed it into, by the way of above-mentioned calculating convex polygon object area
The area of the convex polygon object after the transformation is calculated, and then calculated area is subtracted to the area of supplement.Such as Fig. 4 institutes
Show, can be that the concave polygon object supplements face first when determining the area of concave polygon object Q (p1, p2, p3, p4, p5)
Product, is transformed to convex polygon object Q'(p1, p2, p4, p5), using the side of the calculating convex polygon object area of above-mentioned introduction
Method, in convex polygon object Q'(p1, p2, p4, p5) in optionally a little be used as interim point, be set as P';It determines by the interim point P'
The area of each triangle object formed with the convex polygon object each two adjacent Border Node, by determining each triangle pair
The area of elephant is added summation, the as area of the convex polygon object, that is, the area S of the convex polygon object (p1, p2, p4,
P5)=S (P', p1, p2)+S (P', p2, p4)+S (P', p4, p5)+S (P', p5, p1).Alternatively it is also possible to using convex polygon
The either boundary node of shape object is embodied referring to the description as described in Fig. 3 (b), which is not described herein again as the interim point.
Determine the area S of convex polygon object Q'Q'Afterwards, by area SQ'The area for subtracting supplement obtains required concave polygon
The area of object, the area of the supplement is i.e. for by p2, the area of the triangle object of tri- boundary nodes of p3, p4 composition.
Based on same inventive concept, a kind of display level determination with polygon object is additionally provided in the embodiment of the present invention
The display level determining device of the corresponding polygon object of method, the principle and the embodiment of the present invention solved the problems, such as due to the device
The display level of polygon object determines that method is similar, therefore the implementation of the device may refer to the implementation of method, repeats place
It repeats no more.
As shown in figure 5, for the display level determining device structural schematic diagram of polygon object provided in an embodiment of the present invention,
Including:
First determining module 51 is used for the map datum of the map file according to the first format, determines the map datum
In each polygon object occupy actual geographic area;
Second determining module 52, actual geographic area for being occupied according to each polygon object and preset
The corresponding minimum actual geographic area of display level of the map file of second format, determines polygon object in the second format
At least one of map file shows level, can be shown most wherein the minimum actual geographic area refers to display level
The actual geographic area of small polygon object.
Optionally, first determining module 51 is specifically used for:
From the map datum of the map file of the first format, the longitude and latitude of each boundary node of each polygon object is obtained
Spend coordinate;According to the latitude and longitude coordinates of each boundary node of each polygon object, determine what each polygon object occupied
Actual geographic area.
Optionally, first determining module 51 is specifically used for:From the map datum in the first map file, obtain every
The polygon information of one polygon object and its nodal information of boundary node;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 described
In the nodal information of polygon object, the latitude and longitude coordinates of each boundary node of polygon object are obtained.
Optionally, if polygon object is convex polygon object, first determining module 51 is specifically used for:From convex more
An interim point is selected on the shape object of side;According to the latitude and longitude coordinates put and each boundary of convex polygon object temporarily
The latitude and longitude coordinates of node, determination are made of the interim point with convex polygon object each adjacent two boundary node each
The area of triangle object;By the sum of the area of all triangle objects, it is determined as the area of the convex polygon object.
Optionally, if polygon object is concave polygon object, first determining module 51 is specifically used for:Obtain institute
State the corresponding convex polygon object of concave polygon object;An interim point is selected from the convex polygon object;Faced according to described
The latitude and longitude coordinates of the latitude and longitude coordinates of time point and each boundary node of convex polygon object are determined by the interim point
With the area of each triangle object of convex polygon object each adjacent two boundary node composition;According to all triangle pairs
The difference of the sum of the area of elephant and the area of the convex polygon object and the concave polygon object determines described recessed polygon
The area of shape object.
Optionally, first determining module 51 is specifically used for the either boundary node of the convex polygon object being selected as
The interim point.
Optionally, second determining module 52 is specifically used for:By the actual geographic area of polygon object occupancy and in advance
If the corresponding minimum actual geographic area of display level of map file of the second format be compared, if the polygon pair
As the actual geographic area of occupancy is more than or equal to the minimum actual geographic area, it is determined that the display layer of the polygon object
Grade includes the corresponding display level of the minimum actual geographic area.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention
Apply the form of example.Moreover, the present invention can be used in one or more wherein include computer usable program code computer
The computer program production implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.)
The form of product.
The present invention be with reference to according to the method for the embodiment of the present invention, the flow of device (system) and computer program product
Figure and/or block diagram describe.It should be understood that can be realized by computer program instructions every first-class in flowchart and/or the block diagram
The combination of flow and/or box in journey and/or box and flowchart and/or the block diagram.These computer programs can be provided
Instruct the processor of all-purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine so that the instruction executed by computer or the processor of other programmable data processing devices is generated for real
The device for the function of being specified in present one flow of flow chart or one box of multiple flows and/or block diagram or multiple boxes.
These computer program instructions, which may also be stored in, can guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works so that instruction generation stored in the computer readable memory includes referring to
Enable the manufacture of device, the command device realize in one flow of flow chart or multiple flows and/or one box of block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device so that count
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, in computer or
The instruction executed on other programmable devices is provided for realizing in one flow of flow chart or multiple flows and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art
God and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.