Road end data construction method and device, electronic equipment and program product

CN116188659BActive Publication Date: 2026-07-21ALIBABA (CHINA) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIBABA (CHINA) CO LTD
Filing Date
2023-02-28
Publication Date
2026-07-21

Smart Images

  • Figure CN116188659B_ABST
    Figure CN116188659B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure disclose a road end data construction method and device, electronic equipment and program product. The method comprises: acquiring road data and road display level of a to-be-displayed road; the road data comprises two road end points on lane lines on left and right sides of the to-be-displayed road, and the two road end points are located at the same end of the to-be-displayed road; determining a drawing point based on the road display level and the road end points, the drawing point being located on an arc line with the two road end points as end points; and storing the road end points and the drawing point of the to-be-displayed road as road end data of the to-be-displayed road. The scheme solves the problem of gaps at road junctions in the prior art, and since different precision round head shapes corresponding to different road display levels are constructed in a geometric manner, the scheme can be free from the limitation of a map, can improve drawing efficiency, and can reduce storage memory of vertices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of map rendering technology, specifically to a method, apparatus, electronic device, and program product for constructing road-end data. Background Technology

[0002] Map data is the abstraction of real-world features into vector data in the form of points, lines, and polygons. Map rendering engines then render this map data based on the vector data containing points, lines, and polygons to create a visualized electronic map, allowing users to find real-world features through this digital map.

[0003] To make the road rendering in electronic maps more similar to real-world roads, roads, abstracted as "lines," need to be rendered as roads with width, i.e., road surfaces. Since roads in map data are represented by "lines," typically centerlines, expanding roads from "lines" to "surfaces" will result in the following: Figure 1 The gap shown affects the user experience.

[0004] Therefore, a solution is needed to address the issue of gaps appearing at road junctions when rendering road surfaces. Summary of the Invention

[0005] This disclosure provides a method, apparatus, electronic device, and program product for constructing roadside data.

[0006] In a first aspect, this disclosure provides a method for constructing road-end data, comprising:

[0007] Obtain road data and road display level of the road to be displayed; the road data includes two road endpoints on the left and right lane lines of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed;

[0008] Based on the road display level and road endpoints, a drawing point is determined, and the drawing point is located on an arc with the two road endpoints as its endpoints;

[0009] The road endpoints and drawing points of the road to be displayed are associated and stored as the road endpoint data of the road to be displayed.

[0010] Furthermore, based on the road display level and road endpoints, the drawing points are determined, including:

[0011] The number of drawing points is obtained based on the road display level of the road to be displayed; different road display levels correspond to different numbers of drawing points.

[0012] Obtain the equation parameters of the arc and the vector parameters of the road coordinate system corresponding to the two road endpoints;

[0013] Based on the number of drawing points, the angle between the line connecting each drawing point to the origin of the elliptical arc coordinate system where the arc is located and the coordinate axis of the elliptical arc coordinate system.

[0014] The arc coordinates of the drawing point in the elliptical coordinate system are determined based on the equation parameters of the arc and the included angle.

[0015] Based on the position coordinates of the road endpoint in the road coordinate system, the vector parameters of the road coordinate system, and the arc coordinates of the road endpoint in the elliptical coordinate system, the arc coordinates of the drawing point are transformed to the road coordinate system to obtain the position coordinates of the drawing point in the road coordinate system.

[0016] Further, determining the arc coordinates of the drawing point in the elliptical coordinate system based on the equation parameters of the arc and the included angle includes:

[0017] Based on the sine or cosine value of the corresponding included angle, determine the first coordinate value of the drawing point in the elliptical coordinate system;

[0018] Based on the first coordinate value and the equation parameters of the arc, the second coordinate value of the drawing point in the elliptical coordinate system is solved; wherein, the first coordinate value is one of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system, and the second coordinate value is the other of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system.

[0019] Furthermore, the method also includes:

[0020] Detect user map operations;

[0021] The current display area and map display scale are determined based on the map operations described above;

[0022] The current road to be displayed and the current road display level are determined based on the current display area and the map display scale.

[0023] Secondly, this disclosure provides a road rendering method, the method comprising:

[0024] Obtain road end data of the road to be displayed, the road end data including the road endpoints and drawing points of the road to be displayed, the drawing points being located on an arc with the two road endpoints as endpoints;

[0025] The end of the road to be displayed is rendered based on the road end data, so that the end of the road to be displayed is rounded.

[0026] Further, the road end data includes two road endpoints on the left and right lane lines of the road to be displayed, and drawing points on the arc between the two road endpoints; rendering the end of the road to be displayed based on the road end data includes:

[0027] The two road endpoints and the drawing point are used as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints, and combined to form the vertex coordinates of multiple triangles;

[0028] Based on the vertex coordinates of the plurality of triangles, the arc is drawn between the two road endpoints of the road to be displayed.

[0029] Furthermore, the two road endpoints and the drawing point are used as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints, and combined to form the vertex coordinates of multiple triangles, including:

[0030] The two road endpoints and the drawn point are used as candidate points;

[0031] Traverse the candidate points in either the counterclockwise or clockwise direction of the arc to obtain the triangle that the currently traversed candidate point can form with other candidate points;

[0032] After traversing all the candidate points, triangles with overlapping coverage areas are removed, leaving triangles that can form the rounded shape, and the vertex coordinates of the remaining triangles are obtained.

[0033] Furthermore, based on the two road endpoints and the drawing point, the rounded shape formed by the arc and the widening vector between the two road endpoints is triangulated to obtain the vertex coordinates of multiple triangles, including:

[0034] The two road endpoints and the drawn point are used as candidate points;

[0035] Using the two road endpoints as two symmetrical current selection points, select two next selection points that are adjacent to the two current selection points respectively from the candidate points, forming a quadrilateral with the two current selection points;

[0036] Take the two next selection points as the two current selection points, select two next selection points that are adjacent to the two current selection points from the candidate points, and form a quadrilateral with the two current selection points. Repeat this step until there are no candidate points or only one candidate point remains.

[0037] The resulting quadrilateral is divided into two triangles, and when only one candidate point remains, the two next selection points and the remaining selection point are combined to form a triangle, thus obtaining the vertex coordinates of all triangles.

[0038] Furthermore, the road-end data is determined using the method described in the first aspect.

[0039] Thirdly, this disclosure provides an apparatus for constructing road-end data, comprising:

[0040] The acquisition module is configured to acquire road data and road display level of the road to be displayed; the road data includes two road endpoints on the left and right lane lines of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed;

[0041] The first determining module is configured to determine a drawing point based on the road display level and road endpoints, wherein the drawing point is located on an arc with the two road endpoints as endpoints;

[0042] The storage module is configured to associate and store the road endpoints and drawing points of the road to be displayed as road endpoint data of the road to be displayed.

[0043] The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above function.

[0044] In one possible design, the above-described device includes a memory and a processor. The memory stores one or more computer instructions that support the device in performing the corresponding methods described above, and the processor is configured to execute the computer instructions stored in the memory. The device may also include a communication interface for communicating with other devices or communication networks.

[0045] Fourthly, embodiments of this disclosure provide an electronic device including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method described in any of the above aspects.

[0046] Fifthly, embodiments of this disclosure provide a computer-readable storage medium for storing computer instructions used by any of the above-described devices, which, when executed by a processor, are used to implement the methods described in any of the above aspects.

[0047] In a sixth aspect, embodiments of this disclosure provide a computer program product comprising computer instructions which, when executed by a processor, are used to implement the methods described in any of the preceding aspects.

[0048] The technical solutions provided in this disclosure can include the following beneficial effects:

[0049] In this embodiment, road data and road display level of the road to be displayed can be obtained. The road data includes at least two road endpoints on the left and right lane lines of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed. Based on the road display level and the road endpoints, the drawing point of the arc to be drawn at the end of the road to be displayed can be determined, and the road endpoints and the drawing point on the arc are associated and stored as the road end data of the road to be displayed, so that the road to be displayed can be drawn in the above manner based on the road end data. Since the end of the road to be displayed will be drawn into a rounded shape based on the road end data, the problem of gaps appearing at the road connection in the prior art is solved. At the same time, since the rounded shape with different precision corresponding to different road display levels is constructed by geometric means, it is not limited by textures, which can improve the drawing efficiency and reduce the storage memory of vertices.

[0050] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0051] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings:

[0052] Figure 1 This diagram illustrates the effect of a gap appearing at a road junction.

[0053] Figure 2 A flowchart illustrating a method for constructing roadside data according to an embodiment of the present disclosure is shown.

[0054] Figure 3 This diagram illustrates the effect of various drawing points on an arc according to an embodiment of the present disclosure.

[0055] Figure 4 A flowchart illustrating a road rendering method according to an embodiment of the present disclosure is shown.

[0056] Figures 5A-5C This diagram illustrates the triangulation and road drawing effect according to an embodiment of the present disclosure.

[0057] Figure 6 A structural block diagram of a road end data construction apparatus according to an embodiment of the present disclosure is shown.

[0058] Figure 7 This is a schematic diagram of the structure of an electronic device suitable for implementing a method for constructing road end data and / or a road rendering method according to an embodiment of the present disclosure. Detailed Implementation

[0059] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of the exemplary embodiments have been omitted from the drawings.

[0060] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and do not preclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.

[0061] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.

[0062] The details of the embodiments of this disclosure are described in detail below through specific examples.

[0063] Figure 2 A flowchart illustrating a method for constructing roadside data according to an embodiment of this disclosure is shown. Figure 2 As shown, the method for constructing this road-end data includes the following steps:

[0064] In step S201, road data and road display level of the road to be displayed are obtained; the road data includes two road endpoints on the lane lines on the left and right sides of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed;

[0065] In step S202, a drawing point is determined based on the road display level and road endpoints, and the drawing point is located on an arc with the two road endpoints as endpoints;

[0066] In step S203, the road endpoints and drawing points of the road to be displayed are associated and stored as road endpoint data of the road to be displayed.

[0067] In this embodiment, the method for constructing road-end data can be executed on a map display terminal. This is to achieve a rounded display effect at road junctions, thus preventing the appearance of rounded ends at the junctions between two roads. Figure 1 As shown in the embodiment of this disclosure, when rendering a road, an arc is drawn at the road connection between the current road to be displayed and other roads. The arc and the widening vector at the road connection are then triangulated geometrically to form a rounded shape. The rounded shape at the road connection is then drawn based on the triangulation result to achieve the rounded display effect of the road connection.

[0068] The road to be displayed can be one or more roads that need to be drawn on the current map display interface. In this embodiment, the road to be displayed can be one or two roads whose connection points need to be drawn on the current map display interface.

[0069] It should be noted that the roads displayed on the map have a certain width, and the road data on the map can include the widening vector in the width direction of the road connection. This widening vector can be described by its two endpoints and its direction vector. It can be understood that the road data can also only include the endpoints of the road centerline, and the widening vector can be obtained by widening the road in the width direction based on these endpoints.

[0070] In this embodiment of the disclosure, a rounded display effect can be achieved by drawing an arc at the widening vector at the road junction. That is, the widening vector and the arc to be drawn form a rounded shape, with the arc protruding outwards relative to the road at the widening vector. The two endpoints of the widening vector are on this arc. In some embodiments, the arc can be an elliptical arc.

[0071] The equation parameters of the arc, such as the major and minor radii, can be preset. In some embodiments, the arc can be centered at the midpoint of the widening vector at the road junction, with half of the widening vector as the major radius. Of course, it is understood that the center of the arc does not have to be on the widening vector, and the major radius does not have to be half of the widening vector; its center, major radius, and minor radius can be arbitrarily set, as long as the two endpoints of the road to be displayed lie on the arc. In other words, any arc with the two endpoints of the road to be displayed lying on the arc can be used.

[0072] In this embodiment of the disclosure, the road data may include, but is not limited to, two road endpoints on the left and right lane lines of the road to be displayed. The two road endpoints are located at the same end of the road to be displayed, and the line connecting the two road endpoints is the widening vector in the width direction at the connection between the road to be displayed and other roads.

[0073] To achieve a rounded end effect at one end of the road to be displayed, this embodiment employs triangulation. The rounded shape formed by the arc and the extended vector is triangulated, and the resulting triangle data is input into the rendering engine for drawing. It is understood that the more triangles created, i.e., the more triangulation points, the higher the accuracy of the drawn arc. In this embodiment, the drawing accuracy of the arc depends on the road display level. A higher road display level results in higher arc drawing accuracy and a greater number of triangulation points; conversely, a lower road display level results in lower arc drawing accuracy and a smaller number of triangulation points.

[0074] Therefore, this embodiment of the disclosure can determine the drawing points on the arc based on the road display level, including the number of drawing points and their location coordinates. These drawing points are the triangulation points.

[0075] The road display level refers to the display level of the road to be displayed on the current map interface, and is related to the current user's map zoom-in and / or zoom-out operations. A correspondence between road display levels and map zoom-in / / or zoom-out ratios can be pre-established, allowing the determination of the road display level based on the current map zoom-in / / or zoom-out ratio when drawing roads in real time.

[0076] To accelerate real-time rendering, the correspondence between different road display levels and the number of rendering points can be predetermined. Information about the rendering points corresponding to different numbers of rendering points on the arc with different equation parameters can also be determined, such as the arc coordinates of the rendering points corresponding to different numbers of rendering points in the elliptical coordinate system of the arc and the road coordinates in the road coordinate system. It can be understood that an arc is the arc between two road endpoints, that is, the endpoints of the arc between those two road endpoints. Since the equation parameters of the arc can be predetermined, at least one rendering point can be determined between the two road endpoints on the arc. Then, based on these two road endpoints, the at least one rendering point, and the equation parameters of the arc, a rounded road end can be drawn at one end of the road to be displayed.

[0077] In this embodiment of the disclosure, after determining at least one drawing point on the arc to be drawn at one end of the road to be displayed based on the road display level and the road endpoint, the at least one drawing point and the road endpoint can be associated and stored as the road end data of the road to be displayed, and then stored in the road data of the road to be displayed, so that the end of the road to be displayed can be drawn based on the road end data when displaying the map.

[0078] In this embodiment, road data and road display level of the road to be displayed can be obtained. The road data includes at least two road endpoints on the left and right lane lines of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed. Based on the road display level and the road endpoints, the drawing point of the arc to be drawn at the end of the road to be displayed can be determined, and the road endpoints and the drawing point on the arc are associated and stored as the road end data of the road to be displayed, so that the road to be displayed can be drawn in the above manner based on the road end data. Since the end of the road to be displayed will be drawn into a rounded shape based on the road end data, the problem of gaps appearing at the road connection in the prior art is solved. At the same time, since the rounded shape with different precision corresponding to different road display levels is constructed by geometric means, it is not limited by textures, which can improve the drawing efficiency and reduce the storage memory of vertices.

[0079] In an optional implementation of this embodiment, step S202, namely the step of determining the drawing point based on the road display level and road endpoints, further includes the following steps:

[0080] The number of drawing points is obtained based on the road display level of the road to be displayed; different road display levels correspond to different numbers of drawing points.

[0081] Obtain the equation parameters of the arc and the vector parameters of the road coordinate system corresponding to the two road endpoints;

[0082] Based on the number of drawing points, the angle between the line connecting each drawing point to the origin of the elliptical arc coordinate system containing the arc and the coordinate axis of the elliptical arc coordinate system is determined.

[0083] The arc coordinates of the drawing point in the elliptical coordinate system are determined based on the equation parameters of the arc and the included angle.

[0084] Based on the position coordinates of the road endpoint in the road coordinate system, the vector parameters of the road coordinate system, and the arc coordinates of the road endpoint in the elliptical coordinate system, the arc coordinates of the drawing point are transformed to the road coordinate system to obtain the position coordinates of the drawing point in the road coordinate system.

[0085] In this optional implementation, as described above, the drawing points are the triangulation points used when drawing the rounded shapes at the ends of the roads to be displayed. To improve drawing efficiency, the number of drawing points corresponding to each road display level can be determined offline. The number of drawing points can be adjusted based on the level of detail required for the rounded ends at road junctions. Specifically, it can be determined based on actual needs; for example, if high precision is required for the rounded ends at road junctions, a larger number of drawing points can be set, while if lower precision is required, a smaller number of drawing points can be set.

[0086] In some embodiments, one or more equation parameters of the arc can be preset, which may include, but are not limited to, the major radius, minor radius, and center position of the arc.

[0087] For each road display level, the number of drawing points can be determined, and the arc coordinates of each drawing point on the arc corresponding to the equation parameters of one or more arcs can be defined. These arc coordinates can include the relative position of the drawing point on the arc, such as the angle between the drawing point and the coordinate axes in the elliptical arc coordinate system containing the arc. In some embodiments, the relative position on the arc can be represented based on the elliptical coordinate system containing the arc, where the center of the arc is the origin, the major radius of the arc is the axial coordinate axis, and the minor radius is the radial coordinate axis.

[0088] Given the equation parameters of the arc and the number of drawing points, the required number of drawing points can be selected on the arc between the two road endpoints according to a pre-defined method.

[0089] In some embodiments, the angle between the line connecting each drawing point to the origin of the elliptical arc coordinate system containing the arc and the same coordinate axis of the elliptical arc coordinate system can be determined. This coordinate axis can be an axial coordinate axis or a radial coordinate axis. Based on this angle, the arc coordinates of each drawing point in the elliptical arc coordinate system can be determined. In some embodiments, drawing points can be selected in a manner with equal included angles, that is, drawing points are selected where the two included angles formed by the lines connecting every three adjacent drawing points to the origin are equal. Of course, these included angles can also be unequal, and can be selected according to a certain rule or not, as long as all drawing points are on the arc and between the two road endpoints. Specific settings can be made according to actual needs, and no specific restrictions are imposed here.

[0090] In this optional implementation, the arc is to be drawn at the road junction to seamlessly connect with the roads drawn on the map. However, the coordinates of all the data used to draw the roads to be displayed are not in this elliptical coordinate system, but in another known road coordinate system. Therefore, it is necessary to transform the arc coordinates of the drawing point in the elliptical coordinate system to the road coordinate system. Based on the road coordinates of the drawing point in the road coordinate system, triangulation calculations can be performed together with the two road endpoints of the road to be displayed to obtain multiple triangles. The vertex coordinates of these multiple triangles are all coordinates in the road coordinate system, so they can be sent to the rendering engine to draw rounded shapes at the ends of the roads to be displayed on the map.

[0091] To transform the circular coordinates to the road coordinate system containing the two road endpoints of the road to be displayed, we can first obtain the vector parameters of that road coordinate system, namely the axial and radial vectors of the road to be displayed. In map display, the axial vector of the road to be displayed can be aligned with the width direction of the road and parallel to the line connecting the two road endpoints, while the radial vector is aligned with the road direction.

[0092] After obtaining the vector parameters of the road coordinate system, since the road coordinates of the two road endpoints in the road coordinate system are known (which can be directly obtained from the road data of the road to be displayed), and since the two road endpoints are the two endpoints of an arc, their arc coordinates in the elliptical arc coordinate system are also known, the position coordinates of the drawing point in the road coordinate system can be calculated based on the arc coordinates of the two road endpoints, the road coordinates, and the arc coordinates of the drawing point.

[0093] In an optional implementation of this embodiment, the step of determining the arc coordinates of the drawing point in the elliptical coordinate system based on the equation parameters of the arc and the included angle further includes the following steps:

[0094] Based on the sine or cosine value of the corresponding included angle, determine the first coordinate value of the drawing point in the elliptical coordinate system;

[0095] Based on the first coordinate value and the equation parameters of the arc, the second coordinate value of the drawing point in the elliptical coordinate system is solved; wherein, the first coordinate value is one of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system, and the second coordinate value is the other of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system.

[0096] In this optional implementation, the first coordinate value of the drawing point can be determined based on the cosine of the angle between the line connecting each drawing point and the origin of the elliptical arc coordinate system and the coordinate axis. The second coordinate value of the drawing point can be solved based on the first coordinate value and the equation parameters of the arc.

[0097] In some embodiments, the first coordinate value of the drawing point can be determined based on the cosine of the angle between the line connecting the drawing point and the origin of the elliptical arc coordinate system and the first coordinate axis, or the first coordinate value of the drawing point can be determined based on the sine of the angle between the line connecting the drawing point and the origin of the elliptical arc coordinate system and the second coordinate axis; the first coordinate value is one of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system, and the second coordinate value is the other of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system.

[0098] Points on an ellipse all follow the equation of the arc. After determining the first coordinate value of the point to be drawn, the second coordinate value can be calculated based on the arc equation and the first coordinate value.

[0099] The following example illustrates one method for calculating the arc coordinates of a point.

[0100] Figure 3 This diagram illustrates the effect of various drawing points on an arc according to an embodiment of the present disclosure. For example... Figure 3 As shown in the figure, only the right half of the structure is displayed; the left half can be symmetrical to the right half. The right half has three drawing points with corresponding angles of cita0, cita1, and cita2. The following formulas can be used to calculate the arc coordinates (x0, y0) of the drawing point corresponding to cita0 in the elliptical coordinate system, the arc coordinates (x1, y1) of the drawing point corresponding to cita1 in the elliptical coordinate system, and the arc coordinates (x2, y2) of the drawing point corresponding to cita2 in the elliptical coordinate system:

[0101] x = Cos(cita), where x is the axial coordinate value, which can be x0, x1, or x2; cita can be cita0, cita1, or cita2.

[0102] y = sqrt[b 2 *(1-x*x / a 2 )], where y is the radial coordinate value, which can be y0, y1 and y2; a and b are the minor radius and major radius of the arc, respectively.

[0103] It is understandable that the x coordinate mentioned above can also be a variable multiplied by cos(cita), the value of which is less than the value of the major radius. In this way, the x value calculated can take between the maximum and minimum values ​​along the axis of the ellipse.

[0104] Figure 3 The road coordinate vector of the drawing point on the right half of the coordinate system can be obtained by the following formula:

[0105] AAn(Right) = x*CN - y*N

[0106] The road coordinate vectors of the points drawn on the left side can be obtained by converting them using the following formula:

[0107] AAn(Left) = x*CN + y*N

[0108] Where CN is the radial vector of the road, and N is the axial vector of the road; that is, CN and N are the radial and axial vectors in the road coordinate system. AAn(Right) is... Figure 3 The vector representation of the road coordinates of the points drawn on the right half of the diagram is given by AAn(Left). Figure 3 The vector representation of the road coordinates of the points drawn on the left half of the diagram.

[0109] In an optional implementation of this embodiment, the method further includes the following steps:

[0110] Detect user map operations;

[0111] The current display area and map display scale are determined based on the map operations described above;

[0112] The current road to be displayed and the current road display level are determined based on the current display area and the map display scale.

[0113] In this optional implementation, when the map is displayed on the map interface, user map operations, such as map movement, zooming in and out, can be detected in real time. These operations will cause the roads on the map interface to be redrawn. Under map movement operations, new roads need to be drawn, while under map zooming in and out operations, roads of different sizes need to be drawn. In this embodiment, since the drawing of the rounded head shape at the road connection is related to the road display level, after detecting the user's map operation, the local map display area and map display scale can be determined based on the map operation. Based on the map display area, it can be determined which roads need to be drawn, and based on the map display scale, the current road display level can be determined. If the map is zoomed in, the road display level will change, and the rounded head shape at the road connection needs to be redrawn. At this time, the number of drawing points on the arc can be determined based on the new road display level, and then the road coordinates of each drawing point on the arc to be drawn can be determined based on the number of drawing points. Then, based on the road coordinates of each drawing point and the two road endpoints, the vertex coordinates of multiple triangles are obtained. Inputting the vertex coordinates of multiple triangles into the rendering engine can realize the rounded head display effect at the road connection.

[0114] Figure 4 A flowchart illustrating a road rendering method according to an embodiment of the present disclosure is shown. Figure 4 As shown, the road rendering method includes the following steps:

[0115] In step S401, road end data of the road to be displayed is obtained; the road end data includes two road endpoints and a drawing point of the road to be displayed, and the drawing point is located on an arc with the two road endpoints as endpoints;

[0116] In step S402, the end of the road to be displayed is rendered based on the road end data, so that the end of the road to be displayed is rounded.

[0117] In this embodiment, the road rendering method can be executed on a map display terminal. To achieve a rounded display effect at road junctions, and thus prevent the junctions between two roads from displaying a circular shape, [further details are needed]. Figure 1 As shown in the embodiment of this disclosure, when rendering a road, an arc is drawn at the road connection between the current road to be displayed and other roads. The arc and the widening vector at the road connection are then triangulated geometrically to form a rounded shape. The rounded shape at the road connection is then drawn based on the triangulation result to achieve the rounded display effect of the road connection.

[0118] The road to be displayed can be one or more roads that need to be drawn on the current map display interface. In this embodiment, the road to be displayed can be one or two roads whose connection points need to be drawn on the current map display interface.

[0119] It should be noted that the roads displayed on the map have a certain width, and the road data on the map can include the widening vector in the width direction of the road connection. This widening vector can be described by its two endpoints and its direction vector. It can be understood that the road data can also only include the endpoints of the road centerline, and the widening vector can be obtained by widening the road in the width direction based on these endpoints.

[0120] In this embodiment of the disclosure, a rounded display effect can be achieved by drawing an arc at the widening vector at the road junction. That is, the widening vector and the arc to be drawn form a rounded shape, with the arc protruding outwards relative to the road at the widening vector. The two endpoints of the widening vector are on this arc. In some embodiments, the arc can be an elliptical arc.

[0121] The equation parameters of the arc, such as the major and minor radii, can be preset. In some embodiments, the arc can be centered at the midpoint of the widening vector at the road junction, with half of the widening vector as the major radius. Of course, it is understood that the center of the arc does not have to be on the widening vector, and the major radius does not have to be half of the widening vector; its center, major radius, and minor radius can be arbitrarily set, as long as the two endpoints of the road to be displayed lie on the arc. In other words, any arc with the two endpoints of the road to be displayed lying on the arc can be used.

[0122] In this embodiment of the disclosure, the road data may include, but is not limited to, two road endpoints on the left and right lane lines of the road to be displayed. The two road endpoints are located at the same end of the road to be displayed, and the line connecting the two road endpoints is the widening vector in the width direction at the connection between the road to be displayed and other roads.

[0123] To achieve a rounded end effect at one end of the road to be displayed, this embodiment employs triangulation. The rounded shape formed by the arc and the extended vector is triangulated, and the resulting triangle data is input into the rendering engine for drawing. It is understood that the more triangles created, i.e., the more triangulation points, the higher the accuracy of the drawn arc. In this embodiment, the drawing accuracy of the arc depends on the road display level. A higher road display level results in higher arc drawing accuracy and a greater number of triangulation points; conversely, a lower road display level results in lower arc drawing accuracy and a smaller number of triangulation points.

[0124] In some embodiments, the road coordinates of the two road endpoints of the road to be displayed and the road coordinates of at least one drawing point on the arc with the two road endpoints as endpoints can be predetermined and stored in the road data as road end data of the road to be displayed. When drawing the road, the road end data can be extracted from the road data, and an arc with the two road endpoints as the tail endpoints can be drawn based on the two road endpoints and at least one drawing point in the road end data, thereby creating a rounded display effect at the ends of the road to be displayed.

[0125] In this embodiment, road end data of a road to be displayed can be obtained, and then the end of the road to be displayed can be drawn into a rounded shape based on the road end data. The road end data may include two road endpoints and a drawing point, which is located on an arc with the two road endpoints as endpoints. Roads drawn in this manner solve the problem of gaps at road connections in existing technologies because the end of the road to be displayed is drawn into a rounded shape based on the road end data. Furthermore, since different rounded shapes with different precisions corresponding to different road display levels are constructed geometrically, it is not limited by texture mapping, thus improving drawing efficiency and reducing vertex storage memory.

[0126] In an optional implementation of this embodiment, step S402, namely the step of rendering the end of the road to be displayed based on the road end data, further includes the following steps:

[0127] The two road endpoints and the drawing point are used as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints, and combined to form the vertex coordinates of multiple triangles.

[0128] The arc is drawn between the two road endpoints of the road to be displayed based on the vertex coordinates of the plurality of triangles.

[0129] In this optional implementation, an arc can be drawn based on the two road endpoints and the drawing point in the road end data, with the two road endpoints as its endpoints, so that the drawing point associated with the two road endpoints lies on the arc. After the arc is drawn, a rounded shape can be formed at the end of the road to be displayed.

[0130] To draw an arc, the arc can be triangulated. In this embodiment, the two road endpoints and each drawing point on the arc can be used as triangulation points. These triangulation points are then combined to form multiple triangles. These multiple triangles can be combined to form a surface formed by the line connecting the arc and the two road endpoints. The vertex coordinates of each triangle are then input into the rendering engine. The rendering engine can draw these multiple triangles and finally render the arc.

[0131] In an optional implementation of this embodiment, the step of combining the two road endpoints and the drawing point as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints to form the vertex coordinates of multiple triangles further includes the following steps:

[0132] The two road endpoints and the drawn point are used as candidate points;

[0133] Traverse the candidate points in either the counterclockwise or clockwise direction of the arc to obtain the triangle that the currently traversed candidate point can form with other candidate points;

[0134] After traversing all the candidate points, triangles with overlapping coverage areas are removed, leaving triangles that can form the rounded shape, and the vertex coordinates of the remaining triangles are obtained.

[0135] In this optional implementation, after determining the road coordinates of the drawing points, the arc can be triangulated. The triangulation process can be viewed as dividing the rounded shape formed by the arc and the lines connecting the two road endpoints into multiple triangles, where the vertices of these triangles are points on the arc. In this embodiment, the triangulation points for triangulating the arc can include the two road endpoints and each drawing point. The purpose of triangulation is to divide the rounded shape into multiple triangles, which are then rendered by the rendering engine. The final rendered triangles can then form the rounded shape.

[0136] In this embodiment, the road coordinates of the triangulation points on the arc are determined. Multiple triangulation triangles can be obtained by combining these triangulation points into triangles. In some embodiments, the triangulation points (i.e., the drawing points and the two road endpoints) can be used as candidate points, and sorted according to the counter-clockwise or clockwise direction of the arc. Then, the candidate points (i.e., the drawing points and the two road endpoints) are traversed in sorted order. For each candidate point, the triangle formed by that candidate point and other candidate points is determined, and the determined triangle is added to the triangle set. After traversing all candidate points, duplicate triangles in the triangle set can be deleted, and triangles that partially overlap with other triangles can be removed, retaining only those triangles that can form a rounded shape, which are the multiple triangles obtained after triangulation. The coordinates of the three vertices of each triangle are recorded as a group and sent to the rendering engine.

[0137] In an optional implementation of this embodiment, the step of combining the two road endpoints and the drawing point as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints to form the vertex coordinates of multiple triangles further includes the following steps:

[0138] The two road endpoints and the drawn point are used as candidate points;

[0139] Using the two road endpoints as two symmetrical current selection points, select two next selection points that are adjacent to the two current selection points respectively from the candidate points, forming a quadrilateral with the two current selection points;

[0140] Take the two next selection points as the two current selection points, select two next selection points that are adjacent to the two current selection points from the candidate points, and form a quadrilateral with the two current selection points. Repeat this step until there are no candidate points or only one candidate point remains.

[0141] The resulting quadrilateral is divided into two triangles, and when only one candidate point remains, the two next selection points and the remaining selection point are combined to form a triangle, thus obtaining the vertex coordinates of all triangles.

[0142] In this alternative implementation, the drawing point and the two road endpoints can be combined in another way to form multiple triangles that perfectly form a rounded shape. This method is as follows:

[0143] Using the two road endpoints and the drawing point as candidate points, starting from the left and right ends of the arc, select one point from each end as the current selection point. Initially, the two road endpoints are the current selection points. Select two candidate points adjacent to the two current selection points as the next selection points. These two current selection points and the two next selection points form a quadrilateral. Then, use the two next selection points as the two current selection points, and select two new candidate points adjacent to these two current selection points as the new two next selection points. These new two current selection points and the new two next selection points also form a quadrilateral. Repeat the above steps until there are no more candidate points to choose from or only one candidate point remains.

[0144] Each quadrilateral is divided into two triangles. If only one candidate point remains, the last two next-choice points and the remaining candidate point form a triangle. All triangles are triangulations of the rounded-headed shape formed by the arc and the line connecting the two road endpoints. The vertex coordinates of each triangle are then fed into the rendering engine as a set.

[0145] In an optional implementation of this embodiment, the road-end data is determined using the road-end data construction method described above.

[0146] In this optional implementation, the road-side data can be constructed using the method described above. During the construction of the road-side data, the drawing points on the arc can be determined based on the road display level, including the number of drawing points and their location coordinates. These drawing points are the triangulation points.

[0147] The road display level refers to the display level of the road to be displayed on the current map interface, and is related to the current user's map zoom-in and / or zoom-out operations. A correspondence between road display levels and map zoom-in / / or zoom-out ratios can be pre-established, allowing the determination of the road display level based on the current map zoom-in / / or zoom-out ratio when drawing roads in real time.

[0148] To accelerate real-time rendering, the correspondence between different road display levels and the number of rendering points can be predetermined. Information about the rendering points corresponding to different numbers of rendering points on the arc with different equation parameters can also be determined, such as the arc coordinates of the rendering points corresponding to different numbers of rendering points in the elliptical coordinate system of the arc and the road coordinates in the road coordinate system. It can be understood that an arc is the arc between two road endpoints, that is, the endpoints of the arc between those two road endpoints. Since the equation parameters of the arc can be predetermined, at least one rendering point can be determined between the two road endpoints on the arc. Then, based on these two road endpoints, the at least one rendering point, and the equation parameters of the arc, a rounded road end can be drawn at one end of the road to be displayed.

[0149] The road end data of the road to be displayed may include, but is not limited to, the two endpoints of the lane lines on the left and right sides of the road to be displayed, and one or more drawing points on the arc with the two endpoints as endpoints.

[0150] In this embodiment of the disclosure, after determining at least one drawing point on the arc to be drawn at one end of the road to be displayed based on the road display level and the road endpoint, the at least one drawing point and the road endpoint can be associated and stored as the road end data of the road to be displayed, and then stored in the road data of the road to be displayed, so that the end of the road to be displayed can be drawn based on the road end data when displaying the map.

[0151] Other details regarding road-side data can be found in the description of the road-side data construction method above, and will not be repeated here.

[0152] Figures 5A-5C This diagram illustrates the triangulation and road drawing effect according to an embodiment of the present disclosure. Figure 5AAs shown, in order to draw the road connection A of road segment AB as a rounded shape, we can first determine the widening vector A0A1 in the road width direction. This widening vector is obtained by widening the road width by half on both sides in the road axial direction with the road connection A as the midpoint.

[0153] like Figure 5B As shown, assuming there are 4 points to be drawn, namely A2, A3, A4, and A5, in order to draw the arc between A0 and A1 using triangulation, one method is to first sort the points on the arc (including the 4 points and the two endpoints), for example, by sorting them in a counter-clockwise direction on the arc, resulting in the sorted result A0-A2-A4-A5-A3-A1. Starting from A0, traverse each of the sorted points sequentially. For each point traversed, determine all the triangles that the point can form with other points. For example, point A0 can form a triangle A0-A2-A1, and A2 can form triangles with other points such as A2-A0-A1, A2-A1-A3, A2-A4-A3, and so on. After traversing all points, delete the duplicate triangles, and finally obtain the triangle set: A0-A2-A1, A2-A1-A3, A2-A4-A3, A4-A5-A3.

[0154] Another approach is as follows: First, select A0 and A1 as the current selection points. Then, select A2 and A3 as adjacent candidate points of A0 and A1, and determine them as the next selection points. A0, A1, A2, and A3 form a quadrilateral. Next, select A2 and A3 as the new current selection points. Then, select A4 and A5 as adjacent candidate points of A2 and A3, and determine them as the new next selection points. A2, A3, A4, and A5 form another quadrilateral. After this, there are no more candidate points to choose from, and the process ends. This results in two quadrilaterals. Each quadrilateral is further divided into two smaller triangles, resulting in four triangles: A0-A2-A1, A2-A1-A3, A2-A4-A3, and A4-A5-A3.

[0155] By inputting the vertex coordinates of each triangle into the rendering engine, a rendering output can be achieved. Figure 5B The arc segment between A0 and A1 shown gives the road junction A a rounded appearance. The drawn road is as follows: Figure 5C As shown.

[0156] In an optional implementation of this embodiment, the method further includes the following steps:

[0157] Detect user map operations;

[0158] The current display area and map display scale are determined based on the map operations described above;

[0159] The current road to be displayed and the current road display level are determined based on the current display area and the map display scale.

[0160] In this optional implementation, when the map is displayed on the map interface, user map operations, such as map movement, zooming in and out, can be detected in real time. These operations will cause the roads on the map interface to be redrawn. Under map movement operations, new roads need to be drawn, while under map zooming in and out operations, roads of different sizes need to be drawn. In this embodiment, since the drawing of the rounded head shape at the road connection is related to the road display level, after detecting the user's map operation, the local map display area and map display scale can be determined based on the map operation. Based on the map display area, it can be determined which roads need to be drawn, and based on the map display scale, the current road display level can be determined. If the map is zoomed in, the road display level will change, and the rounded head shape at the road connection needs to be redrawn. At this time, the number of drawing points on the arc can be determined based on the new road display level, and then the vertex coordinates of multiple triangles after triangulation of the arc can be determined based on the number of drawing points. Inputting the vertex coordinates of multiple triangles into the rendering engine can achieve the rounded head display effect at the road connection.

[0161] The following are embodiments of the apparatus disclosed herein, which can be used to execute embodiments of the method disclosed herein.

[0162] Figure 6 A structural block diagram of a roadside data construction apparatus according to an embodiment of the present disclosure is shown. This apparatus can be implemented as part or all of an electronic device through software, hardware, or a combination of both. Figure 6 As shown, the apparatus for constructing this road-end data includes:

[0163] The acquisition module 601 is configured to acquire road data and road display level of the road to be displayed; the road data includes two road endpoints on the left and right lane lines of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed;

[0164] The first determining module 602 is configured to determine a drawing point based on the road display level and road endpoints, wherein the drawing point is located on an arc with the two road endpoints as endpoints;

[0165] The storage module 603 is configured to associate and store the road endpoints and drawing points of the road to be displayed as road endpoint data of the road to be displayed.

[0166] In this embodiment, the road end data construction device can be executed on a map display terminal. To achieve a rounded display effect at road junctions, and thus prevent the junctions between two roads from displaying a similar effect... Figure 1 As shown in the embodiment of this disclosure, when rendering a road, an arc is drawn at the road connection between the current road to be displayed and other roads. The arc and the widening vector at the road connection are then triangulated geometrically to form a rounded shape. The rounded shape at the road connection is then drawn based on the triangulation result to achieve the rounded display effect of the road connection.

[0167] The road to be displayed can be one or more roads that need to be drawn on the current map display interface. In this embodiment, the road to be displayed can be one or two roads whose connection points need to be drawn on the current map display interface.

[0168] It should be noted that the roads displayed on the map have a certain width, and the road data on the map can include the widening vector in the width direction of the road connection. This widening vector can be described by its two endpoints and its direction vector. It can be understood that the road data can also only include the endpoints of the road centerline, and the widening vector can be obtained by widening the road in the width direction based on these endpoints.

[0169] In this embodiment of the disclosure, a rounded display effect can be achieved by drawing an arc at the widening vector at the road junction. That is, the widening vector and the arc to be drawn form a rounded shape, with the arc protruding outwards relative to the road at the widening vector. The two endpoints of the widening vector are on this arc. In some embodiments, the arc can be an elliptical arc.

[0170] The equation parameters of the arc, such as the major and minor radii, can be preset. In some embodiments, the arc can be centered at the midpoint of the widening vector at the road junction, with half of the widening vector as the major radius. Of course, it is understood that the center of the arc does not have to be on the widening vector, and the major radius does not have to be half of the widening vector; its center, major radius, and minor radius can be arbitrarily set, as long as the two endpoints of the road to be displayed lie on the arc. In other words, any arc with the two endpoints of the road to be displayed lying on the arc can be used.

[0171] In this embodiment of the disclosure, the road data may include, but is not limited to, two road endpoints on the left and right lane lines of the road to be displayed. The two road endpoints are located at the same end of the road to be displayed, and the line connecting the two road endpoints is the widening vector in the width direction at the connection between the road to be displayed and other roads.

[0172] To achieve a rounded end effect at one end of the road to be displayed, this embodiment employs triangulation. The rounded shape formed by the arc and the extended vector is triangulated, and the resulting triangle data is input into the rendering engine for drawing. It is understood that the more triangles created, i.e., the more triangulation points, the higher the accuracy of the drawn arc. In this embodiment, the drawing accuracy of the arc depends on the road display level. A higher road display level results in higher arc drawing accuracy and a greater number of triangulation points; conversely, a lower road display level results in lower arc drawing accuracy and a smaller number of triangulation points.

[0173] Therefore, this embodiment of the disclosure can determine the drawing points on the arc based on the road display level, including the number of drawing points and their location coordinates. These drawing points are the triangulation points.

[0174] The road display level refers to the display level of the road to be displayed on the current map interface, and is related to the current user's map zoom-in and / or zoom-out operations. A correspondence between road display levels and map zoom-in / / or zoom-out ratios can be pre-established, allowing the determination of the road display level based on the current map zoom-in / / or zoom-out ratio when drawing roads in real time.

[0175] To accelerate real-time rendering, the correspondence between different road display levels and the number of rendering points can be predetermined. Information about the rendering points corresponding to different numbers of rendering points on the arc with different equation parameters can also be determined, such as the arc coordinates of the rendering points corresponding to different numbers of rendering points in the elliptical coordinate system of the arc and the road coordinates in the road coordinate system. It can be understood that an arc is the arc between two road endpoints, that is, the endpoints of the arc between those two road endpoints. Since the equation parameters of the arc can be predetermined, at least one rendering point can be determined between the two road endpoints on the arc. Then, based on these two road endpoints, the at least one rendering point, and the equation parameters of the arc, a rounded road end can be drawn at one end of the road to be displayed.

[0176] In this embodiment of the disclosure, after determining at least one drawing point on the arc to be drawn at one end of the road to be displayed based on the road display level and the road endpoint, the at least one drawing point and the road endpoint can be associated and stored as the road end data of the road to be displayed, and then stored in the road data of the road to be displayed, so that the end of the road to be displayed can be drawn based on the road end data when displaying the map.

[0177] In this embodiment, road data and road display level of the road to be displayed can be obtained. The road data includes at least two road endpoints on the left and right lane lines of the road to be displayed, and the two road endpoints are located at the same end of the road to be displayed. Based on the road display level and the road endpoints, the drawing point of the arc to be drawn at the end of the road to be displayed can be determined, and the road endpoints and the drawing point on the arc are associated and stored as the road end data of the road to be displayed, so that the road to be displayed can be drawn in the above manner based on the road end data. Since the end of the road to be displayed will be drawn into a rounded shape based on the road end data, the problem of gaps appearing at the road connection in the prior art is solved. At the same time, since the rounded shape with different precision corresponding to different road display levels is constructed by geometric means, it is not limited by textures, which can improve the drawing efficiency and reduce the storage memory of vertices.

[0178] In an optional implementation of this embodiment, the first determining module includes:

[0179] The first acquisition submodule is configured to acquire the number of drawing points based on the road display level of the road to be displayed; wherein, different road display levels correspond to different numbers of drawing points;

[0180] The second acquisition module is configured to acquire the equation parameters of the arc and the vector parameters of the road coordinate system corresponding to the two road endpoints;

[0181] The first determining submodule is configured to determine, based on the number of drawing points, the angle between the line connecting each drawing point to the origin of the elliptical arc coordinate system containing the arc and the coordinate axes of the elliptical arc coordinate system.

[0182] The second determining submodule is configured to determine the arc coordinates of the drawing point in the elliptical coordinate system based on the equation parameters of the arc and the included angle.

[0183] The transformation submodule is configured to transform the arc coordinates of the drawing point to the road coordinate system based on the position coordinates of the road endpoint in the road coordinate system, the vector parameters of the road coordinate system, and the arc coordinates of the road endpoint in the elliptical coordinate system, so as to obtain the position coordinates of the drawing point in the road coordinate system.

[0184] In this optional implementation, as described above, the drawing points are the triangulation points used when drawing the rounded shapes at the ends of the roads to be displayed. To improve drawing efficiency, the number of drawing points corresponding to each road display level can be determined offline. The number of drawing points can be adjusted based on the level of detail required for the rounded ends at road junctions. Specifically, it can be determined based on actual needs; for example, if high precision is required for the rounded ends at road junctions, a larger number of drawing points can be set, while if lower precision is required, a smaller number of drawing points can be set.

[0185] In some embodiments, one or more equation parameters of the arc can be preset, which may include, but are not limited to, the major radius, minor radius, and center position of the arc.

[0186] For each road display level, the number of drawing points can be determined, and the arc coordinates of each drawing point on the arc corresponding to the equation parameters of one or more arcs can be defined. These arc coordinates can include the relative position of the drawing point on the arc, such as the angle between the drawing point and the coordinate axes in the elliptical arc coordinate system containing the arc. In some embodiments, the relative position on the arc can be represented based on the elliptical coordinate system containing the arc, where the center of the arc is the origin, the major radius of the arc is the axial coordinate axis, and the minor radius is the radial coordinate axis.

[0187] Given the equation parameters of the arc and the number of drawing points, the required number of drawing points can be selected on the arc between the two road endpoints according to a pre-defined method.

[0188] In some embodiments, the angle between the line connecting each drawing point to the origin of the elliptical arc coordinate system containing the arc and the same coordinate axis of the elliptical arc coordinate system can be determined. This coordinate axis can be an axial coordinate axis or a radial coordinate axis. Based on this angle, the arc coordinates of each drawing point in the elliptical arc coordinate system can be determined. In some embodiments, drawing points can be selected in a manner with equal included angles, that is, drawing points are selected where the two included angles formed by the lines connecting every three adjacent drawing points to the origin are equal. Of course, these included angles can also be unequal, and can be selected according to a certain rule or not, as long as all drawing points are on the arc and between the two road endpoints. Specific settings can be made according to actual needs, and no specific restrictions are imposed here.

[0189] The arc is to be drawn at the road junctions to seamlessly connect with the roads drawn on the map. However, the coordinates of all the data used to draw the roads to be displayed are not in this elliptical coordinate system, but in another known road coordinate system. Therefore, it is necessary to transform the arc coordinates of the drawing point in the elliptical coordinate system to the road coordinate system. Based on the road coordinates of the drawing point in the road coordinate system, triangulation calculations can be performed together with the two road endpoints of the road to be displayed to obtain multiple triangles. The vertex coordinates of these multiple triangles are all coordinates in the road coordinate system, so they can be sent to the rendering engine to draw rounded shapes at the ends of the roads to be displayed on the map.

[0190] To transform the circular coordinates to the road coordinate system containing the two road endpoints of the road to be displayed, we can first obtain the vector parameters of that road coordinate system, namely the axial and radial vectors of the road to be displayed. In map display, the axial vector of the road to be displayed can be aligned with the width direction of the road and parallel to the line connecting the two road endpoints, while the radial vector is aligned with the road direction.

[0191] After obtaining the vector parameters of the road coordinate system, since the road coordinates of the two road endpoints in the road coordinate system are known (which can be directly obtained from the road data of the road to be displayed), and since the two road endpoints are the two endpoints of an arc, their arc coordinates in the elliptical arc coordinate system are also known, the position coordinates of the drawing point in the road coordinate system can be calculated based on the arc coordinates of the two road endpoints, the road coordinates, and the arc coordinates of the drawing point.

[0192] In an optional implementation of this embodiment, the second determining submodule includes:

[0193] The third determining submodule is configured to determine the first coordinate value of the drawing point in the elliptical coordinate system based on the sine or cosine value of the corresponding included angle.

[0194] The solver submodule is configured to solve for the second coordinate value of the drawing point in the elliptical coordinate system based on the first coordinate value and the equation parameters of the arc; wherein the first coordinate value is one of the axial coordinate value and the lateral coordinate value in the elliptical coordinate system, and the second coordinate value is the other of the axial coordinate value and the lateral coordinate value in the elliptical coordinate system.

[0195] In this optional implementation, the first coordinate value of the drawing point can be determined based on the cosine of the angle between the line connecting each drawing point and the origin of the elliptical arc coordinate system and the coordinate axis. The second coordinate value of the drawing point can be solved based on the first coordinate value and the equation parameters of the arc.

[0196] In some embodiments, the first coordinate value of the drawing point can be determined based on the cosine of the angle between the line connecting the drawing point and the origin of the elliptical arc coordinate system and the first coordinate axis, or the first coordinate value of the drawing point can be determined based on the sine of the angle between the line connecting the drawing point and the origin of the elliptical arc coordinate system and the second coordinate axis; the first coordinate value is one of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system, and the second coordinate value is the other of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system.

[0197] Points on an ellipse all follow the equation of the arc. After determining the first coordinate value of the point to be drawn, the second coordinate value can be calculated based on the arc equation and the first coordinate value.

[0198] In an optional implementation of this embodiment, the apparatus further includes:

[0199] The detection module is configured to detect user map operations;

[0200] The second determining module is configured to determine the current display area and map display ratio based on the map operation;

[0201] The third determining module is configured to determine the current road to be displayed and the current road display level based on the current display area and the map display ratio.

[0202] In this optional implementation, when the map is displayed on the map interface, user map operations, such as map movement, zooming in and out, can be detected in real time. These operations will cause the roads on the map interface to be redrawn. Under map movement operations, new roads need to be drawn, while under map zooming in and out operations, roads of different sizes need to be drawn. In this embodiment, since the drawing of the rounded head shape at the road connection is related to the road display level, after detecting the user's map operation, the local map display area and map display scale can be determined based on the map operation. Based on the map display area, it can be determined which roads need to be drawn, and based on the map display scale, the current road display level can be determined. If the map is zoomed in, the road display level will change, and the rounded head shape at the road connection needs to be redrawn. At this time, the number of drawing points on the arc can be determined based on the new road display level, and then the road coordinates of each drawing point on the arc to be drawn can be determined based on the number of drawing points. Then, based on the road coordinates of each drawing point and the two road endpoints, the vertex coordinates of multiple triangles are obtained. Inputting the vertex coordinates of multiple triangles into the rendering engine can realize the rounded head display effect at the road connection.

[0203] A road rendering apparatus according to an embodiment of the present disclosure includes:

[0204] The second acquisition module is configured to acquire road end data of the road to be displayed. The road end data includes two road endpoints and a drawing point of the road to be displayed. The drawing point is located on an arc with the two road endpoints as endpoints.

[0205] The rendering module is configured to render the end of the road to be displayed based on the road end data, so that the end of the road to be displayed is rounded.

[0206] In this embodiment, the road rendering device can be executed on a map display terminal. This is to achieve a rounded display effect at road junctions, thus preventing the junctions between two roads from displaying a circular shape. Figure 1 As shown in the embodiment of this disclosure, when rendering a road, an arc is drawn at the road connection between the current road to be displayed and other roads. The arc and the widening vector at the road connection are then triangulated geometrically to form a rounded shape. The rounded shape at the road connection is then drawn based on the triangulation result to achieve the rounded display effect of the road connection.

[0207] The road to be displayed can be one or more roads that need to be drawn on the current map display interface. In this embodiment, the road to be displayed can be one or two roads whose connection points need to be drawn on the current map display interface.

[0208] It should be noted that the roads displayed on the map have a certain width, and the road data on the map can include the widening vector in the width direction of the road connection. This widening vector can be described by its two endpoints and its direction vector. It can be understood that the road data can also only include the endpoints of the road centerline, and the widening vector can be obtained by widening the road in the width direction based on these endpoints.

[0209] In this embodiment of the disclosure, a rounded display effect can be achieved by drawing an arc at the widening vector at the road junction. That is, the widening vector and the arc to be drawn form a rounded shape, with the arc protruding outwards relative to the road at the widening vector. The two endpoints of the widening vector are on this arc. In some embodiments, the arc can be an elliptical arc.

[0210] The equation parameters of the arc, such as the major and minor radii, can be preset. In some embodiments, the arc can be centered at the midpoint of the widening vector at the road junction, with half of the widening vector as the major radius. Of course, it is understood that the center of the arc does not have to be on the widening vector, and the major radius does not have to be half of the widening vector; its center, major radius, and minor radius can be arbitrarily set, as long as the two endpoints of the road to be displayed lie on the arc. In other words, any arc with the two endpoints of the road to be displayed lying on the arc can be used.

[0211] In this embodiment of the disclosure, the road data may include, but is not limited to, two road endpoints on the left and right lane lines of the road to be displayed. The two road endpoints are located at the same end of the road to be displayed, and the line connecting the two road endpoints is the widening vector in the width direction at the connection between the road to be displayed and other roads.

[0212] To achieve a rounded end effect at one end of the road to be displayed, this embodiment employs triangulation. The rounded shape formed by the arc and the extended vector is triangulated, and the resulting triangle data is input into the rendering engine for drawing. It is understood that the more triangles created, i.e., the more triangulation points, the higher the accuracy of the drawn arc. In this embodiment, the drawing accuracy of the arc depends on the road display level. A higher road display level results in higher arc drawing accuracy and a greater number of triangulation points; conversely, a lower road display level results in lower arc drawing accuracy and a smaller number of triangulation points.

[0213] In some embodiments, the road coordinates of the two road endpoints of the road to be displayed and the road coordinates of at least one drawing point on the arc with the two road endpoints as endpoints can be predetermined and stored in the road data as road end data of the road to be displayed. When drawing the road, the road end data can be extracted from the road data, and an arc with the two road endpoints as the tail endpoints can be drawn based on the two road endpoints and at least one drawing point in the road end data, thereby creating a rounded display effect at the ends of the road to be displayed.

[0214] In this embodiment, road end data of a road to be displayed can be obtained, and then the end of the road to be displayed can be drawn into a rounded shape based on the road end data. The road end data may include two road endpoints and a drawing point, which is located on an arc with the two road endpoints as endpoints. Roads drawn in this manner solve the problem of gaps at road connections in existing technologies because the end of the road to be displayed is drawn into a rounded shape based on the road end data. Furthermore, since different rounded shapes with different precisions corresponding to different road display levels are constructed geometrically, it is not limited by texture mapping, thus improving drawing efficiency and reducing vertex storage memory.

[0215] In an optional implementation of this embodiment, the rendering module includes:

[0216] The combination submodule is configured to combine the two road endpoints and the drawing point as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints to form the vertex coordinates of multiple triangles.

[0217] A drawing submodule is configured to draw the arc between the two road endpoints of the road to be displayed based on the vertex coordinates of the plurality of triangles.

[0218] In this optional implementation, an arc can be drawn based on the two road endpoints and the drawing point in the road end data, with the two road endpoints as its endpoints, so that the drawing point associated with the two road endpoints lies on the arc. After the arc is drawn, a rounded shape can be formed at the end of the road to be displayed.

[0219] To draw an arc, the arc can be triangulated. In this embodiment, the two road endpoints and each drawing point on the arc can be used as triangulation points. These triangulation points are then combined to form multiple triangles. These multiple triangles can be combined to form a surface formed by the line connecting the arc and the two road endpoints. The vertex coordinates of each triangle are then input into the rendering engine. The rendering engine can draw these multiple triangles and finally render the arc.

[0220] In an optional implementation of this embodiment, the combined submodule includes:

[0221] The first setting submodule is configured to use the two road endpoints and the drawing point as candidate points;

[0222] The traversal submodule is configured to traverse the candidate points in either a counterclockwise or clockwise direction along the arc, and obtain the triangle that the currently traversed candidate point can form with other candidate points.

[0223] The removal submodule is configured to, after traversing all the candidate points, remove triangles with overlapping coverage areas, leaving triangles that can form the rounded shape, and obtain the vertex coordinates of the remaining triangles.

[0224] In this optional implementation, after determining the road coordinates of the drawing points, the arc can be triangulated. The triangulation process can be viewed as dividing the rounded shape formed by the arc and the lines connecting the two road endpoints into multiple triangles, where the vertices of these triangles are points on the arc. In this embodiment, the triangulation points for triangulating the arc can include the two road endpoints and each drawing point. The purpose of triangulation is to divide the rounded shape into multiple triangles, which are then rendered by the rendering engine. The final rendered triangles can then form the rounded shape.

[0225] In this embodiment, the road coordinates of the triangulation points on the arc are determined. Multiple triangulation triangles can be obtained by combining these triangulation points into triangles. In some embodiments, the triangulation points (i.e., the drawing points and the two road endpoints) can be used as candidate points and sorted according to the counterclockwise or clockwise direction of the arc. Then, the candidate points (i.e., the drawing points and the two road endpoints) are traversed in sorted order. For each candidate point, the triangle formed by the candidate point and other candidate points is determined and added to the triangle set. After traversing all candidate points, duplicate triangles in the triangle set can be deleted, and triangles that partially overlap with other triangles can be removed, retaining the triangles that can form a rounded shape as the multiple triangles obtained after triangulation. The coordinates of the three vertices of each triangle are recorded as a group and sent to the rendering engine.

[0226] In an optional implementation of this embodiment, the combined submodule includes:

[0227] The second setting submodule is configured to use the two road endpoints and the drawing point as candidate points;

[0228] The first selection submodule is configured to take the two road endpoints as two symmetrical current selection points, select two next selection points that are adjacent to the two current selection points respectively from the candidate points, and form a quadrilateral with the two current selection points;

[0229] The second selection submodule is configured to take the two next selection points as two current selection points, select two next selection points that are adjacent to the two current selection points from the candidate points, form a quadrilateral with the two current selection points, and repeat this step until there are no candidate points or only one candidate point remains.

[0230] The partitioning submodule is configured to divide the obtained quadrilateral into two triangles, and when only one candidate point remains, to form a triangle with the two next selection points and the remaining selection point to obtain the vertex coordinates of all triangles.

[0231] In this alternative implementation, the drawing point and the two road endpoints can be combined in another way to form multiple triangles that perfectly form a rounded shape. This method is as follows:

[0232] Using the two road endpoints and the drawing point as candidate points, starting from the left and right ends of the arc, select one point from each end as the current selection point. Initially, the two road endpoints are the current selection points. Select two candidate points adjacent to the two current selection points as the next selection points. These two current selection points and the two next selection points form a quadrilateral. Then, use the two next selection points as the two current selection points, and select two new candidate points adjacent to these two current selection points as the new two next selection points. These new two current selection points and the new two next selection points also form a quadrilateral. Repeat the above steps until there are no more candidate points to choose from or only one candidate point remains.

[0233] Each quadrilateral is divided into two triangles. If only one candidate point remains, the last two next-choice points and the remaining candidate point form a triangle. All triangles are triangulations of the rounded-headed shape formed by the arc and the line connecting the two road endpoints. The vertex coordinates of each triangle are then fed into the rendering engine as a set.

[0234] In an optional implementation of this embodiment, the road-end data is determined using the road-end data construction method described above.

[0235] In this optional implementation, the road-side data can be constructed using the method described above. During the construction of the road-side data, the drawing points on the arc can be determined based on the road display level, including the number of drawing points and their location coordinates. These drawing points are the triangulation points.

[0236] The road display level refers to the display level of the road to be displayed on the current map interface, and is related to the current user's map zoom-in and / or zoom-out operations. A correspondence between road display levels and map zoom-in / / or zoom-out ratios can be pre-established, allowing the determination of the road display level based on the current map zoom-in / / or zoom-out ratio when drawing roads in real time.

[0237] To accelerate real-time rendering, the correspondence between different road display levels and the number of rendering points can be predetermined. Information about the rendering points corresponding to different numbers of rendering points on the arc with different equation parameters can also be determined, such as the arc coordinates of the rendering points corresponding to different numbers of rendering points in the elliptical coordinate system of the arc and the road coordinates in the road coordinate system. It can be understood that an arc is the arc between two road endpoints, that is, the endpoints of the arc between those two road endpoints. Since the equation parameters of the arc can be predetermined, at least one rendering point can be determined between the two road endpoints on the arc. Then, based on these two road endpoints, the at least one rendering point, and the equation parameters of the arc, a rounded road end can be drawn at one end of the road to be displayed.

[0238] The road end data of the road to be displayed may include, but is not limited to, the two endpoints of the lane lines on the left and right sides of the road to be displayed, and one or more drawing points on the arc with the two endpoints as endpoints.

[0239] In this embodiment of the disclosure, after determining at least one drawing point on the arc to be drawn at one end of the road to be displayed based on the road display level and the road endpoint, the at least one drawing point and the road endpoint can be associated and stored as the road end data of the road to be displayed, and then stored in the road data of the road to be displayed, so that the end of the road to be displayed can be drawn based on the road end data when displaying the map.

[0240] Other details regarding road-side data can be found in the description of the road-side data construction method above, and will not be repeated here.

[0241] Figure 7 This is a schematic diagram of the structure of an electronic device suitable for implementing a method for constructing road end data and / or a road rendering method according to an embodiment of the present disclosure.

[0242] like Figure 7 As shown, the electronic device 700 includes a processing unit 701, which can be implemented as a CPU, GPU, FPGA, NPU, or other processing unit. The processing unit 701 can execute various processes according to any of the methods described above in this disclosure, based on a program stored in the read-only memory (ROM) 702 or a program loaded from the storage portion 708 into the random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0243] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0244] In particular, according to embodiments of this disclosure, any of the methods described above in the embodiments of this disclosure can be implemented as a computer software program. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing any of the methods in the embodiments of this disclosure. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711.

[0245] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0246] The units or modules described in the embodiments of this disclosure can be implemented in software or hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.

[0247] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the apparatus described in the above embodiments; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs that are used by one or more processors to perform the methods described in this disclosure.

[0248] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

Claims

1. A method of constructing road end data, wherein, include: Obtain the road data and road display level of the road to be displayed; The road data includes two road endpoints on the lane lines on the left and right sides of the road to be displayed. The two road endpoints are located at the same end of the road to be displayed, and the line connecting the two road endpoints is the widening vector in the width direction at the connection between the road to be displayed and other roads. Based on the road display level and road endpoints, a drawing point is determined, and the drawing point is located on an arc with the two road endpoints as its endpoints; The road endpoints and drawing points of the road to be displayed are associated and stored as road end data of the road to be displayed. The road end data is used to render the ends of the road to be displayed, so that the ends of the road to be displayed are rounded.

2. The method according to claim 1, wherein, Based on the road display level and road endpoints, determine the drawing points, including: The number of drawing points is obtained based on the road display level of the road to be displayed; different road display levels correspond to different numbers of drawing points. Obtain the equation parameters of the arc and the vector parameters of the road coordinate system corresponding to the two road endpoints; Based on the number of drawing points, the angle between the line connecting each drawing point to the origin of the elliptical coordinate system where the arc is located and the coordinate axis of the elliptical coordinate system. The arc coordinates of the drawing point in the elliptical coordinate system are determined based on the equation parameters of the arc and the included angle. Based on the position coordinates of the road endpoint in the road coordinate system, the vector parameters of the road coordinate system, and the arc coordinates of the road endpoint in the elliptical coordinate system, the arc coordinates of the drawing point are transformed to the road coordinate system to obtain the position coordinates of the drawing point in the road coordinate system.

3. The method according to claim 2, wherein, Determining the arc coordinates of the drawing point in the elliptical coordinate system based on the equation parameters of the arc and the included angle includes: Based on the sine or cosine value of the corresponding included angle, determine the first coordinate value of the drawing point in the elliptical coordinate system; Based on the first coordinate value and the equation parameters of the arc, the second coordinate value of the drawing point in the elliptical coordinate system is solved; wherein, the first coordinate value is one of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system, and the second coordinate value is the other of the axial coordinate value and the horizontal coordinate value in the elliptical coordinate system.

4. The method according to any one of claims 1-3, wherein, The method further includes: Detect user map operations; The current display area and map display scale are determined based on the map operations described above; The current road to be displayed and the current road display level are determined based on the current display area and the map display scale.

5. A road rendering method, the method comprising: Obtain road end data of the road to be displayed, wherein the road end data is constructed based on the method described in any one of claims 1-4, and the road end data includes two road endpoints and a drawing point of the road to be displayed, wherein the drawing point is located on an arc with the two road endpoints as endpoints; The end of the road to be displayed is rendered based on the road end data, so that the end of the road to be displayed is rounded.

6. The method according to claim 5, wherein, Rendering the end of the road to be displayed based on the road end data includes: The two road endpoints and the drawing point are used as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints, and combined to form the vertex coordinates of multiple triangles; Based on the vertex coordinates of the plurality of triangles, the arc is drawn between the two road endpoints of the road to be displayed.

7. The method according to claim 6, wherein, Using the two road endpoints and the drawing point as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints, multiple triangle vertex coordinates are formed, including: The two road endpoints and the drawn point are used as candidate points; Traverse the candidate points in either the counterclockwise or clockwise direction of the arc to obtain the triangle that the currently traversed candidate point can form with other candidate points; After traversing all the candidate points, triangles with overlapping coverage areas are removed, leaving triangles that can form the rounded shape, and the vertex coordinates of the remaining triangles are obtained.

8. The method according to claim 6, wherein, Using the two road endpoints and the drawing point as the triangulation points of the rounded shape formed by the widening vector between the arc and the two road endpoints, multiple triangle vertex coordinates are formed, including: The two road endpoints and the drawn point are used as candidate points; Using the two road endpoints as two symmetrical current selection points, select two next selection points that are adjacent to the two current selection points respectively from the candidate points, forming a quadrilateral with the two current selection points; Take the two next selection points as the two current selection points, select two next selection points that are adjacent to the two current selection points from the candidate points, and form a quadrilateral with the two current selection points. Repeat this step until there are no candidate points or only one candidate point remains. The resulting quadrilateral is divided into two triangles, and when only one candidate point remains, the two next selection points and the remaining selection point are combined to form a triangle, thus obtaining the vertex coordinates of all triangles.

9. A device for constructing road-end data, wherein, include: The acquisition module is configured to acquire road data and road display level of the road to be displayed. The road data includes two road endpoints on the lane lines on the left and right sides of the road to be displayed. The two road endpoints are located at the same end of the road to be displayed, and the line connecting the two road endpoints is the widening vector in the width direction at the connection between the road to be displayed and other roads. The first determining module is configured to determine a drawing point based on the road display level and road endpoints, wherein the drawing point is located on an arc with the two road endpoints as endpoints; The storage module is configured to associate and store the road endpoints and drawing points of the road to be displayed as road end data of the road to be displayed. The road end data is used to render the ends of the road to be displayed, so that the ends of the road to be displayed are rounded.

10. An electronic device, wherein, The method includes a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the method of any one of claims 1-8.

11. A computer program product comprising computer instructions, wherein, When executed by a processor, the computer instructions implement the method described in any one of claims 1-8.