CN114627206A - Grid drawing method and device, electronic equipment and computer readable storage medium - Google Patents

Grid drawing method and device, electronic equipment and computer readable storage medium Download PDF

Info

Publication number
CN114627206A
CN114627206A CN202110009086.4A CN202110009086A CN114627206A CN 114627206 A CN114627206 A CN 114627206A CN 202110009086 A CN202110009086 A CN 202110009086A CN 114627206 A CN114627206 A CN 114627206A
Authority
CN
China
Prior art keywords
boundary
point
grid
corrected
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.)
Pending
Application number
CN202110009086.4A
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.)
Asiainfo Technology Nanjing Co ltd
Original Assignee
Asiainfo Technology Nanjing 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 Asiainfo Technology Nanjing Co ltd filed Critical Asiainfo Technology Nanjing Co ltd
Priority to CN202110009086.4A priority Critical patent/CN114627206A/en
Publication of CN114627206A publication Critical patent/CN114627206A/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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Abstract

The embodiment of the application provides a grid drawing method and device, electronic equipment and a computer readable storage medium, and relates to the technical field of computers. The method comprises the following steps: the method comprises the steps of determining a reference grid and a grid to be corrected, acquiring a coordinate point set on a boundary of the grid to be corrected, calculating a projection distance from each coordinate point to the reference grid, determining the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid based on the projection distances, correcting the boundary to be corrected according to the reference boundary, generating a target grid, and determining grid resources of the target grid. According to the method and the device, the adjacent grids are accurately seamless without overlapping, and meanwhile the processing efficiency of the grid boundary problem is improved.

Description

Grid drawing method and device, electronic equipment and computer readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a grid drawing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
In recent years, the business of operators is rapidly developed, and grid operation gradually comes into the vision of people. The operator can support the business system through the grid, integrate the marketing resources in the grid uniformly, and effectively evaluate and manage the responsible personnel of the grid.
For gridding operation, accurate definition of the range and the boundary of grids is crucial, at present, the boundary definition of a third-party grid can be completed by manually drawing the boundary on map software, and a method for processing the gap or the overlapping part of two adjacent grids is to stick the edges of the two adjacent boundaries to the road center line, but the road is complicated, the accuracy of the boundary processing result is not high, and the adjacent grids can still overlap or have gaps.
Disclosure of Invention
The object of the present application is to solve at least one of the above-mentioned technical drawbacks, in particular the technical drawback of low accuracy in dealing with the boundary problem.
In a first aspect, a method for grid rendering is provided, the method comprising:
determining a reference grid and a grid to be corrected, and acquiring a coordinate point set positioned on the boundary of the grid to be corrected; respectively calculating the projection distance from each coordinate point in the coordinate point set to the reference grid;
determining a closest point, a first boundary point and a second boundary point from the coordinate point set based on the projection distance;
determining a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the closest point;
correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary, and generating a target grid based on the corrected boundary;
grid resources of the target grid are determined.
In an optional embodiment of the first aspect, determining the closest point based on the projection distance comprises:
if the projection distance corresponding to the coordinate point in the coordinate set is not a first preset value and is smaller than a preset distance threshold, setting the coordinate point as a first coordinate point;
a closest point is determined from the first coordinate points based on the projection distance.
In an alternative embodiment of the first aspect, determining the closest point from the first coordinate points based on the projection distance comprises:
determining a minimum distance value in the projection distances corresponding to the first coordinate point;
a closest point is determined from the first coordinate points based on the minimum distance value.
In an optional embodiment of the first aspect, determining the closest point, the first boundary point and the second boundary point from the set of coordinate points based on the projection distance comprises:
traversing point by point along the boundary of the grid to be corrected to two sides by taking the closest point as a starting point, if the first projection distance corresponding to any first coordinate point in any direction is greater than a distance threshold value, setting the first coordinate point as a candidate boundary point, and stopping the traversing process in the direction;
and respectively setting the candidate boundary points in the two traversal directions as a first boundary point and a second boundary point.
In an optional embodiment of the first aspect, setting the candidate boundary points in the two traversal directions as the first boundary point and the second boundary point, respectively, includes:
for any direction, determining a first extension line formed by the candidate boundary point and the last coordinate point based on the traversal sequence in the direction;
determining a second extension line formed by the candidate boundary point and the next coordinate point;
and if the included angle between the first extension line and the second extension line is larger than or equal to a preset value, setting the candidate boundary point as a first boundary point or a second boundary point.
In an optional embodiment of the first aspect, determining the boundary to be corrected of the mesh to be corrected and the reference boundary of the reference mesh based on the first boundary point, the second boundary point and the closest point comprises:
dividing a boundary to be corrected and a reserved boundary of the grid to be corrected based on the first boundary point and the second boundary point; the boundary where the closest point is located is a boundary to be corrected;
determining a first projection point and a second projection point of the first boundary point and the second boundary point in the reference grid;
determining the corresponding nearest projection point of the nearest point in the reference grid;
a reference boundary of the reference grid is determined based on the first proxel, the second proxel, and the nearest proxel.
In an alternative embodiment of the first aspect, determining the reference boundary of the reference grid based on the first proxel, the second proxel, and the nearest proxel comprises:
dividing a reference boundary and an outer boundary of the reference grid based on the first projection point and the second projection point; the boundary where the nearest projection point is located is the reference boundary.
In a second aspect, there is provided an apparatus for mesh rendering, the apparatus comprising:
the calculation module is used for determining a reference grid and a grid to be corrected and acquiring a coordinate point set positioned on the boundary of the grid to be corrected; respectively calculating the projection distance from each coordinate point in the coordinate point set to the reference grid;
the selection module is used for determining a closest point, a first boundary point and a second boundary point from the coordinate point set based on the projection distance;
the determining module is used for determining a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the closest point;
the configuration module is used for correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary and generating a target grid based on the corrected boundary; grid resources of the target grid are determined.
In an optional embodiment of the second aspect, the selection module, when determining the closest point based on the projection distance, is specifically configured to:
determining a minimum distance value in the projection distances corresponding to the first coordinate point;
a closest point is determined from the first coordinate points based on the minimum distance value.
In an optional embodiment of the second aspect, the selection module, when determining the closest point from the first coordinate points based on the projection distance, is specifically configured to:
if the projection distance corresponding to the coordinate point in the coordinate set is not a first preset value and is smaller than a preset distance threshold, setting the coordinate point as a first coordinate point;
determining a closest point from the first coordinate points; the projection distance corresponding to the nearest point is the minimum distance value.
In an optional embodiment of the second aspect, the selection module, when determining the closest point, the first boundary point, and the second boundary point from the set of coordinate points based on the projection distance, is specifically configured to:
traversing point by point along the boundary of the grid to be corrected to two sides by taking the closest point as a starting point, if the first projection distance corresponding to any first coordinate point in any direction is greater than a distance threshold, setting the first coordinate point as a candidate boundary point, and stopping the traversing process in the direction;
and respectively setting the candidate boundary points in the two traversal directions as a first boundary point and a second boundary point.
In an optional embodiment of the second aspect, when the candidate boundary points in the two traversal directions are respectively set as the first boundary point and the second boundary point, the selecting module is specifically configured to:
aiming at any direction, determining a first extension line formed by the candidate boundary point and the last coordinate point based on the traversal sequence in the direction;
determining a second extension line formed by the candidate boundary point and the next coordinate point;
and if the included angle between the first extension line and the second extension line is larger than or equal to a preset value, setting the candidate boundary point as a first boundary point or a second boundary point.
In an optional embodiment of the second aspect, the determining module, when determining the boundary to be corrected of the mesh to be corrected and the reference boundary of the reference mesh based on the first boundary point, the second boundary point and the closest point, is specifically configured to:
dividing a boundary to be corrected and a reserved boundary of the grid to be corrected based on the first boundary point and the second boundary point; the boundary where the closest point is located is a boundary to be corrected;
determining a first projection point and a second projection point of the first boundary point and the second boundary point in the reference grid;
determining a corresponding nearest projection point of the nearest point in the reference grid;
a reference boundary of the reference grid is determined based on the first proxel, the second proxel, and the nearest proxel.
In an optional embodiment of the second aspect, the determining module, when determining the reference boundary of the reference grid based on the first projection point, the second projection point and the nearest projection point, is specifically configured to:
dividing a reference boundary and an outer boundary of the reference grid based on the first projection point and the second projection point; the boundary where the nearest projection point is located is a reference boundary.
In a third aspect, an electronic device is provided, which includes:
the grid drawing method comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the grid drawing method of any embodiment is realized when the processor executes the program.
In a fourth aspect, the present invention further provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the grid drawing method of any of the above embodiments.
According to the grid drawing method, the reference grid and the grid to be corrected are firstly determined, the coordinate point set on the boundary of the grid to be corrected is then obtained, the projection distance from each coordinate point to the reference grid is calculated, the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid are determined based on the projection distance, the boundary to be corrected is corrected according to the reference boundary, the target grid is generated, and finally the grid resources of the target grid are determined, so that the adjacent grids are accurately seamless without overlapping, and meanwhile, the processing efficiency of the grid boundary problem is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments of the present application will be briefly described below.
Fig. 1 is a schematic flowchart of a grid drawing method according to an embodiment of the present application;
fig. 2 is a schematic diagram of determining a closest point by 1 in a grid drawing method provided in an embodiment of the present application;
fig. 3 is a schematic diagram of a first extension line, a second extension line and an included angle corresponding to a candidate boundary point in a grid drawing method provided in the embodiment of the present application;
fig. 4 is a schematic flowchart of a grid drawing method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an image rendering apparatus according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device for image rendering according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to embodiments of the present application, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are exemplary only for the purpose of explaining the present application and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combinations of one or more of the associated listed items.
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The gridding operation is an operation idea which is newly appeared in recent years, and aims to help enterprises to be closer to users, so that the resource allocation of the enterprises is more suitable for market guidance, the operation scheme is more refined and targeted, and the resource allocation of the enterprises becomes more efficient.
The gridding operation not only can effectively bear the fusion service and fully 'fuse' the marketing force of each line, but also can support the system through the grid, and the grid is used for overall management and unified assessment of marketing resources in the grid, so that personnel reuse and whole-customer care are realized.
The grid division is a basic step of grid operation, and whether the grid division is reasonable and the boundary is clear can directly influence the execution effect of the grid operation and relate to the accuracy and the uniqueness of grid resources. Especially, the boundary division between grids must be clear, so as to avoid the situation that the resource overlapping between grids and even the user robbing can happen subsequently.
Currently, the boundary definition of the third-party mesh is generally done by manually drawing on the map software. For boundary gaps or overlaps between adjacent meshes, fine-drag adjustments may be made by manual editing, which may result in inefficiencies. In addition, there is another way to process gaps or overlap adjacent grids, that is, to stick the adjacent boundaries of two grids to the road centerline, but the road is complicated, the accuracy of the boundary processing result is usually not high, and there may still be gaps or overlaps between adjacent grids.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
The grid drawing method provided by the embodiment of the application can be applied to a server and can also be applied to a terminal.
Those skilled in the art will understand that the "terminal" used herein may be a Mobile phone, a tablet computer, a PDA (Personal Digital Assistant), an MID (Mobile Internet Device), etc.; a "server" may be implemented as a stand-alone server or as a server cluster comprised of multiple servers.
The embodiment of the present application provides a method for grid drawing, which may be applied to a server or a terminal, and as shown in fig. 1, the method may include:
step S100, determining a reference grid and a grid to be corrected, and acquiring a coordinate point set positioned on the boundary of the grid to be corrected; respectively calculating the projection distance from each coordinate point in the coordinate point set to the reference grid;
in the embodiment of the present application, two adjacent grids may be selected as the objects to be subjected to boundary processing, and boundary overlap may occur between the adjacent grids, or a gap may exist between the adjacent grids.
In two adjacent grids to be processed, one of the grids can be selected as a reference grid, the other grid is selected as a grid to be corrected, and the grid with smaller sharp boundary angle and more regular boundary can be selected as the reference grid to optimize the boundary processing effect.
After the reference grid and the grid to be corrected are determined, a coordinate set can be obtained in the next step. The coordinate point set can include all coordinate points forming a boundary of the grid to be corrected, and projection distances from the coordinate points to the reference grid are calculated respectively based on the coordinate point set.
When the projection distance is calculated, map projection can be performed firstly, warps and wefts on the earth surface are converted onto a plane by utilizing a certain mathematical rule, a one-to-one correspondence relationship between points on the earth surface (or other planet surfaces or celestial sphere surfaces) and points on a projection plane (namely the map plane) is established, and the projection mode can be roughly divided into projection in a deformation mode, projection according to the shape of a graticule during orthographic projection, relation according to a projection axis and a ground axis and the like. After the longitude and latitude coordinate points projected from the irregular spherical surface to the two-dimensional map are obtained, the projection distance can be calculated based on the longitude and latitude coordinate points.
Specifically, the coordinate point set may be composed of longitude and latitude coordinate points of a boundary of the grid to be corrected, and the coordinate point set may be traversed to calculate a projection distance from each coordinate point to the reference grid. Since the earth is an irregular sphere, the projection distance may represent an approximate perpendicular distance from a point to a line on a two-dimensional map.
Step S200, determining a closest point, a first boundary point and a second boundary point from the coordinate point set based on the projection distance;
in the embodiment of the application, the projection distance from each coordinate point in the coordinate point set to the reference grid can be obtained, the closest point can be determined according to the magnitude sequence of the projection distances, and the first boundary point and the second boundary point of which the projection distances meet the preset conditions can be screened out from the coordinate point set.
In this embodiment, determining the closest point based on the projection distance may include: determining a minimum distance value in the projection distances; a closest point is determined from the set of coordinate points based on the minimum distance value.
Wherein, a minimum distance value may be determined from the projection distances, the minimum distance value may correspond to a plurality of coordinate points, and the closest point is determined from the plurality of coordinate points corresponding to the minimum distance value according to a preset selection rule. Specifically, when there is no overlap but a gap between the reference grid and the grid to be corrected, the minimum distance value in the projection distances may be greater than zero; when there is an overlapping portion at the boundary between the reference grid and the grid to be corrected, the minimum distance value in the projection distances may be a negative number; when there is some boundary between the reference grid and the grid to be corrected or there is no gap and no overlapping part between some points, the minimum distance value in the projection distance may be zero.
In this embodiment of the present application, a preset selection rule may set a minimum distance value in the projection distances to be a non-zero value, and then select the minimum distance value in the non-zero projection distances, because when the projection distance is zero, it represents that the boundary does not need to be processed.
Step S300, determining a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the closest point;
in this embodiment of the present application, the first boundary point and the second boundary point are located on a boundary of the to-be-corrected grid, and the to-be-corrected grid may be divided into two boundary segments, where a boundary segment adjacent to the reference grid may be set as the to-be-corrected boundary.
When determining the reference boundary of the reference grid, the boundary of the reference grid may be divided based on the projection points of the first boundary point and the second boundary point on the boundary of the reference grid, and the reference boundary of the reference grid may be determined, and the reference boundary may be used to correct the boundary to be corrected.
S400, correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary, and generating a target grid based on the corrected boundary; grid resources of the target grid are determined.
In the embodiment of the present application, a set of coordinate points included in the reference boundary may be obtained and set as a reference coordinate point set, a set of coordinate points included in the boundary to be corrected may be set as a set of coordinate points to be corrected, and the reference coordinate point set may replace the set of coordinate points to be corrected to realize correction, that is, the reference boundary may be used as a part of a correction boundary (a new boundary generated after the correction grid is corrected), and meanwhile, both ends of the correction boundary may be adaptively adjusted, for example, two ends of the correction boundary may be directly connected to both ends of a boundary reserved in the grid to be corrected to form a closed new boundary, so as to obtain the target grid. The grid resources of the target grid may be determined based on the coverage area and size of the target grid.
In the grid drawing method in the embodiment of the application, the reference grid and the grid to be corrected are determined firstly, then the coordinate point set on the boundary of the grid to be corrected is obtained, the projection distance from each coordinate point to the reference grid is calculated, the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid are determined based on the projection distance, then the boundary to be corrected is corrected according to the reference boundary, the target grid is generated, finally the grid resources of the target grid are determined, accurate seamless non-overlapping of adjacent grids is achieved, and meanwhile the processing efficiency of grid boundary problems is improved.
In this embodiment of the present application, determining a closest point from the set of coordinate points based on the minimum distance value may include:
(1) and if the projection distance corresponding to the coordinate point in the coordinate set is not a first preset value and is smaller than a preset distance threshold, setting the coordinate point as a first coordinate point.
The first preset value can be set to be 0, the preset distance threshold value can be set according to requirements and used for reminding, and when the distance between the two grids is far, the two grids are not suitable for seamless and non-overlapping calculation.
In one example, the first preset value may be 0, the preset distance threshold may be 5, coordinate points corresponding to projection distances smaller than 5 and not 0 may be screened from the coordinate point set, and these coordinate points satisfying the condition may be set as the first coordinate points.
(2) A closest point is determined from the first coordinate points based on the projection distance.
First coordinate point can be sieved out from the coordinate point set, and every first coordinate point has corresponding projection distance, can carry out size sequencing with the projection distance of first coordinate point to determine the coordinate point nearest from the benchmark net in the first coordinate point, set up this coordinate point as the nearest point.
In the embodiment of the application, the coordinate points meeting the requirement that the projection distance is not the first preset value and is smaller than the preset distance threshold value can be screened out from the coordinate set, the coordinate points are set as the first coordinate points, the closest points are determined according to the sorting of the projection distance corresponding to the first coordinate points, when the projection distance is compared, the data range to be compared is narrowed firstly, the pre-screening effect is achieved, and the grid boundary processing efficiency is improved.
If the projection distance corresponding to no coordinate point meets the preset condition after all the coordinate points in the coordinate set are traversed, the distance between the selected grid to be corrected and the reference grid is too far or the seamless non-overlapping is finished, the grid is not suitable for or does not need to be subjected to grid boundary processing operation, and the grid to be corrected and the reference grid can be reselected at the moment.
In this embodiment of the present application, determining a closest point from the first coordinate points based on the projection distance may include: determining a minimum distance value in the projection distances corresponding to the first coordinate point; a closest point is determined from the first coordinate points based on the minimum distance value.
After the first coordinate points are screened out from the coordinate point set, the projection distances corresponding to the first coordinate points can be sequenced, and the minimum projection distance is set as the minimum distance value. If the projection distance corresponding to the first coordinate point is a non-zero value, the minimum distance value is also a non-zero value; when there is no overlapping portion between the grid to be corrected and the reference grid, the minimum distance value is greater than 0 if it exists, and when there is a portion where the boundaries overlap between the grid to be corrected and the reference grid, the minimum distance value may be a negative number.
In one example, as shown in FIG. 2, assume that there is a first coordinate point A, B, C, D, E and a corresponding calculated projection distance. Wherein the projection distance from the point A to the reference grid is 4; the projection distance from the point B to the reference grid is 2; the projection distance from the point C to the reference grid is-1; the projection distance of the D point reference grid is-1, the projection distance of the E point to the reference grid is 2, and the specific measurement unit of all the distance parameters can be determined based on the map projection mode of map software and the establishment scheme of a coordinate system. At this time, the minimum distance value is-1, and the closest point may be selected from the C point and the D point according to a preset selection rule, corresponding to the coordinate points C and D.
Specifically, the preset selection rule may be that, according to a traversal order when the projection distance is calculated, the first coordinate point whose first projection distance is the minimum distance value is selected as the closest point. For example, if the traversal order is "A, B, C, D, E" when calculating the projection distance, the C point is the first coordinate point whose first projection distance is the minimum distance value, and the C point is set as the closest point.
In the embodiment of the present application, the next closest point may also be determined in the same way, and the next closest point may be used to assist the subsequent correction grid coordinate reorganization.
In this embodiment of the present application, determining a closest point, a first boundary point, and a second boundary point from a set of coordinate points based on a projection distance may include the following steps:
(1) traversing point by point along the boundary of the grid to be corrected to two sides by taking the closest point as a starting point, if the projection distance corresponding to any coordinate point in any direction is greater than a distance threshold, setting the coordinate point as a candidate boundary point, and stopping the traversing process in the direction;
(2) and respectively setting the candidate boundary points in the two traversal directions as a first boundary point and a second boundary point.
Specifically, the closest point may be used as a starting point, point-by-point traversal is started in two directions towards two sides of the closest point, and whether the projection distance corresponding to each coordinate point is greater than the distance threshold value is determined according to the traversal sequence. If the projection distance corresponding to a certain coordinate point is greater than the distance threshold in the traversing process in any direction, the coordinate point can be set as a candidate boundary point, and the traversing process in the direction is stopped, and if the candidate boundary point is not determined in the other direction, the traversing is continued, and the traversing processes in the two directions are kept relatively independent.
After obtaining the two candidate boundary points, the two candidate boundary points may be set as the first boundary point and the second boundary point, respectively.
In one example, there are 5 coordinate points a1, B1, C1, D1 and E1 in a certain segment boundary of the grid to be corrected, and given that C1 is the closest point and the preset distance threshold is 2, the point-by-point traversal is started toward the directions of both sides of C1 as shown by the arrow direction in fig. 3, and it is checked whether the projection distance corresponding to each coordinate point is greater than 2. Suppose the projection distance from the point a1 to the reference grid is 4; the projection distance from the point B1 to the reference grid is 2; the projection distance from the point C1 to the reference grid is 1; the projection distance of the D1 point reference grid is 2; the projection distance from the point E1 to the reference grid is 3, and the specific measurement unit of all the distance parameters can be determined based on the map projection mode of the map software and the establishment scheme of the coordinate system.
According to the coordinate points and the corresponding projection distances, when the traversal is started from the left side of the point C1, the projection distance corresponding to the point B1 is equal to 2, if the condition that the projection distance is larger than 2 is not met, the traversal is continued to the point A1, the projection distance corresponding to the point A1 is 4, if the condition that the projection distance is larger than 2 is met, the point A1 is set as a candidate boundary point, and the traversal process in the direction is stopped. When the traversal is started from the right side of the point C1, the projection distance corresponding to the point D1 is 2, the condition that the projection distance is larger than 2 is not met, the traversal is continued to the point E1, the projection distance corresponding to the point E1 is 3, the condition that the projection distance is larger than 3 is met, then E1 can be set as another candidate boundary point, and the traversal process in the direction is stopped. The a1 point and the E1 point may be set as the first boundary point and the second boundary point, respectively.
In this embodiment of the present application, setting the candidate boundary points in the two traversal directions as the first boundary point and the second boundary point, respectively, may include the following steps:
(1) aiming at any direction, determining a first extension line formed by the candidate boundary point and the last coordinate point based on the traversal sequence in the direction;
(2) and determining a second extension line formed by the candidate boundary point and the next coordinate point.
The first extension line can be an extension line of connecting lines of candidate boundary points in two directions and a last coordinate point in a traversal sequence; the second extension line may refer to an extension line connecting the candidate boundary point and the next coordinate point in the traversal order. The candidate boundary points for each direction may correspond to respective first and second extension lines. If the number of coordinate points on the map is limited, the angle formed by connecting the candidate boundary point and the coordinate points in the sequence from front to back is not rounded, but can be a sharp angle with a certain angle.
(3) And if the included angle between the first extension line and the second extension line is larger than or equal to a preset value, setting the candidate boundary point as a first boundary point or a second boundary point.
The first extension line and the second extension line of each candidate boundary point may form an included angle, and if the included angle is greater than or equal to a preset value, the candidate boundary point may be set as the first boundary point or the second boundary point.
In this embodiment of the present application, if the angle of the included angle is smaller than the preset value, the traversal process may be restarted with the candidate boundary point as a starting point until a new candidate boundary point is determined, and then the included angle corresponding to the candidate boundary point is checked to see whether the angle is greater than or equal to the preset value.
In one example, as shown in fig. 3, three coordinate points a3, B3 and C3 are known, and B3 is a candidate boundary point, and a first extension line, a second extension line and an included angle corresponding to B3 are shown in the figure.
In this embodiment of the present application, determining a boundary to be corrected of a mesh to be corrected and a reference boundary of a reference mesh based on a first boundary point, a second boundary point, and a closest point may include the following steps:
(1) dividing a boundary to be corrected and a reserved boundary of the grid to be corrected based on the first boundary point and the second boundary point; the boundary where the closest point is located is the boundary to be corrected.
The boundary of the grid to be corrected can be divided into two sections by the first boundary point and the second boundary point, the boundary where the closest point is located can be set as the boundary to be corrected, and the other section is a reserved boundary.
(2) Determining a first projection point and a second projection point of the first boundary point and the second boundary point in the reference grid; and determining the corresponding nearest projection point of the nearest point in the reference grid.
And determining a first projection point and a second projection point of the first boundary point and the second boundary point in the reference grid through a preset projection scheme, wherein the projection mode of the boundary points can be vertical projection.
(3) A reference boundary of the reference grid is determined based on the first proxel, the second proxel, and the nearest proxel.
In an embodiment of the present application, determining a reference boundary of the reference grid based on the first projection point, the second projection point, and the nearest projection point may include: dividing a reference boundary and an outer boundary of the reference grid based on the first projection point and the second projection point; the boundary where the nearest projection point is located is a reference boundary.
The boundary of the reference grid may be divided into two segments by the first projection point and the second projection point, and the boundary where the nearest projection point is located may be set as the reference boundary, and the other segment is the outer boundary.
In order to explain the grid drawing method of the present application more clearly, the grid drawing method will be further explained below with reference to specific examples.
In one example, the present application provides a grid drawing method, as shown in fig. 4, comprising the steps of:
step S401, two adjacent grids to be processed are selected, one of the grids is determined to be a reference grid, and the other grid is determined to be a correction grid;
step S402, acquiring a longitude and latitude coordinate set of a correction network, wherein the longitude and latitude coordinate set comprises all coordinate points on a correction grid boundary;
step S403, traversing coordinate points in the longitude and latitude coordinate set, and calculating the projection distance from each coordinate point to a reference grid;
step S404, if the projection distance corresponding to the coordinate point is 0, the step S405 is entered; if the projection distance corresponding to the coordinate point is not 0, go to step S406;
step S405, ignoring the coordinate point, and entering step S408;
step S406, if the projection distance corresponding to the coordinate point is greater than a preset distance threshold, the step S405 is executed, otherwise, the step S407 is executed;
step S407, storing the coordinate point and the corresponding projection distance;
step S408, determining whether unprocessed coordinate points exist, if so, entering step S403, and if not, entering step S409;
step S409, if all the coordinate points are ignored and any coordinate point and corresponding projection distance are not stored, the step S410 is executed, otherwise, the step S411 is executed;
step S410, ending the process, wherein the two selected grids are not suitable for seamless and non-overlapping processing;
step S411, determining the minimum distance in the stored projection distances;
step S412, determining the coordinate point corresponding to the minimum distance as a candidate closest point, and taking the candidate closest point which is processed most firstly in the traversal process as the closest point;
step S413, starting from the closest point, traversing point by point along the correction grid boundary to two sides, and determining a first boundary point and a second boundary point;
step S414, determining a reserved boundary of the correction grid based on the first boundary point and the second boundary point, and determining a first projection point and a second projection point of the first boundary point and the second boundary point on the boundary of the reference grid;
step S415, determining a target boundary of the reference grid based on the first projection point and the second projection point;
and step S416, determining a correction boundary of the correction grid based on the reserved boundary and the target boundary, drawing a new correction grid based on the correction boundary, and realizing seamless non-overlapping processing.
According to the grid drawing method, the reference grid and the grid to be corrected are firstly determined, the coordinate point set on the boundary of the grid to be corrected is then obtained, the projection distance from each coordinate point to the reference grid is calculated, the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid are determined based on the projection distance, the boundary to be corrected is corrected according to the reference boundary, the target grid is generated, and finally the grid resources of the target grid are determined, so that the adjacent grids are accurately seamless without overlapping, and meanwhile, the processing efficiency of the grid boundary problem is improved. In addition, the scheme is not influenced by the map network conditions, is suitable for complex road conditions, and has wider application scenes of the grid drawing scheme.
An embodiment of the present application provides an image rendering apparatus, and as shown in fig. 5, the grid drawing apparatus 50 may include: a calculation module 501, a selection module 502, a determination module 503, and a configuration module 504, wherein,
a calculating module 501, configured to determine a reference grid and a grid to be corrected, and obtain a set of coordinate points located on a boundary of the grid to be corrected; respectively calculating the projection distance from each coordinate point in the coordinate point set to the reference grid;
a selecting module 502, configured to determine a closest point, a first boundary point, and a second boundary point from the coordinate point set based on the projection distance;
a determining module 503, configured to determine a boundary to be corrected of the mesh to be corrected and a reference boundary of the reference mesh based on the first boundary point, the second boundary point, and the closest point;
a configuration module 504, configured to correct the boundary to be corrected based on the reference boundary to obtain a corrected boundary, and generate a target grid based on the corrected boundary; grid resources of the target grid are determined.
In an embodiment of the application, the selection module 502, when determining the closest point based on the projection distance, is specifically configured to:
determining a minimum distance value in the projection distances corresponding to the first coordinate point;
a closest point is determined from the first coordinate points based on the minimum distance value.
In an embodiment of the present application, when the selecting module 502 determines the closest point from the first coordinate points based on the projection distance, it is specifically configured to:
if the projection distance corresponding to the coordinate point in the coordinate set is not a first preset value and is smaller than a preset distance threshold, setting the coordinate point as a first coordinate point;
determining a closest point from the first coordinate points; the projection distance corresponding to the nearest point is the minimum distance value.
In an optional embodiment of the second aspect, the selection module, when determining the closest point, the first boundary point, and the second boundary point from the set of coordinate points based on the projection distance, is specifically configured to:
traversing point by point along the boundary of the grid to be corrected to two sides by taking the closest point as a starting point, if the first projection distance corresponding to any first coordinate point in any direction is greater than a distance threshold, setting the first coordinate point as a candidate boundary point, and stopping the traversing process in the direction;
and respectively setting the candidate boundary points in the two traversal directions as a first boundary point and a second boundary point.
In an embodiment of the present application, when the selection module 502 sets the candidate boundary points in the two traversal directions as the first boundary point and the second boundary point, specifically:
for any direction, determining a first extension line formed by the candidate boundary point and the last coordinate point based on the traversal sequence in the direction;
determining a second extension line formed by the candidate boundary point and the next coordinate point;
and if the included angle between the first extension line and the second extension line is larger than or equal to a preset value, setting the candidate boundary point as a first boundary point or a second boundary point.
In an embodiment of the present application, when determining the boundary to be corrected of the mesh to be corrected and the reference boundary of the reference mesh based on the first boundary point, the second boundary point, and the closest point, the determining module 503 is specifically configured to:
dividing a boundary to be corrected and a reserved boundary of the grid to be corrected based on the first boundary point and the second boundary point; the boundary where the closest point is located is a boundary to be corrected;
determining a first projection point and a second projection point of the first boundary point and the second boundary point in the reference grid;
determining the corresponding nearest projection point of the nearest point in the reference grid;
a reference boundary of the reference grid is determined based on the first proxel, the second proxel, and the nearest proxel.
In an embodiment of the present application, when determining the reference boundary of the reference grid based on the first projection point, the second projection point, and the nearest projection point, the determining module 503 is specifically configured to:
dividing a reference boundary and an outer boundary of the reference grid based on the first projection point and the second projection point; the boundary where the nearest projection point is located is a reference boundary.
According to the grid drawing device, the reference grid and the grid to be corrected are firstly determined, the coordinate point set on the boundary of the grid to be corrected is then obtained, the projection distance from each coordinate point to the reference grid is calculated, the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid are determined based on the projection distance, the boundary to be corrected is corrected according to the reference boundary, the target grid is generated, and finally the grid resources of the target grid are determined, so that the adjacent grids are accurately seamless without overlapping, and meanwhile, the processing efficiency of the grid boundary problem is improved.
An embodiment of the present application provides an electronic device, including: a memory and a processor; at least one program stored in the memory for execution by the processor, which when executed by the processor, implements: the method comprises the steps of determining a reference grid and a grid to be corrected, acquiring a coordinate point set on a boundary of the grid to be corrected, calculating the projection distance from each coordinate point to the reference grid, determining the boundary to be corrected of the grid to be corrected and the reference boundary of the reference grid based on the projection distances, correcting the boundary to be corrected according to the reference boundary to generate a target grid, and finally determining grid resources of the target grid, so that the adjacent grids are accurately seamless without overlapping, and the processing efficiency of grid boundary problems is improved.
In an alternative embodiment, an electronic device is provided, as shown in fig. 6, the electronic device 4000 shown in fig. 6 comprising: a processor 4001 and a memory 4003. Processor 4001 is coupled to memory 4003, such as via bus 4002. Optionally, the electronic device 4000 may further comprise a transceiver 4004. In addition, the transceiver 4004 is not limited to one in practical applications, and the structure of the electronic device 4000 is not limited to the embodiment of the present application.
The Processor 4001 may be a CPU (Central Processing Unit), a general-purpose Processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 4001 may also be a combination that performs a computational function, including, for example, a combination of one or more microprocessors, a combination of a DSP and a microprocessor, or the like.
Bus 4002 may include a path that carries information between the aforementioned components. The bus 4002 may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus 4002 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
The Memory 4003 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical Disc storage, optical Disc storage (including Compact Disc, laser Disc, optical Disc, digital versatile Disc, blu-ray Disc, etc.), a magnetic Disc storage medium or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to these.
The memory 4003 is used for storing application codes for executing the scheme of the present application, and the execution is controlled by the processor 4001. Processor 4001 is configured to execute application code stored in memory 4003 to implement what is shown in the foregoing method embodiments.
The electronic devices include, but are not limited to, mobile terminals such as mobile phones, notebook computers, PADs, etc., and fixed terminals such as digital TVs, desktop computers, etc.
The present application provides a computer-readable storage medium, on which a computer program is stored, which, when running on a computer, enables the computer to execute the corresponding content in the foregoing method embodiments. It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
The foregoing is only a partial embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and embellishments can be made without departing from the principle of the present invention, and these should also be construed as the scope of the present invention.

Claims (10)

1. A method of grid rendering, comprising:
determining a reference grid and a grid to be corrected, and acquiring a coordinate point set positioned on the boundary of the grid to be corrected; respectively calculating the projection distance from each coordinate point in the coordinate point set to the reference grid;
determining a closest point, a first boundary point and a second boundary point from the coordinate point set based on the projection distance;
determining a boundary to be corrected of the grid to be corrected and a reference boundary of the reference grid based on the first boundary point, the second boundary point and the closest point;
correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary, and generating a target grid based on the corrected boundary;
grid resources of the target grid are determined.
2. The mesh rendering method of claim 1, wherein said determining a closest point based on said projection distance comprises:
if the projection distance corresponding to the coordinate point in the coordinate set is not a first preset value and is smaller than a preset distance threshold value, setting the coordinate point as the first coordinate point;
determining the closest point from the first coordinate points based on the projection distance.
3. The mesh rendering method of claim 2, wherein determining the closest point from the first coordinate points based on the projection distance comprises:
determining a minimum distance value in the projection distances corresponding to the first coordinate point;
a closest point is determined from the first coordinate points based on the minimum distance value.
4. The mesh rendering method of claim 1, wherein said determining a closest point, a first boundary point, and a second boundary point from the set of coordinate points based on the projection distance comprises:
traversing point by point along the boundary of the grid to be corrected to two sides by taking the closest point as a starting point, if the projection distance corresponding to any coordinate point in any direction is greater than the distance threshold, setting the coordinate point as a candidate boundary point, and stopping the traversing process in the direction;
and respectively setting the candidate boundary points in the two traversal directions as a first boundary point and a second boundary point.
5. The mesh rendering method of claim 4, wherein said setting the candidate boundary points in the two traversal directions as a first boundary point and a second boundary point, respectively, comprises:
for any direction, determining a first extension line formed by the candidate boundary point and the last coordinate point based on the traversal sequence in the direction;
determining a second extension line formed by the candidate boundary point and the next coordinate point;
and if the included angle between the first extension line and the second extension line is larger than or equal to a preset value, setting the candidate boundary point as a first boundary point or a second boundary point.
6. The mesh drawing method according to claim 1, wherein the determining a boundary to be corrected of the mesh to be corrected and a reference boundary of the reference mesh based on the first boundary point, the second boundary point, and the closest point comprises:
dividing the boundary to be corrected and a reserved boundary of the grid to be corrected based on the first boundary point and the second boundary point; the boundary where the closest point is located is the boundary to be corrected;
determining a first projection point and a second projection point of the first boundary point and the second boundary point in the reference grid;
determining a corresponding nearest projection point of the nearest point in the reference grid;
determining a reference boundary of the reference grid based on the first proxel, the second proxel, and the nearest proxel.
7. The mesh rendering method of claim 6, wherein said determining a reference boundary of the reference mesh based on the first proxel, the second proxel, and the nearest proxel comprises:
dividing a reference boundary and an outer boundary of the reference grid based on the first projection point and the second projection point; and the boundary where the nearest projection point is located is the reference boundary.
8. A mesh drawing apparatus, comprising:
the calculation module is used for determining a reference grid and a grid to be corrected and acquiring a coordinate point set positioned on the boundary of the grid to be corrected; respectively calculating the projection distance from each coordinate point in the coordinate point set to the reference grid;
a selection module, configured to determine a closest point, a first boundary point, and a second boundary point from the set of coordinate points based on the projection distance;
a determining module, configured to determine a boundary to be corrected of the mesh to be corrected and a reference boundary of the reference mesh based on the first boundary point, the second boundary point, and the closest point;
the configuration module is used for correcting the boundary to be corrected based on the reference boundary to obtain a corrected boundary and generating a target grid based on the corrected boundary; grid resources of the target grid are determined.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the mesh rendering method of any one of claims 1-7 when executing the program.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, implements the grid rendering method according to any one of claims 1 to 7.
CN202110009086.4A 2021-01-05 2021-01-05 Grid drawing method and device, electronic equipment and computer readable storage medium Pending CN114627206A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110009086.4A CN114627206A (en) 2021-01-05 2021-01-05 Grid drawing method and device, electronic equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110009086.4A CN114627206A (en) 2021-01-05 2021-01-05 Grid drawing method and device, electronic equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN114627206A true CN114627206A (en) 2022-06-14

Family

ID=81897164

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110009086.4A Pending CN114627206A (en) 2021-01-05 2021-01-05 Grid drawing method and device, electronic equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN114627206A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116612487A (en) * 2023-07-21 2023-08-18 亚信科技(南京)有限公司 Table identification method and device, electronic equipment and storage medium
CN117371385A (en) * 2023-12-06 2024-01-09 杭州行芯科技有限公司 Method for confirming adjacent graph, electronic device and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116612487A (en) * 2023-07-21 2023-08-18 亚信科技(南京)有限公司 Table identification method and device, electronic equipment and storage medium
CN116612487B (en) * 2023-07-21 2023-10-13 亚信科技(南京)有限公司 Table identification method and device, electronic equipment and storage medium
CN117371385A (en) * 2023-12-06 2024-01-09 杭州行芯科技有限公司 Method for confirming adjacent graph, electronic device and storage medium
CN117371385B (en) * 2023-12-06 2024-04-09 杭州行芯科技有限公司 Method for confirming adjacent graph, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN109737974B (en) 3D navigation semantic map updating method, device and equipment
EP2343659A1 (en) Techniques for density mapping
JP6511980B2 (en) Image processing apparatus, image processing method and program
EP3367334A1 (en) Depth estimation method and depth estimation apparatus of multi-view images
CN114627206A (en) Grid drawing method and device, electronic equipment and computer readable storage medium
CN107705363B (en) Road three-dimensional visual modeling method and device
CN111367649B (en) High-precision map data parallel processing method and device
JP2022541977A (en) Image labeling method, device, electronic device and storage medium
CN110599586A (en) Semi-dense scene reconstruction method and device, electronic equipment and storage medium
CN111862204A (en) Method for extracting visual feature points of image and related device
CN110458954B (en) Contour line generation method, device and equipment
CN113920275B (en) Triangular mesh construction method and device, electronic equipment and readable storage medium
CN102831169B (en) Plane figure relation determining method and system in geographical information system
CN108573510B (en) Grid map vectorization method and device
CN116385415A (en) Edge defect detection method, device, equipment and storage medium
CN106600691B (en) Fusion correction method and system of multi-channel two-dimensional video images in three-dimensional geographic space
CN109410304B (en) Projection determination method, device and equipment
CN116310227B (en) Three-dimensional dense reconstruction method, three-dimensional dense reconstruction device, electronic equipment and medium
CN111369676A (en) Map image processing method and device and vehicle-mounted equipment
EP3998458A2 (en) Method and apparatus for generating zebra crossing in high resolution map, and electronic device
CN108062793A (en) Processing method, device, equipment and storage medium at the top of object based on elevation
CN111210500B (en) Three-dimensional point cloud processing method and device
CN115222913B (en) Grid generation and structure simulation analysis method, device, equipment and storage medium
CN112689291B (en) Cellular network cell load balance evaluation method, device and equipment
CN113015153B (en) Method and device for identifying attribution of serving cell

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