CN114140548A - Map-based drawing method and device - Google Patents

Map-based drawing method and device Download PDF

Info

Publication number
CN114140548A
CN114140548A CN202111308468.3A CN202111308468A CN114140548A CN 114140548 A CN114140548 A CN 114140548A CN 202111308468 A CN202111308468 A CN 202111308468A CN 114140548 A CN114140548 A CN 114140548A
Authority
CN
China
Prior art keywords
target
boundary
map
plate
points
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.)
Pending
Application number
CN202111308468.3A
Other languages
Chinese (zh)
Inventor
李冬杰
杨海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Xumi Yuntu Space Technology Co Ltd
Original Assignee
Shenzhen Jizhi Digital Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Jizhi Digital Technology Co Ltd filed Critical Shenzhen Jizhi Digital Technology Co Ltd
Priority to CN202111308468.3A priority Critical patent/CN114140548A/en
Publication of CN114140548A publication Critical patent/CN114140548A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The disclosure relates to the technical field of computers, and provides a map-based drawing method and device. Determining a plurality of target marking points according to a plurality of target positions of a cursor in a target map; and generating target plates corresponding to the target marking points in the target map according to the boundary line segments corresponding to the target marking points. The method can determine the target marking point corresponding to the target position according to the point-line information of the target position and the drawn plate block in the target map aiming at each target position, so that if the target plate block is adjacent to the drawn plate block in the map, the common vertex and boundary between the target plate block and the drawn plate block can be ensured to be the same vertex and boundary in the map, thereby ensuring that the common boundary between the target plate block and the drawn plate block adjacent to the target plate block does not generate gaps and overlaps in the drawing process in the map, and further improving the efficiency of drawing the plate block in the map.

Description

Map-based drawing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a map making method and apparatus based on a map.
Background
In the prior art, the map webpage version has the characteristics of simple and convenient operation and light weight, so that the map webpage version only provides a simple drawing function compared with a map client version.
In the manual drawing process based on the map webpage version, when surface editing (such as drawing or editing a block) is performed in a map, each block is separately separated during editing, that is, each block has no relevance, if two adjacent blocks are to be drawn, the problem that gaps between the two adjacent blocks are too large or overlap due to manual operation errors is easily caused, so that the map data quality is influenced, and the common boundary of the two adjacent blocks cannot be guaranteed not to generate gaps or overlap. Therefore, a new mapping scheme based on a map page version is needed.
Disclosure of Invention
In view of the above, embodiments of the present disclosure provide a map-based drawing method, apparatus, computer device, and computer-readable storage medium, so as to solve the problem in the prior art that when two adjacent blocks are drawn, a gap between two adjacent edited blocks is too large or an overlap occurs due to a manual operation error.
In a first aspect of the disclosed embodiments, a map-based mapping method is provided, the method including:
determining a plurality of target marking points according to a plurality of target positions of the cursor in the target map; for each target position, determining a target marking point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map;
determining boundary line segments corresponding to two adjacent target marking points aiming at each two adjacent target marking points in the plurality of target marking points;
and generating target plates corresponding to the target marking points in the target map according to the boundary line segments corresponding to the target marking points.
In a second aspect of the disclosed embodiments, there is provided a map-based mapping apparatus, the apparatus comprising:
the marking point determining module is used for determining a plurality of target marking points according to a plurality of target positions of the cursor in the target map; for each target position, determining a target marking point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map;
the line segment determining module is used for determining a boundary line segment corresponding to each two adjacent target marking points in the plurality of target marking points;
and the plate generating module is used for generating the target plates corresponding to the target marking points in the target map according to the plurality of boundary line segments corresponding to the target marking points.
In a third aspect of the embodiments of the present disclosure, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the above method when executing the computer program.
In a fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, which stores a computer program, which when executed by a processor, implements the steps of the above-mentioned method.
Compared with the prior art, the embodiment of the disclosure has the following beneficial effects: the embodiment of the disclosure may determine a plurality of target marking points according to a plurality of target positions of the cursor in the target map. Then, for each two adjacent target annotation points in the plurality of target annotation points, determining a boundary line segment corresponding to the two adjacent target annotation points; then, according to a plurality of boundary line segments corresponding to the plurality of target annotation points, target plates corresponding to the plurality of target annotation points can be generated in the target map. In this embodiment, for each target position, a target annotation point corresponding to the target position may be determined according to the target position and the point-line information of the drawn plate in the target map, and it can be understood that the target annotation point corresponding to the target position is obtained by adjusting the target position based on the point-line information of the drawn plate in the target map, so that the target annotation point corresponding to the target position is determined by using the point-line information of the boundary of the drawn plate in the target map as a reference object; therefore, if the target plate is adjacent to a drawn plate in the map, the common vertex and boundary between the target plate and the drawn plate can be ensured to be the same vertex and boundary in the map, so that the common boundary between the target plate and the drawn plate adjacent to the target plate can be ensured not to generate gaps and overlap in the process of drawing in the map, and the efficiency of drawing the plate in the map is improved.
Drawings
To more clearly illustrate the technical solutions in the embodiments of the present disclosure, the drawings needed for the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without inventive efforts.
FIG. 1 is a scenario diagram of an application scenario of an embodiment of the present disclosure;
FIG. 2 is a flow chart of a map-based mapping method provided by an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an interface for determining a target annotation point according to an embodiment of the disclosure;
FIG. 4 is a schematic diagram of an interface for determining a target annotation point according to an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an interface for determining a boundary line segment according to an embodiment of the disclosure;
FIG. 6 is a schematic diagram of an interface for determining a boundary line segment according to an embodiment of the present disclosure;
FIG. 7 is a block diagram of a map-based mapping apparatus provided by an embodiment of the present disclosure;
fig. 8 is a schematic diagram of a computer device provided by an embodiment of the present disclosure.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the disclosed embodiments. However, it will be apparent to one skilled in the art that the present disclosure may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present disclosure with unnecessary detail.
A map-based mapping method and apparatus according to an embodiment of the present disclosure will be described in detail below with reference to the accompanying drawings.
In the prior art, in the process of manual drawing based on a map webpage version, when surface editing (for example, drawing or editing one plate) is performed in a map, each plate is separately separated during editing, that is, each plate has no relevance, if two adjacent plates are to be drawn, the problem that a gap between two adjacent plates to be edited is too large or overlapping occurs due to manual operation errors is easily caused, so that the map data quality is affected, and it is not guaranteed that the gap and overlapping are not generated on the common boundary of the two adjacent plates. In addition, the gaps and the overlapping areas generated by the boundaries of two adjacent plates are too fine, so that the manual work is difficult to find out errors, and even if the gaps or the overlapping parts between the two adjacent plates are manually adjusted, the problems of inconvenient modification and adjustment and excessive manual time consumption still exist, and the common boundaries of the two adjacent plates cannot be guaranteed to be completely free from gaps and overlapping.
To solve the above problems. In the method, for each target position of a cursor in a target map, a target marking point corresponding to the target position can be determined according to the target position and point line information of a drawn plate in the target map, and it can be understood that the target marking point corresponding to the target position is obtained by adjusting the target position based on the point line information of the drawn plate in the target map, so that the target marking point corresponding to the target position is determined by taking the point line information of the boundary of the drawn plate in the target map as a reference object. Therefore, after the target blocks corresponding to the target marking points are generated in the target map according to the boundary line segments corresponding to the target marking points of the target block, if the target block drawn in the map is adjacent to a drawn block, the common vertex and boundary between the target block and the drawn block can be ensured to be the same vertex and boundary in the map, so that the common boundary between the target block and the drawn block adjacent to the target block can be ensured not to generate gaps and overlap in the drawing process in the map, and the efficiency of drawing the block in the map is improved.
For example, the embodiments of the present disclosure may be applied to an application scenario as shown in fig. 1. In this scenario, a terminal device 1 may be included.
The terminal device 1 may be hardware or software. When the terminal device 1 is hardware, it may be various electronic devices having a display screen and supporting data processing, including but not limited to a smart phone, a tablet computer, a laptop portable computer, a desktop computer, and the like; when the terminal device 1 is software, it may be installed in an electronic device as described above. The terminal device 1 may be implemented as a plurality of software or software modules, or may be implemented as a single software or software module, which is not limited by the embodiment of the present disclosure. Of course, the embodiment of the present disclosure may also be applied to a server.
Specifically, in the application scenario shown in fig. 1, a user may move a cursor in a map through the terminal device 1, and the terminal device 1 may obtain a target position of the cursor, and may determine a target annotation point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map. After the terminal device 1 determines a plurality of target labeling points according to a plurality of target positions of the cursor in the target map, the terminal device 1 may determine boundary line segments corresponding to two adjacent target labeling points for each two adjacent target labeling points in the plurality of target labeling points. Then, the terminal device 1 may generate a target plate corresponding to the plurality of target annotation points in the target map according to the plurality of boundary line segments corresponding to the plurality of target annotation points. Therefore, if a target plate is adjacent to a drawn plate in the map, the common vertex and boundary between the target plate and the drawn plate can be ensured to be the same vertex and boundary in the map, so that the common boundary between the target plate and the drawn plate adjacent to the target plate can be ensured not to generate gaps and overlap in the process of drawing the edge in the map, and the efficiency of drawing the plate in the map is improved.
It should be noted that the specific type, number and combination of the terminal devices 1 may be adjusted according to the actual requirements of the application scenarios, and the embodiment of the present disclosure does not limit this.
It should be noted that the above application scenarios are only illustrated for the convenience of understanding the present disclosure, and the embodiments of the present disclosure are not limited in any way in this respect. Rather, embodiments of the present disclosure may be applied to any scenario where applicable.
Fig. 2 is a flowchart of a map-based mapping method according to an embodiment of the present disclosure. The map-based mapping method in fig. 2 may be executed by the terminal device (or the server) in fig. 1, and it should be noted that in an implementation manner, the method may be applied to a map web page version, that is, a web page map, and of course, may also be applied to a map client, which is not limited in this embodiment. As shown in fig. 2, the map-based mapping method includes:
s201: and determining a plurality of target marking points according to a plurality of target positions of the cursor in the target map.
In this embodiment, the target map may be understood as a map on which a slab needs to be drawn. When a user needs to draw a new plate in the target map, the user can select a point on the boundary of the plate to be drawn in the map through a cursor. For convenience of description, a position at which a point on the boundary of a tile to be drawn is selected in the map by a cursor may be referred to as a target position, and a tile to be drawn may be referred to as a target tile. In an implementation manner of this embodiment, the target position may be a position where a staying time of the cursor in the target map satisfies a preset time, for example, if it is detected that the cursor stays at a position a in the target map for 3s, it may be determined that the staying time of the cursor at the position a is 1s, and since the staying time is greater than the preset time by 0.3s, the position a may be taken as the target position; or the target position may be a position where the cursor stays in the target map when a first preset operation is detected, where the first preset operation may be left click, right click, double click, long press, and the like, and it should be noted that the first preset operation may be set according to an actual requirement without being limited to the above-mentioned manner, for example, assuming that the first preset operation is left click, when the cursor is located at a position B in the map when the left click is detected, the position B may be taken as the target position.
Because there may be an error in the process of manually selecting a point on the boundary of the target slab on the map by the user, for example, the user wants to select a position a on the map as a point on the boundary of the target slab, and the target position actually selected by the user on the map is a position B; therefore, after the target position is determined, it may be determined whether there is a need to adjust the selected target position according to the drawn slab in the target map (i.e., the drawn slab in the target map), that is, whether the target position needs to be adjusted to a point of a common boundary between the target slab and the drawn slab. If the target position does not need to be adjusted, the target position can be used as the position of the corresponding target marking point. If the target position needs to be adjusted, a target marking point corresponding to the target position can be determined according to the target position and the point-line information of the drawn plate in the target map. The target annotation point may be an annotation point for determining the boundary of the target plate, that is, the target annotation point may be used to determine the boundary of the target plate.
It can be understood that, in this embodiment, for each target position, a target annotation point corresponding to the target position may be determined according to the target position and the point-line information of the drawn plate in the target map. The point-line information of the drawn plate may include vertex information and boundary information in the drawn plate; the vertex information may include position information of each vertex in the drawn plate in the target map, such as coordinates of the vertex; the boundary information may include position information of end points of respective boundaries in the drawn slabs in the target map, for example, a drawn slab is a rectangle and includes four boundaries, each boundary includes two end points, and the boundary information of the drawn slab includes coordinates of two end points respectively corresponding to the respective boundaries in the four boundaries.
Since the point line information of the drawn slab includes vertex information and boundary information in the drawn slab, the point line information indicating the drawn slab may reflect the boundary of the drawn slab. Therefore, the target marking point corresponding to the target position is obtained by adjusting the target position based on the point-line information of the drawn plate in the target map, and the target marking point corresponding to the target position is determined by taking the point-line information of the boundary of the drawn plate in the target map as a reference object, and it can be understood that the target marking point corresponding to the target position at this time is a common vertex between the target plate and the drawn plate or a point on the common boundary; therefore, in the target map, if the target plate is adjacent to a drawn plate, the common vertex and boundary between the target plate and the drawn plate can be ensured to be the same vertex and boundary in the map, so that the common boundary between the target plate and the drawn plate adjacent to the target plate can be ensured not to generate gaps and overlap in the process of drawing in the map, further, a user does not need to manually adjust the boundary or vertex between the target plate and the drawn plate adjacent to the target plate, and the efficiency of drawing the plate in the map is improved.
S202: and determining boundary line segments corresponding to two adjacent target marking points aiming at every two adjacent target marking points in the plurality of target marking points.
In this embodiment, since the obtaining times of the cursor at the multiple target positions in the target map are all different, the obtaining time of each of the multiple determined target labeling points is also different, that is, the obtaining times of the target labeling points are in sequence. In this embodiment, after a target annotation point is acquired, another target attention point, which has an acquisition time earlier than the acquisition time of the target annotation point and is closest to the acquisition time of the target annotation point, may be determined according to the acquisition time of the target annotation point.
Then, according to the target attention point, the target attention point adjacent to the target attention point, and the point-line information of the drawn plate in the target map, a boundary line segment corresponding to the two adjacent target labeling points, that is, a boundary line segment using the two adjacent target labeling points as two line segment end points respectively, may be determined. It can be understood that, in order to ensure that no gap or overlap is generated between the common boundary between the target slab and the adjacent drawn slab during drawing in the map, when determining the boundary line segment corresponding to two adjacent target annotation points, the boundary line segment needs to be determined by combining the point-line information of the drawn slab in the target map, for example, the boundary line segment using the two adjacent target annotation points as the end points of the two line segments can be searched in the drawn slab according to the point-line information of the drawn slab.
It should be noted that, for an end point target annotation point (i.e., the target annotation point with the latest acquisition time) in the plurality of target attention points, not only the end point target annotation point and the boundary line segment corresponding to the target annotation point adjacent to the end point target annotation point, but also the boundary line segment corresponding to the end point target annotation point and the start target annotation point (i.e., the target annotation point with the earliest acquisition time) need to be determined.
S203: and generating target plates corresponding to the target marking points in the target map according to the boundary line segments corresponding to the target marking points.
After determining the plurality of boundary line segments corresponding to the plurality of target marking points, the plurality of boundary line segments may be connected according to the order of the acquisition time of each target marking point, so that target slabs corresponding to the plurality of target marking points may be generated in the target map. For example, four target labeling points are determined, and the sequence of the acquisition time of the four target labeling points is as follows: the target marking point A, the target marking point B and the target marking point C are connected, wherein a boundary line segment corresponding to the target marking point A and the target marking point B is a line segment a, a boundary line segment corresponding to the target marking point B and the target marking point C is a line segment B, and a boundary line segment corresponding to the target marking point C and the target marking point A is a line segment C.
Therefore, the embodiment of the present disclosure may determine a plurality of target annotation points according to a plurality of target positions of the cursor in the target map. Then, for each two adjacent target annotation points in the plurality of target annotation points, determining a boundary line segment corresponding to the two adjacent target annotation points; then, according to a plurality of boundary line segments corresponding to the plurality of target annotation points, target plates corresponding to the plurality of target annotation points can be generated in the target map. In this embodiment, for each target position, a target annotation point corresponding to the target position may be determined according to the target position and the point-line information of the drawn plate in the target map, and it can be understood that the target annotation point corresponding to the target position is obtained by adjusting the target position based on the point-line information of the drawn plate in the target map, so that the target annotation point corresponding to the target position is determined by using the point-line information of the boundary of the drawn plate in the target map as a reference object; therefore, if the target plate is adjacent to a drawn plate in the map, the common vertex and boundary between the target plate and the drawn plate can be ensured to be the same vertex and boundary in the map, so that the common boundary between the target plate and the drawn plate adjacent to the target plate can be ensured not to generate gaps and overlap in the process of drawing in the map, and the efficiency of drawing the plate in the map is improved.
Next, a specific implementation of "determining a target annotation point corresponding to the target location according to the target location and the point-line information of the depicted plate in the target map" mentioned in S201 will be introduced, and in particular, in one implementation, the step of "determining a target annotation point corresponding to the target location according to the target location and the point-line information of the depicted plate in the target map" may include the following implementation:
the first implementation mode comprises the following steps: and if the distance between the target position and a vertex of a drawn plate in the target map meets a preset distance condition, taking the vertex as a target marking point corresponding to the target position.
In an implementation manner of this embodiment, the preset distance condition may be: the vertex or the boundary is the vertex and the boundary of all the drawn plates, the distance between the vertex or the boundary and the target position is the smallest, and the distance between the vertex or the boundary and the target position is smaller than a preset threshold (such as 10 m).
As an example, after determining a target position of the cursor, distances between the target position and each vertex and each boundary in the drawn plate may be determined according to the target position and point-line information of all drawn plates in the target map. Then, screening out a vertex or a boundary with the smallest distance to the target position, if the vertex or the boundary with the smallest distance to the target position is a vertex, then, judging whether the distance between the vertex and the target position is smaller than a preset threshold value, if so, taking the vertex as a target marking point corresponding to the target position.
Next, as illustrated in fig. 3, assuming that the preset threshold is 10m, after determining that the target position of the cursor is position a, it may be determined that, among all vertices and boundaries of the drawn plate a, the distance between the vertex at position b and the target position is the minimum; and then, judging whether the distance between the vertex at the position b and the target position is less than 10m, if so, displaying a dotted line frame point at the position b to prompt a user whether to select the vertex at the position b as a target marking point, and changing the cursor into a selection icon, and if the cursor clicks the dotted line frame point, taking the vertex at the position b as the target marking point corresponding to the target position.
The second implementation mode comprises the following steps: if the distance between the target position and a boundary of a drawn plate in the target map meets the preset distance condition, determining a mapping point corresponding to the target position on the boundary according to the target position and the position information of the boundary, and taking the mapping point as a target marking point corresponding to the target position.
It should be noted that the position information of each boundary includes position information of two end points of the boundary (for example, coordinates of the end points). In this implementation, after determining a target position of the cursor, distances between the target position and each vertex and each boundary in the drawn plate may be determined according to the target position and point-line information of all drawn plates in the target map. Then, a vertex or a boundary having a minimum distance from the target position is screened out, if the minimum distance from the target position is a boundary, then, whether the distance between the boundary and the target position is smaller than a preset threshold value or not may be determined, if the distance is smaller than the preset threshold value, a mapping position of the target position on the boundary may be determined according to position information of the target position and two end points of the boundary, and a point corresponding to the mapping position may be used as a mapping point corresponding to the target position. Then, the mapping point may be used as a target marking point corresponding to the target position.
It will be appreciated that if the minimum distance from the target position is a boundary, the shortest distance between the target position of the cursor and the drawn slab is defined as the middle of the boundary line of the drawn slab rather than the vertices at both ends. Next, the closest point to the boundary of the drawn plate, i.e., the mapping point (i.e., the drop point) from the boundary line, may be calculated. In order to ensure that the boundary line between the target plate and the drawn plate does not overlap or generate any gap at all, the mapping point determined on the boundary also becomes a target marking point in the target plate, and the target marking point can be used as a common vertex (i.e. a common vertex) of the target plate and the drawn plate.
Next, a manner of determining the mapping position of the target position on the boundary is described. Assuming that a boundary having a minimum distance from the target position is a boundary a, longitude and latitude of a start point and an end point of the boundary a (i.e., coordinates of two end points of the boundary a) are a (x1, y1) and B (x2, y2), respectively, and longitude and latitude coordinates of the target position are P (x3, y3), a mapping position of the target position on the boundary (i.e., coordinates of a mapping point) is[x1+(x2-x1)*K,y1+(y2-y1)*K]Wherein, in the step (A),
Figure BDA0003341075980000111
k represents the ratio of the target position mapped on the line segment AB (i.e., the boundary a), for example, K is 1/2, which represents the midpoint of the line segment AB where the target position is mapped.
If the distance between any vertex or boundary and the target position does not satisfy the preset distance condition in all the drawn plates of the target map, the target position does not need to be adjusted, and the target position can be used as the position of the corresponding target marking point. Next, as illustrated in fig. 4, assuming that the preset threshold is 10m, after determining that the target position of the cursor is position a, it may be determined that the distance between the boundary b and the target position is the minimum among all the vertices and boundaries of the drawn plate a; next, since it is determined that the distance between the boundary b and the target position is greater than 10m, it indicates that the target position does not need to be adjusted, a cross icon is displayed at the position a to prompt the user whether to select a point located at the position a as a target annotation point, and the cursor is changed into a selection icon.
Next, a specific implementation manner of S202 "determining boundary line segments corresponding to two adjacent target annotation points in the plurality of target annotation points" for each two adjacent target annotation points will be described. In this embodiment, the step of determining, for each two adjacent target annotation points in the plurality of target annotation points, a boundary line segment corresponding to the two adjacent target annotation points may include the following two implementation manners:
the first implementation mode comprises the following steps: for each two adjacent target marking points in the plurality of target marking points, if the two adjacent target marking points are both positioned on the same drawn plate, determining the shortest boundary line segment between the two adjacent target marking points on the drawn plate; and taking the shortest boundary line segment as a boundary line segment corresponding to the two adjacent target marking points.
In this embodiment, if two adjacent target annotation points are located on the same drawn plate, a shortest boundary line segment between the two adjacent target annotation points may be determined on the boundary of the drawn plate, and all points in the shortest boundary line segment may be used as points on the boundary line segment corresponding to the two adjacent target annotation points, so that the boundary line segment corresponding to the two adjacent target annotation points may be drawn according to all points in the shortest boundary line segment.
Next, as illustrated in fig. 5, assuming that two adjacent target annotation points a and b are both located on the same drawn plate a, then, on the boundary of the drawn plate a, it may be determined that the shortest boundary line segment between the two adjacent target annotation points a and b is a line segment s, and two end points of the line segment s are the point a and the point b, respectively; then, all points in the shortest boundary line segment s can be used as points on the boundary line segment corresponding to the two adjacent target labeling points a and b; therefore, the boundary line segment corresponding to the two adjacent target labeling points a and b can be drawn according to all the points in the shortest boundary line segment s.
The second implementation mode comprises the following steps: for each two adjacent target marking points in the plurality of target marking points, if the two adjacent target marking points are respectively located on a drawn first plate and a drawn second plate, merging the first plate and the second plate into a drawn plate; determining the shortest boundary line segment between the two adjacent target marking points on the drawn plate; and taking the shortest boundary line segment as a boundary line segment corresponding to the two adjacent target marking points.
In this embodiment, if two adjacent target annotation points are respectively located on two different drawn plates (i.e. a first drawn plate and a second drawn plate), and the two drawn plates are completely independent, the first drawn plate and the second drawn plate may be merged into one drawn plate; as an example, whether the first plate and the second plate are directly adjacent or indirectly adjacent, the first plate and the second plate (or the first plate, the second plate and a plurality of plates between the first plate and the second plate) are merged into one graphic data and stored in the front-end component, and the graphic data is not displayed on the page. Then, the shortest boundary line segment between the two adjacent target labeling points can be determined on the merged drawn plate; and all points in the shortest boundary line segment are used as points on the boundary line segment corresponding to the two adjacent target marking points, so that the boundary line segment corresponding to the two adjacent target marking points can be drawn according to all points in the shortest boundary line segment, namely, the shortest boundary line segment is used as the boundary line segment corresponding to the two adjacent target marking points.
Next, referring to fig. 6 for example, as shown in fig. 6, assuming that two adjacent target annotation points a and B are respectively located on the drawn plate B and the drawn plate a, since the drawn plate B and the drawn plate a are directly adjacent to each other, the drawn plate B and the drawn plate a are merged into a drawn plate; then, determining a shortest boundary line segment s between two adjacent target marking points a and b on the drawn plate, wherein two end points of the line segment s are a point a and a point b respectively; then, all points in the shortest boundary line segment s can be used as points on the boundary line segment corresponding to the two adjacent target labeling points a and b; therefore, the boundary line segment corresponding to the two adjacent target labeling points a and b can be drawn according to all the points in the shortest boundary line segment s.
Next, a specific implementation manner of S203 "generating target blocks corresponding to the target annotation points in the target map according to the plurality of boundary line segments corresponding to the target annotation points" will be described. In this embodiment, the step of generating the target slabs corresponding to the target annotation points in the target map according to the boundary line segments corresponding to the target annotation points may include the following steps:
if a starting target marking point and an end target marking point in the target marking points coincide or preset operation aiming at the end target marking point is detected, sequentially connecting a plurality of boundary line segments corresponding to the target marking points, and generating target plates corresponding to the target marking points in the target map.
In this embodiment, if it is detected that the newly determined target annotation point coincides with the initial target annotation point, that is, the position of the target annotation point is the same as the position of the real target annotation point, it may be determined that the target annotation point is the end target annotation point; or, if it is detected that a preset operation (for example, a double-click operation, a long-press operation, or the like) is performed on the newly determined target annotation point, it may be determined that the target annotation point is the end-point target annotation point, and it should be noted that the preset operation may be other than the above-mentioned operation mode, and is not described herein again. After the end point target marking point is determined, a plurality of boundary line segments corresponding to the plurality of target marking points may be sequentially connected in order from the start target marking point to the end point target marking point, so that target plates corresponding to the plurality of target marking points may be generated in the target map.
In order to ensure that gaps and overlaps are still not generated on the common boundary of a target plate and the adjacent drawn plate under the condition of editing the drawn plate, for example, the vertex position of the drawn plate is adjusted; in an implementation manner of this embodiment, after S203, the method may further include:
s204: receiving a movement instruction for a vertex in the target slab.
The movement instruction comprises a target movement position corresponding to the vertex, and the vertex is a common vertex of the target plate and a drawn plate. The target moving position corresponding to the vertex can be understood as a destination to which the vertex needs to be moved, that is, a position where the vertex is located after the position of the vertex is adjusted.
S205: moving the vertex to the target movement position in response to the movement instruction; and adjusting the positions of the boundaries of the target plate and the drawn plate, which take the vertex as an end point, according to the target moving position to obtain the adjusted target plate and the adjusted drawn plate.
In this embodiment, after receiving a movement instruction for a vertex, the position of the vertex may be moved first in response to the movement instruction until the vertex moves to the target movement position. Then, the positions of the boundaries of the target plate and the drawn plate, where the vertex is used as an end point, may be adjusted according to the target moving position to obtain the adjusted target plate and the adjusted drawn plate, for example, a distance change condition between the vertex and a target labeling point adjacent to the vertex may be determined according to the target moving position of the moved vertex, and the length and direction of the boundary corresponding to the vertex may be adjusted according to the distance change condition to ensure that no gap or overlap is generated on the common boundary between the target plate and the drawn plate adjacent to the target plate.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
The following are embodiments of the disclosed apparatus that may be used to perform embodiments of the disclosed methods. For details not disclosed in the embodiments of the apparatus of the present disclosure, refer to the embodiments of the method of the present disclosure.
Fig. 7 is a schematic diagram of a map-based mapping apparatus provided by an embodiment of the present disclosure. As shown in fig. 7, the map-based drawing apparatus includes:
a marking point determining module 701, configured to determine a plurality of target marking points according to a plurality of target positions of a cursor in a target map; for each target position, determining a target marking point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map;
a line segment determining module 702, configured to determine, for each two adjacent target annotation points in the multiple target annotation points, a boundary line segment corresponding to the two adjacent target annotation points;
a plate generating module 703 is configured to generate, in the target map, target plates corresponding to the multiple target annotation points according to the multiple boundary line segments corresponding to the multiple target annotation points.
Optionally, the target position is a position where the time length of the cursor staying in the target map meets a preset time length, or the target position is a position where the cursor stays in the target map when a first preset operation is detected.
Optionally, the point-line information of the drawn plate includes vertex information and boundary information in the drawn plate; the annotation point determining module 701 is specifically configured to:
if the distance between the target position and a vertex of a drawn plate in the target map meets a preset distance condition, taking the vertex as a target marking point corresponding to the target position;
if the distance between the target position and a boundary of a drawn plate in the target map meets the preset distance condition, determining a mapping point corresponding to the target position on the boundary according to the target position and the position information of the boundary, and taking the mapping point as a target marking point corresponding to the target position.
Optionally, the preset distance condition is: the vertex or the boundary is the vertex and the boundary of all the drawn plates, the distance between the vertex or the boundary and the target position is the minimum, and the distance between the vertex or the boundary and the target position is smaller than a preset threshold value.
Optionally, the position information of the boundary includes position information of two end points of the boundary; the annotation point determining module 701 is specifically configured to:
determining a mapping position of the target position on the boundary according to the target position and position information of two end points of the boundary, and taking a point corresponding to the mapping position as a mapping point corresponding to the target position;
and taking the mapping point as a target marking point corresponding to the target position.
Optionally, the line segment determining module 702 is specifically configured to:
for each two adjacent target marking points in the plurality of target marking points, if the two adjacent target marking points are both positioned on the same drawn plate, determining the shortest boundary line segment between the two adjacent target marking points on the drawn plate; and using the shortest boundary line segment as a boundary line segment corresponding to the two adjacent target marking points; alternatively, the first and second electrodes may be,
for each two adjacent target marking points in the plurality of target marking points, if the two adjacent target marking points are respectively located on a drawn first plate and a drawn second plate, merging the first plate and the second plate into a drawn plate; determining the shortest boundary line segment between the two adjacent target marking points on the drawn plate; and taking the shortest boundary line segment as a boundary line segment corresponding to the two adjacent target marking points.
Optionally, the plate generating module 703 is configured to:
if a starting target marking point and an end target marking point in the target marking points coincide or preset operation aiming at the end target marking point is detected, sequentially connecting a plurality of boundary line segments corresponding to the target marking points, and generating target plates corresponding to the target marking points in the target map.
Optionally, the apparatus further includes an adjusting module, configured to:
receiving a movement instruction for a vertex in the target plate; the moving instruction comprises a target moving position corresponding to the vertex, and the vertex is a common vertex of the target plate and a drawn plate;
moving the vertex to the target movement position in response to the movement instruction; and adjusting the positions of the boundaries of the target plate and the drawn plate, which take the vertex as an end point, according to the target moving position to obtain the adjusted target plate and the adjusted drawn plate.
Compared with the prior art, the embodiment of the disclosure has the following beneficial effects: the present embodiment provides a map-based mapping apparatus, the apparatus including: the marking point determining module is used for determining a plurality of target marking points according to a plurality of target positions of the cursor in the target map; for each target position, determining a target marking point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map; the line segment determining module is used for determining a boundary line segment corresponding to each two adjacent target marking points in the plurality of target marking points; and the plate generating module is used for generating the target plates corresponding to the target marking points in the target map according to the plurality of boundary line segments corresponding to the target marking points. In this embodiment, for each target position, a target annotation point corresponding to the target position may be determined according to the target position and the point-line information of the drawn plate in the target map, and it can be understood that the target annotation point corresponding to the target position is obtained by adjusting the target position based on the point-line information of the drawn plate in the target map, so that the target annotation point corresponding to the target position is determined by using the point-line information of the boundary of the drawn plate in the target map as a reference object; therefore, if the target plate is adjacent to a drawn plate in the map, the common vertex and boundary between the target plate and the drawn plate can be ensured to be the same vertex and boundary in the map, so that the common boundary between the target plate and the drawn plate adjacent to the target plate can be ensured not to generate gaps and overlap in the process of drawing in the map, and the efficiency of drawing the plate in the map is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present disclosure.
Fig. 8 is a schematic diagram of a computer device 8 provided by an embodiment of the present disclosure. As shown in fig. 8, the computer device 8 of this embodiment includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and operable on the processor 801. The steps in the various method embodiments described above are implemented when the computer program 803 is executed by the processor 801. Alternatively, the processor 801 implements the functions of the respective modules/modules in the above-described respective apparatus embodiments when executing the computer program 803.
Illustratively, the computer program 803 may be partitioned into one or more modules stored in the memory 802 and executed by the processor 801 to accomplish the present disclosure. One or more modules/modules may be a series of computer program instruction segments capable of performing certain functions that are used to describe the execution of computer program 803 in computer device 8.
The computer device 8 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computer devices. The computer device 8 may include, but is not limited to, a processor 801 and a memory 802. Those skilled in the art will appreciate that fig. 8 is merely an example of a computing device 8 and is not intended to limit the computing device 8 and may include more or fewer components than those shown, or some of the components may be combined, or different components, e.g., the computing device may also include input output devices, network access devices, buses, etc.
The Processor 801 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 802 may be an internal storage module of the computer device 8, such as a hard disk or a memory of the computer device 8. The memory 802 may also be an external storage device of the computer device 8, such as a plug-in hard disk provided on the computer device 8, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 802 may also include both internal and external memory modules of the computer device 8. The memory 802 is used to store computer programs and other programs and data required by the computer device. The memory 802 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned functional modules and modules are illustrated as examples, and in practical applications, the above-mentioned functional allocation may be performed by different functional modules and modules according to requirements, that is, the internal structure of the apparatus is divided into different functional modules or modules to perform all or part of the above-mentioned functions. In the embodiments, each functional module and each module may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module, and the integrated modules may be implemented in a form of hardware or a form of software functional modules. In addition, specific names of the functional modules and modules are only used for distinguishing one functional module from another, and are not used for limiting the protection scope of the present disclosure. The modules and the specific working processes of the modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
In the embodiments provided in the present disclosure, it should be understood that the disclosed apparatus/computer device and method may be implemented in other ways. For example, the above-described apparatus/computer device embodiments are merely illustrative, e.g., a division of modules or modules into only one logical division, another division may be present in an actual implementation, multiple modules or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or modules, and may be in an electrical, mechanical or other form.
Modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present disclosure may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
The integrated modules/modules, if implemented in the form of software functional modules and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the present disclosure may implement all or part of the flow of the method in the above embodiments, and may also be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and when the computer program is executed by a processor, the computer program may implement the steps of the above methods and embodiments. The computer program may comprise computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain suitable additions or additions that may be required in accordance with legislative and patent practices within the jurisdiction, for example, in some jurisdictions, computer readable media may not include electrical carrier signals or telecommunications signals in accordance with legislative and patent practices.
The above examples are only intended to illustrate the technical solutions of the present disclosure, not to limit them; although the present disclosure has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present disclosure, and are intended to be included within the scope of the present disclosure.

Claims (11)

1. A map-based mapping method, the method comprising:
determining a plurality of target marking points according to a plurality of target positions of the cursor in the target map; for each target position, determining a target marking point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map;
determining boundary line segments corresponding to two adjacent target marking points aiming at each two adjacent target marking points in the plurality of target marking points;
and generating target plates corresponding to the target marking points in the target map according to the boundary line segments corresponding to the target marking points.
2. The method according to claim 1, wherein the target position is a position where the cursor stays in the target map for a preset time period, or the target position is a position where the cursor stays in the target map when the first preset operation is detected.
3. The method of claim 1, wherein the dotted line information of the drawn slabs includes vertex information and boundary information in the drawn slabs; the determining a target marking point corresponding to the target position according to the target position and the point-line information of the drawn plate in the target map includes:
if the distance between the target position and a vertex of a drawn plate in the target map meets a preset distance condition, taking the vertex as a target marking point corresponding to the target position;
if the distance between the target position and a boundary of a drawn plate in the target map meets the preset distance condition, determining a mapping point corresponding to the target position on the boundary according to the target position and the position information of the boundary, and taking the mapping point as a target marking point corresponding to the target position.
4. The method according to claim 3, wherein the preset distance condition is: the vertex or the boundary is the vertex and the boundary of all the drawn plates, the distance between the vertex or the boundary and the target position is the minimum, and the distance between the vertex or the boundary and the target position is smaller than a preset threshold value.
5. The method according to claim 3, wherein the position information of the boundary comprises position information of two end points of the boundary; the determining a mapping point corresponding to the target position on the boundary according to the target position and the position information of the boundary, and using the mapping point as a target marking point corresponding to the target position, includes:
determining a mapping position of the target position on the boundary according to the target position and position information of two end points of the boundary, and taking a point corresponding to the mapping position as a mapping point corresponding to the target position;
and taking the mapping point as a target marking point corresponding to the target position.
6. The method of claim 1, wherein the determining, for each two adjacent target annotation points of the plurality of target annotation points, a boundary line segment corresponding to the two adjacent target annotation points comprises:
for each two adjacent target marking points in the plurality of target marking points, if the two adjacent target marking points are both positioned on the same drawn plate, determining the shortest boundary line segment between the two adjacent target marking points on the drawn plate; and using the shortest boundary line segment as a boundary line segment corresponding to the two adjacent target marking points; alternatively, the first and second electrodes may be,
for each two adjacent target marking points in the plurality of target marking points, if the two adjacent target marking points are respectively located on a drawn first plate and a drawn second plate, merging the first plate and the second plate into a drawn plate; determining the shortest boundary line segment between the two adjacent target marking points on the drawn plate; and taking the shortest boundary line segment as a boundary line segment corresponding to the two adjacent target marking points.
7. The method of claim 1, wherein generating the target plate corresponding to the plurality of target annotation points in the target map according to the plurality of boundary line segments corresponding to the plurality of target annotation points comprises:
if a starting target marking point and an end target marking point in the target marking points coincide or preset operation aiming at the end target marking point is detected, sequentially connecting a plurality of boundary line segments corresponding to the target marking points, and generating target plates corresponding to the target marking points in the target map.
8. The method according to any one of claims 1-7, further comprising:
receiving a movement instruction for a vertex in the target plate; the moving instruction comprises a target moving position corresponding to the vertex, and the vertex is a common vertex of the target plate and a drawn plate;
moving the vertex to the target movement position in response to the movement instruction; and adjusting the positions of the boundaries of the target plate and the drawn plate, which take the vertex as an end point, according to the target moving position to obtain the adjusted target plate and the adjusted drawn plate.
9. A map-based mapping apparatus, the apparatus comprising:
the marking point determining module is used for determining a plurality of target marking points according to a plurality of target positions of the cursor in the target map; for each target position, determining a target marking point corresponding to the target position according to the target position and point-line information of a drawn plate in the target map;
the line segment determining module is used for determining a boundary line segment corresponding to each two adjacent target marking points in the plurality of target marking points;
and the plate generating module is used for generating the target plates corresponding to the target marking points in the target map according to the plurality of boundary line segments corresponding to the target marking points.
10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
CN202111308468.3A 2021-11-05 2021-11-05 Map-based drawing method and device Pending CN114140548A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111308468.3A CN114140548A (en) 2021-11-05 2021-11-05 Map-based drawing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111308468.3A CN114140548A (en) 2021-11-05 2021-11-05 Map-based drawing method and device

Publications (1)

Publication Number Publication Date
CN114140548A true CN114140548A (en) 2022-03-04

Family

ID=80393065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111308468.3A Pending CN114140548A (en) 2021-11-05 2021-11-05 Map-based drawing method and device

Country Status (1)

Country Link
CN (1) CN114140548A (en)

Similar Documents

Publication Publication Date Title
CN109298909B (en) Window adjusting method, mobile terminal and computer readable storage medium
CN108880700B (en) Frequency hopping method and frequency hopping device of clock signal and mobile terminal
CN107909368B (en) Payment control method and device, terminal and readable storage medium
US20190102925A1 (en) System, method, and electronic device for information duplication and machine-readable storage medium
JP2021173745A (en) Method, apparatus, device and storage medium for determining lane occupied by vehicle
CN102567008A (en) Device and method for generating real-time small trend chart of quoted price of financial tape reading software
CA3154763A1 (en) Data operation method, device and system
EP3376409A2 (en) Method and apparatus for spatial data visualization
CN110174114B (en) Lane line-level path generation method and device and storage medium
CN111091497A (en) Map vector line and plane thinning method, intelligent terminal and storage medium
CN108280154B (en) Method and device for displaying map annotation information, terminal and readable storage medium
JP7006081B2 (en) Graph drawing system, calculation server, graph drawing system control method, and program for calculation server
CN112085814B (en) Electronic map display method, device, equipment and readable storage medium
CN114140548A (en) Map-based drawing method and device
CN109582269B (en) Physical splicing screen display method and device and terminal equipment
CN111125564B (en) Thermodynamic diagram generation method, thermodynamic diagram generation device, thermodynamic diagram generation computer device and thermodynamic diagram generation storage medium
CN111506586A (en) Incremental charting method and device, electronic equipment and readable storage medium
US10019969B2 (en) Presenting digital images with render-tiles
CN111338827B (en) Method and device for pasting form data and electronic equipment
CN115757608A (en) Thermodynamic diagram generation method and device, electronic equipment and storage medium
CN115546345A (en) Gantt chart drawing method, apparatus, device, storage medium and program product
CA3208078A1 (en) Data comparison method and apparatus, device and storage medium
CN103677506A (en) Desktop switching system and method
CN113609237A (en) Data processing method, device, equipment and medium for construction land change
CN113447034A (en) Road network data processing method and device, electronic equipment and readable 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20230116

Address after: 518054 cable information transmission building 25f2504, no.3369 Binhai Avenue, Haizhu community, Yuehai street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen Xumi yuntu Space Technology Co.,Ltd.

Address before: No.103, no.1003, Nanxin Road, Nanshan community, Nanshan street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen Jizhi Digital Technology Co.,Ltd.