CN108073581B - Map area name display method and device - Google Patents
Map area name display method and device Download PDFInfo
- Publication number
- CN108073581B CN108073581B CN201610981294.XA CN201610981294A CN108073581B CN 108073581 B CN108073581 B CN 108073581B CN 201610981294 A CN201610981294 A CN 201610981294A CN 108073581 B CN108073581 B CN 108073581B
- Authority
- CN
- China
- Prior art keywords
- map area
- area
- central point
- name
- coordinate
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Remote Sensing (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Processing Or Creating Images (AREA)
- Navigation (AREA)
Abstract
The invention discloses a method and a device for displaying a map area name, relates to the technical field of electronic maps, and solves the problem of low accuracy rate of displaying the existing map area name. The main technical scheme of the invention is as follows: acquiring a central point of a map area in a minimum rectangular range; judging whether the position of the central point exceeds the boundary range of the map area; if the position of the central point exceeds the boundary range of the map area, adjusting the position of the name of the map area displayed at the central point to be within the boundary range of the map area; displaying the map area name at the adjusted position. The method and the device are mainly used for displaying the name of the map area in the map area.
Description
Technical Field
The invention relates to the technical field of electronic maps, in particular to a method and a device for displaying a map area name.
Background
With the rapid development of information technology and the popularization of electronic equipment, more and more users browse map information through the electronic equipment, so that the electronic map replaces the original paper map. Among them, an Electronic map (Electronic map), i.e., a digital map, is a map that is digitally stored and referred to using computer technology. Electronic maps generally use vector image storage, map scales can be enlarged, reduced or rotated without affecting display effects, and map scales cannot be enlarged or reduced by using bitmap storage in the early stage.
Currently, when displaying the names of the respective areas in the map, the center point of the smallest rectangle in which the area is located is used as the standard. However, the names of the irregular areas in the map are calculated according to the center point of the minimum rectangle in which the area is located, and the obtained positions are not within the area range, such as the names of the copper mountain areas in fig. 5, which are not displayed within the copper mountain areas, so that the display accuracy of the names of the areas in the conventional map is low.
Disclosure of Invention
The present invention has been made in view of the above problems, and it is an object of the present invention to provide a method and apparatus for displaying a map area name that overcomes or at least partially solves the above problems.
In order to achieve the purpose, the invention mainly provides the following technical scheme:
in one aspect, an embodiment of the present invention provides a method for displaying a map area name, where the method includes:
acquiring a central point of a map area in a minimum rectangular range;
judging whether the central point exceeds the boundary range of the map area;
if the position of the map area name displayed at the central point exceeds the preset position, adjusting the position of the map area name displayed at the central point to be within the boundary range of the map area;
displaying the map area name at the adjusted position.
On the other hand, an embodiment of the present invention further provides a display device for a map area name, where the device includes:
the acquisition unit is used for acquiring a central point of a map area in a minimum rectangular range;
the judging unit is used for judging whether the central point exceeds the boundary range of the map area;
the adjusting unit is used for adjusting the position of the name of the map area displayed at the central point to be within the boundary range of the map area if the central point exceeds the boundary range of the map area;
a display unit for displaying the map area name at the adjusted position.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
the method and the device for displaying the name of the map area provided by the embodiment of the invention firstly obtain the central point of the map area in the minimum rectangular range, then judge whether the position of the central point exceeds the boundary range of the map area, if the position of the central point exceeds the boundary range of the map area, adjust the position of the name of the map area displayed at the central point to the boundary range of the map area, and finally display the name of the map area at the adjusted position. Compared with the current method for positioning the name of the map area according to the central point of the smallest rectangle in which the area is located, the embodiment of the invention firstly judges whether the central point exceeds the boundary range of the map area, and if the position of the central point exceeds the boundary range of the map area, the position of the name of the map area displayed at the central point is adjusted to be within the boundary range of the map area so as to ensure that the names of all the map areas are displayed in the corresponding areas, thereby improving the accuracy of displaying the name of the map area through the embodiment of the invention.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart of a method for displaying a map area name according to an embodiment of the present invention;
fig. 2 is a flowchart of another map area name display method according to an embodiment of the present invention;
fig. 3 is a block diagram of a map area name display device according to an embodiment of the present invention;
FIG. 4 is a block diagram of another map area name display device according to an embodiment of the present invention;
FIG. 5 is a diagram illustrating a map area name display according to the prior art;
FIG. 6 is a map region point distribution diagram according to an embodiment of the present invention;
fig. 7 is a schematic diagram illustrating a display of a map area name according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
In order to make the advantages of the technical solutions of the present invention clearer, the present invention is described in detail below with reference to the accompanying drawings and examples.
The embodiment of the invention provides a method for displaying a map area name, which comprises the following steps of:
101. and acquiring the central point of the map area in the minimum rectangular range.
In the embodiment of the present invention, as shown in fig. 6, the minimum rectangle of the map area is obtained according to the boundary point of the copper mountainous area, and then the center point of the minimum rectangle is obtained.
102. And judging whether the position of the central point exceeds the boundary range of the map area.
And if the position of the central point is not within the boundary range of the map area, the display position of the name of the map area is deviated from the corresponding map area. It should be noted that, in the embodiment of the present invention, whether the central point exceeds the boundary range of the map area may be determined by the coordinates of the boundary point of the map area.
103. And if the position of the map area name displayed in the center point exceeds the preset position, adjusting the position of the map area name displayed in the center point to be within the boundary range of the map area.
In the embodiment of the present invention, if the position of the center point exceeds the boundary range of the map area, it indicates that if the name of the map area is displayed at the position of the center point, the name of the displayed area will not be in the corresponding map area, and as shown in fig. 6, the center point of the minimum rectangle in which the cuprum area is located exceeds the boundary range of the cuprum area, it indicates that the name of the map area displayed according to the center point of the minimum rectangle is wrong. Therefore, when the position of the center point exceeds the boundary range of the map area, the position of the map area name displayed at the center point needs to be adjusted to be within the boundary range of the map area, so as to ensure that the displayed map area name is within the correct area range.
104. Displaying the map area name at the adjusted position.
The map area name display method provided by the embodiment of the invention comprises the steps of firstly obtaining a central point in a minimum rectangular range of a map area, then judging whether the central point exceeds the boundary range of the map area, and if the position of the central point exceeds the boundary range of the map area, adjusting the position of the map area name displayed at the central point to be in the boundary range of the map area so as to ensure that the names of all the map areas are displayed in the corresponding areas, thereby improving the accuracy of map area name display through the embodiment of the invention.
An embodiment of the present invention provides another method for displaying a map area name, as shown in fig. 2, the method includes:
201. and acquiring the central point of the map area in the minimum rectangular range.
For example, in fig. 6, a horizontal middle line is a north latitude middle line of the copper mountain area, a vertical middle line is a east longitude middle line of the copper mountain area, and an intersection point of the horizontal middle line and the vertical middle line is determined as a middle point within a minimum rectangular range of the copper mountain area, that is, a central point of the copper mountain area is represented by longitude and latitude coordinates (X, Y), wherein X is the east longitude and Y is the north latitude.
202. And judging whether the position of the central point exceeds the boundary range of the map area.
For the embodiment of the present invention, step 202 includes: establishing a coordinate system in the minimum rectangular range by taking the central point as a coordinate origin, and respectively acquiring coordinate points of an upper region, a lower region, a left region and a right region which are positioned in a coordinate axis preset range and relative to the central point, wherein the coordinate points are boundary points of the map region; detecting whether an area in which a coordinate point is not acquired exists; if the area in which the coordinate point is not acquired exists, determining that the position of the central point exceeds the boundary range of the map area; and if the area which does not acquire the coordinate point does not exist, determining that the position of the central point does not exceed the boundary range of the map area. For example, the coordinate points in the cross frame in fig. 6 are coordinate systems established in a minimum rectangular range with the central point as the origin of coordinates, and coordinate points in four areas, i.e., an upper area in the rectangle above the central point, a lower area in the rectangle below the central point, a left area in the rectangle at the central point, and a right area in the rectangle at the central point, are respectively obtained in the coordinate axis preset range.
The preset range can be set according to the distribution state of the boundary points of the map area, namely the preset range is set according to the density degree of the boundary points, and the denser the distribution of the boundary points is, the smaller the preset range can be set; the sparser the boundary point distribution is, the larger the preset range is set, and the preset range may be specifically 0.1, 0.2, 0.3, and the like, which is not specifically limited in the embodiment of the present invention. For example, in fig. 6, the center point (X, Y) is used as the origin of coordinates, the coordinate points of the left and right regions with respect to the origin of coordinates within ± 0.1 from the X axis are calculated, and the coordinate points of the upper and lower regions with respect to the origin of coordinates within ± 0.1 from the Y axis are calculated.
It should be noted that, in order to detect whether there is an area in which a coordinate point is not acquired, after coordinate points of four areas, namely, an upper area, a lower area, a left area, and a right area, which are located in a preset range of a coordinate axis and are corresponding to the central point are respectively acquired, the coordinate points in each area may be respectively stored in an array of the corresponding area, and whether there is an area in which a coordinate point is not acquired is determined by detecting whether there is a space in the array corresponding to each area. Such as storing the acquired coordinate points in the right area into the array _ right; and storing the acquired coordinate points in the left area into an array _ left.
And 203a, if the coordinate point area name exceeds the preset coordinate point area name, adjusting the position of the map area name displayed at the central point to be in an area range opposite to the direction of the coordinate point area not acquired.
It should be noted that if there is an empty array in the arrays of the four areas, it is indicated that the name of the map area is always outside the map area range, and if the array of the upper area is empty, it is indicated that the name of the map area displayed at the center point is above the map area, and at this time, the position of the name of the map area displayed at the center point needs to be adjusted downward to be within the lower area range.
In the embodiment of the present invention, step 203a includes: acquiring a region with the direction opposite to that of the region in which the coordinate point is not acquired; calculating the maximum span value of the coordinate points in the opposite region; acquiring intermediate points between boundary points with the maximum span values in the coordinate system; and adjusting the position of the map area name displayed at the central point to the middle point. For example, if the array _ right storing the right area coordinate point is empty, it indicates that the map area name is always outside the map area range, and the map area name is displayed on the right side of the map area, it indicates that at least two points exist in the array _ left storing the left area coordinate point, a section on the horizontal axis can be formed, the vertical middle value of the section is calculated, the position of the area name is horizontally translated to the middle position of the section, the maximum span value of the coordinate point in the array _ left is preferably selected, the maximum span value is the distance between the minimum coordinate point and the maximum coordinate point in the area, and the position of the map area name displayed at the central point is adjusted to the middle point of the maximum span value.
It should be noted that, due to the irregularity of the map area, there may be a case where the two arrays are empty, and therefore, when it is detected that the two arrays are empty, the position of the central point needs to be adjusted to a middle point that is not the middle point with a larger maximum span value in the empty arrays, so as to ensure the accuracy of the name of the map area displayed in the map area. Therefore, if two areas which do not acquire coordinate points are detected, the maximum span values of the coordinate points in the two areas which are not empty are respectively calculated; extracting a span value with the largest value from the maximum span values; and adjusting the position of the central point to the middle point of the span value with the maximum value.
203b, if not, judging whether the span values of the four areas are all smaller than a preset threshold value.
It should be noted that, due to the complexity of the map area, there will be some situations where another map area is included in some map areas, that is, the dragon mountain area and the drum building area are included in the bronze mountain area in fig. 5, and therefore, when the position of the center point does not exceed the boundary range of the map area, it is further necessary to further determine whether all the span values of the four areas are smaller than the preset threshold value, so as to determine whether the map area includes another map area. If there is an area with a span value greater than or equal to the preset threshold, it is indicated that the map area includes another map area, so step 204b needs to be executed to adjust the position of the map area name displayed by the central point within the boundary range of the map area; if the span value does not have the area which is larger than or equal to the preset threshold value, the obtained coordinate points in each area are nearly a line, and the central point is in the range of the map area, so that the position of the map area name displayed at the central point does not need to be adjusted.
The preset threshold may be set according to an actual requirement, and may specifically be 0.01, 0.02, 0.03, and the like, which is not specifically limited in the embodiment of the present invention. For example, if the array _ right storing the right region coordinate points is not empty, the maximum span value of all points in the array on the horizontal axis is calculated and saved as diff _ right. If diff _ right is smaller than 0.01, it means that the coordinate points in the array _ right are nearly a line in the vertical direction, and the right side is a region boundary. If the maximum span values of all the areas are smaller than the preset threshold value, the name of the map area is within the range of the map area, so that the name of the map area displayed at the central point can be kept still, and the position of the name of the map area displayed at the central point does not need to be adjusted.
In this embodiment of the present invention, before determining whether the span values of the four regions are all smaller than the preset threshold, the method further includes: maximum span values based on ordinate coordinate points in the upper region and the lower region of the coordinate system respectively; and respectively calculating the maximum span values based on the abscissa coordinate points in the left area and the right area in the coordinate system. For example, the maximum span value of coordinate points in the left area coordinate point array _ left is calculated and stored: then, the coordinate point with the minimum abscissa and the coordinate point with the maximum abscissa in the array _ left are selected first, and then the distance between the coordinate point with the minimum abscissa and the coordinate point with the maximum abscissa is used as the maximum span value of the array _ left.
204b, if not, adjusting the position of the map area name displayed by the central point within the boundary range of the map area.
In the embodiment of the present invention, step 204b includes: and adjusting the position of the map area name displayed at the central point to the area with the largest value among the maximum span values in the four areas.
Specifically, the adjusting the position of the name of the map area displayed at the central point to the area with the largest maximum span value among the four areas includes: extracting a span value with the largest numerical value from the maximum span values respectively corresponding to the regions; acquiring intermediate points among boundary points with the maximum span values of the numerical values in the coordinate system; and adjusting the position of the map area name displayed at the central point to the middle point.
204. Displaying the map area name at the adjusted position.
In the embodiment of the invention, firstly, a central point (shown in fig. 6) in a minimum rectangular range of a map area is obtained, then a coordinate system is established in the minimum rectangular range by taking the central point as a coordinate origin, coordinate points of an upper area, a lower area, a left area and a right area relative to the central point in a preset range from a coordinate axis are obtained, the coordinate points of the upper area, the lower area, the left area and the right area are stored in arrays of corresponding areas, then whether empty arrays exist in the arrays respectively corresponding to the four areas is detected, and if the empty arrays exist, the position of the name of the map area displayed at the central point is adjusted to be in an area range opposite to the direction of the area where the coordinate points are not obtained; if no empty array exists, respectively calculating the maximum span values of the coordinate points in each array, judging whether the maximum span values of each array are smaller than a preset threshold value, if not, extracting the span value with the maximum value from the maximum span values corresponding to each area, acquiring the middle point of the span value with the maximum value, adjusting the position of the map area name displayed at the central point to the middle point, and finally displaying the name of the map area (as shown in the copper mountain area in fig. 7) at the adjusted position.
It should be noted that, due to the complexity of the map area, before displaying the name of the map area at the adjusted position, it is necessary to determine again whether the adjusted position is within the range of the map area, and if the adjusted position is within the map area, the name of the map area is displayed at the adjusted position; if the adjusted position is not in the map area, the calculation is performed again on the basis of the adjusted position, that is, the step 201 and the step 204b are repeated, and the display position of the name of the map area is adjusted again to display the name of the map area in the corresponding area, for example, after the center point position is adjusted in fig. 7, the name of the copper mountain area is displayed in the map area of the copper mountain area.
The other method for displaying the name of the map area, provided by the embodiment of the invention, includes the steps of firstly obtaining a central point in a minimum rectangular range of the map area, then judging whether the position of the central point exceeds the boundary range of the map area, if the position of the central point exceeds the boundary range of the map area, adjusting the position of the name of the map area displayed at the central point to be within the boundary range of the map area, and finally displaying the name of the map area at the adjusted position. Compared with the current method for positioning the name of the map area according to the central point of the smallest rectangle in which the area is located, the embodiment of the invention firstly judges whether the central point exceeds the boundary range of the map area, and if the position of the central point exceeds the boundary range of the map area, the position of the name of the map area displayed at the central point is adjusted to be within the boundary range of the map area so as to ensure that the names of all the map areas are displayed in the corresponding areas, thereby improving the accuracy of displaying the name of the map area through the embodiment of the invention.
Further, an embodiment of the present invention provides a display apparatus for map area names, as shown in fig. 3, the apparatus includes: an acquisition unit 31, a judgment unit 32, an adjustment unit 33, and a display unit 34.
An obtaining unit 31, configured to obtain a central point of a map area within a minimum rectangular range;
a determination unit 32 configured to determine whether the position of the central point exceeds a boundary range of the map area;
an adjusting unit 33, configured to adjust a position of the name of the map area displayed at the central point to be within a boundary range of the map area if the central point exceeds the boundary range of the map area;
a display unit 34 for displaying the map area name at the adjusted position.
It should be noted that, for other corresponding descriptions of the functional units related to the display device of the map area name provided in the embodiment of the present invention, reference may be made to corresponding descriptions of the method shown in fig. 1, which are not described herein again, but it should be clear that the device in the embodiment can correspondingly implement all the contents in the foregoing method embodiments.
The map area name display device provided by the embodiment of the invention firstly obtains a central point in a minimum rectangular range of a map area, then judges whether the position of the central point exceeds the boundary range of the map area, adjusts the position of the map area name displayed at the central point to be in the boundary range of the map area if the position of the central point exceeds the boundary range of the map area, and finally displays the map area name at the adjusted position. Compared with the current method for positioning the name of the map area according to the central point of the smallest rectangle in which the area is located, the embodiment of the invention firstly judges whether the central point exceeds the boundary range of the map area, and if the position of the central point exceeds the boundary range of the map area, the position of the name of the map area displayed at the central point is adjusted to be within the boundary range of the map area so as to ensure that the names of all the map areas are displayed in the corresponding areas, thereby improving the accuracy of displaying the name of the map area through the embodiment of the invention.
Further, another display device for map area names is provided in an embodiment of the present invention, as shown in fig. 4, the device includes: acquisition unit 41, determination unit 42, adjustment unit 43, and display unit 44.
An obtaining unit 41, configured to obtain a central point of a map area within a minimum rectangular range;
a judging unit 42, configured to judge whether the position of the central point exceeds a boundary range of the map area;
an adjusting unit 43, configured to adjust a position of the name of the map area displayed at the center point to be within a boundary range of the map area if the center point exceeds the boundary range of the map area;
a display unit 44 for displaying the map area name at the adjusted position.
For the embodiment of the present invention, the determining unit 42 includes:
the obtaining module 421 is configured to establish a coordinate system in the minimum rectangular range by using the central point as a coordinate origin, and obtain coordinate points of four areas, namely, an upper area, a lower area, a left area, and a right area, which are located in a preset range from a coordinate axis, with respect to the central point, where the coordinate points are boundary points of the map area;
a detection module 422, configured to detect that an area where a coordinate point is not obtained exists;
a determining module 423, configured to determine that the position of the central point exceeds a boundary range of the map area if an area where the coordinate point is not obtained exists; and if the area which does not acquire the coordinate point does not exist, determining that the position of the central point does not exceed the boundary range of the map area.
The adjusting unit 43 is specifically configured to adjust the position of the map area name displayed in the central point to an area range opposite to the direction of the area where the coordinate point is not acquired, if the position of the central point exceeds the boundary range of the map area.
Specifically, the adjusting unit 43 includes:
an obtaining module 431, configured to obtain a region in a direction opposite to that of the region where the coordinate point is not obtained;
a calculating module 432, configured to calculate a maximum span value of the coordinate points in the opposite region;
the obtaining module 431 is further configured to obtain an intermediate point between boundary points of the specific maximum span value in the coordinate system;
an adjusting module 433, configured to adjust a position of the map area name displayed at the center point to the middle point.
Further, the apparatus further comprises:
a determining unit 45, configured to determine whether the maximum span values of the four regions are all smaller than a preset threshold value if the position of the central point does not exceed the boundary range of the map region;
the adjusting unit 43 is further configured to adjust the position of the map area name displayed by the central point within the boundary range of the map area if there is an area with a maximum span value greater than or equal to a preset threshold.
Further, the apparatus further comprises:
a calculation unit 46 for calculating maximum span values based on ordinate coordinate points in upper and lower regions, respectively, in the coordinate system; respectively calculating the maximum span values of the left area and the right area based on the abscissa coordinate point in the coordinate system;
the adjusting unit 43 is configured to adjust the position of the name of the map area displayed at the central point to be within an area range with a largest value among maximum span values in the four areas.
The adjusting unit 43 further includes:
an extracting module 434, configured to extract a span value with a largest numerical value from the maximum span values respectively corresponding to the regions;
the obtaining module 431 is configured to obtain an intermediate point of a span value between boundary points with the largest numerical value in the coordinate system;
the adjusting module 433 is configured to adjust the position of the map area name displayed at the center point to the middle point.
It should be noted that, for other corresponding descriptions of the functional units related to the display device of the map area name provided in the embodiment of the present invention, reference may be made to corresponding descriptions of the method shown in fig. 2, which are not described herein again, but it should be clear that the device in the embodiment can correspondingly implement all the contents in the foregoing method embodiments.
Another display device for a name of a map area, provided in an embodiment of the present invention, first obtains a center point of the map area within a minimum rectangular range, then determines whether a position of the center point exceeds a boundary range of the map area, adjusts a position of the name of the map area displayed at the center point to be within the boundary range of the map area if the position of the center point exceeds the boundary range of the map area, and finally displays the name of the map area at the adjusted position. Compared with the current method for positioning the name of the map area according to the central point of the smallest rectangle in which the area is located, the embodiment of the invention firstly judges whether the central point exceeds the boundary range of the map area, and if the position of the central point exceeds the boundary range of the map area, the position of the name of the map area displayed at the central point is adjusted to be within the boundary range of the map area so as to ensure that the names of all the map areas are displayed in the corresponding areas, thereby improving the accuracy of displaying the name of the map area through the embodiment of the invention.
The display device of the map area name comprises a processor and a memory, wherein the acquisition unit, the judgment unit, the adjustment unit, the display unit, the calculation unit, the judgment unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the display accuracy of the map area name is improved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The present application further provides a computer program product adapted to perform program code for initializing the following method steps when executed on a data processing device: acquiring a central point of a map area in a minimum rectangular range; judging whether the position of the central point exceeds the boundary range of the map area; if the position of the central point exceeds the boundary range of the map area, adjusting the position of the name of the map area displayed at the central point to be within the boundary range of the map area; displaying the map area name at the adjusted position.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims (10)
1. A method for displaying a map area name, comprising:
acquiring a central point of a map area in a minimum rectangular range;
judging whether the position of the central point exceeds the boundary range of the map area;
if the position of the central point exceeds the boundary range of the map area, adjusting the position of the name of the map area displayed at the central point to be within the boundary range of the map area;
displaying the map area name at the adjusted position;
the judging whether the position of the central point exceeds the boundary range of the map area comprises:
establishing a coordinate system in the minimum rectangular range by taking the central point as a coordinate origin, and respectively acquiring coordinate points of an upper region, a lower region, a left region and a right region which are positioned in a coordinate axis preset range and relative to the central point, wherein the coordinate points are boundary points of the map region;
detecting whether an area in which a coordinate point is not acquired exists;
if the area in which the coordinate point is not acquired exists, determining that the position of the central point exceeds the boundary range of the map area;
and if the area which does not acquire the coordinate point does not exist, determining that the position of the central point does not exceed the boundary range of the map area.
2. The method of claim 1, wherein if the position of the center point is beyond the boundary range of the map area, the adjusting the position of the name of the map area displayed at the center point to be within the boundary range of the map area comprises:
and if the position of the central point exceeds the boundary range of the map area, adjusting the position of the name of the map area displayed at the central point to be in an area range opposite to the direction of the area of the coordinate point which is not acquired.
3. The method according to claim 2, wherein the adjusting the position of the map area name displayed at the center point to be within an area range opposite to the direction of the unacquired coordinate point area comprises:
acquiring a region with the direction opposite to that of the region in which the coordinate point is not acquired;
calculating the maximum span value of the coordinate points in the opposite region;
acquiring intermediate points between boundary points with the maximum span values in the coordinate system;
and adjusting the position of the map area name displayed at the central point to the middle point.
4. The method of claim 1, further comprising:
if the position of the central point does not exceed the boundary range of the map area, judging whether span values of the four areas are all smaller than a preset threshold value;
if not, adjusting the position of the map area name displayed by the central point within the boundary range of the map area.
5. The method of claim 4, wherein before determining whether the span values of the four regions are all less than the preset threshold, the method further comprises:
maximum span values based on ordinate coordinate points in the upper region and the lower region of the coordinate system respectively;
respectively calculating the maximum span values of the left area and the right area based on the abscissa coordinate point in the coordinate system;
the adjusting the position of the map area name displayed by the central point within the boundary range of the map area comprises;
and adjusting the position of the map area name displayed at the central point to be in the area range with the largest value among the maximum span values in the four areas.
6. The method according to claim 5, wherein the adjusting the position of the name of the map area displayed at the central point to be within the area with the largest value among the maximum span values of four areas comprises:
extracting the maximum span value with the largest numerical value from the maximum span values respectively corresponding to the regions;
acquiring a middle point between boundary points with the maximum span value with the maximum numerical value in the coordinate system;
and adjusting the position of the map area name displayed at the central point to the middle point.
7. A display device for map area names, comprising:
the acquisition unit is used for acquiring a central point of a map area in a minimum rectangular range;
the judging unit is used for judging whether the position of the central point exceeds the boundary range of the map area;
the adjusting unit is used for adjusting the position of the name of the map area displayed at the central point to be within the boundary range of the map area if the central point exceeds the boundary range of the map area;
a display unit for displaying the map area name at the adjusted position;
the judging unit includes:
the acquisition module is used for establishing a coordinate system in the minimum rectangular range by taking the central point as a coordinate origin, and respectively acquiring coordinate points of an upper area, a lower area, a left area and a right area which are positioned in a coordinate axis preset range and relative to the central point, wherein the coordinate points are boundary points of the map area;
the detection module is used for detecting whether an area which does not acquire the coordinate point exists;
the determining module is used for determining that the position of the central point exceeds the boundary range of the map area if the area which does not acquire the coordinate point exists; and if the area which does not acquire the coordinate point does not exist, determining that the position of the central point does not exceed the boundary range of the map area.
8. The apparatus of claim 7,
the adjusting unit is specifically configured to adjust the position of the map area name displayed at the central point to an area range opposite to the direction of the area where the coordinate point is not acquired, if the position of the central point exceeds the boundary range of the map area.
9. A storage medium characterized by comprising a stored program, wherein 15, when the program is executed, controls an apparatus in which the storage medium is located to execute the map area name display method according to any one of claims 1 to 6.
10. A processor for executing a program, wherein the program executes the method for displaying the name of the map area according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610981294.XA CN108073581B (en) | 2016-11-08 | 2016-11-08 | Map area name display method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610981294.XA CN108073581B (en) | 2016-11-08 | 2016-11-08 | Map area name display method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108073581A CN108073581A (en) | 2018-05-25 |
CN108073581B true CN108073581B (en) | 2021-12-07 |
Family
ID=62154132
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610981294.XA Active CN108073581B (en) | 2016-11-08 | 2016-11-08 | Map area name display method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108073581B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110674209A (en) * | 2019-09-22 | 2020-01-10 | 武汉光庭信息技术股份有限公司 | Data display method, equipment and storage medium |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1346059A (en) * | 2000-09-25 | 2002-04-24 | 中国科学院空间科学与应用研究中心 | Real-time ground processing system for synthetic aperture imaging radar |
CN101009058A (en) * | 2006-01-26 | 2007-08-01 | 崔宏 | Digit identification for the geographic location |
CN103164498A (en) * | 2011-12-15 | 2013-06-19 | 财团法人工业技术研究院 | Geographical position presenting system, method, recording medium, and computer program product |
CN103617296A (en) * | 2013-12-18 | 2014-03-05 | 中国电子科技集团公司第五十四研究所 | Optimized display method of place name annotation image layer |
CN104573014A (en) * | 2015-01-09 | 2015-04-29 | 广东建邦计算机软件有限公司 | Community grid information processing method and system |
US20160071298A1 (en) * | 2014-09-04 | 2016-03-10 | Baidu Online Network Technology (Beijing) Co., Ltd | Loading method and apparatus for map label |
-
2016
- 2016-11-08 CN CN201610981294.XA patent/CN108073581B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1346059A (en) * | 2000-09-25 | 2002-04-24 | 中国科学院空间科学与应用研究中心 | Real-time ground processing system for synthetic aperture imaging radar |
CN101009058A (en) * | 2006-01-26 | 2007-08-01 | 崔宏 | Digit identification for the geographic location |
CN103164498A (en) * | 2011-12-15 | 2013-06-19 | 财团法人工业技术研究院 | Geographical position presenting system, method, recording medium, and computer program product |
CN103617296A (en) * | 2013-12-18 | 2014-03-05 | 中国电子科技集团公司第五十四研究所 | Optimized display method of place name annotation image layer |
US20160071298A1 (en) * | 2014-09-04 | 2016-03-10 | Baidu Online Network Technology (Beijing) Co., Ltd | Loading method and apparatus for map label |
CN104573014A (en) * | 2015-01-09 | 2015-04-29 | 广东建邦计算机软件有限公司 | Community grid information processing method and system |
Non-Patent Citations (1)
Title |
---|
面状地物自动注记方法探讨;杜世宏 等;《测绘信息与工程》;20000430(第4期);6-8 * |
Also Published As
Publication number | Publication date |
---|---|
CN108073581A (en) | 2018-05-25 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111292302B (en) | Screen detection method and device | |
CN113160161B (en) | Method and device for detecting defects at edge of target | |
CN112634201B (en) | Target detection method and device and electronic equipment | |
CN106446223B (en) | Map data processing method and device | |
CN114494121B (en) | Correction method and correction device for image offset, storage medium and electronic equipment | |
CN110827246A (en) | Electronic equipment frame appearance flaw detection method and equipment | |
WO2024001360A1 (en) | Green screen matting method and apparatus, and electronic device | |
CN109163888A (en) | Optical centre test method, device and equipment | |
CN109118533B (en) | Depth information processing method, device and equipment | |
CN112948937A (en) | Intelligent pre-judging method and device for concrete strength | |
CN110458954B (en) | Contour line generation method, device and equipment | |
CN108073581B (en) | Map area name display method and device | |
US11100361B1 (en) | Method and apparatus for processing feature point matching result | |
CN103870091B (en) | Multi-window display method and its system | |
CN114638996B (en) | Model training method, device, equipment and storage medium based on countermeasure learning | |
CN114612427A (en) | Nameplate defect detection method and device, electronic equipment and storage medium | |
CN115797182B (en) | Feature map interpolation method, device, equipment and storage medium | |
CN116311135A (en) | Data dimension reduction method, data dimension reduction system and controller for semantic information | |
WO2022222788A1 (en) | Image processing method and apparatus | |
CN114494398B (en) | Processing method and device of inclined target, storage medium and processor | |
CN114494119A (en) | Device direction detection method and device, storage medium and electronic equipment | |
CN113269183A (en) | Method and equipment for determining character and picture | |
CN109582191B (en) | Menu content display method and device | |
CN114062656A (en) | Geological disaster prediction method and system | |
CN115439550A (en) | Camera calibration method, distance measurement method, equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 100083 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing Applicant after: Beijing Guoshuang Technology Co.,Ltd. Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A Applicant before: Beijing Guoshuang Technology Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |