Character processing method and device for electronic map and electronic equipment

By converting the reference mark position, vector along the line and vertical vectors of the marker words to the NDC coordinate system in the three-dimensional electronic map, the problem of point-of-view projection is solved, and the clear display of marker words and the improvement of work efficiency is achieved.

CN119850818APending Publication Date: 2025-04-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311346757.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-17
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

In three-dimensional electronic maps, perspective projection causes the labeled text at distant locations to be too small and cannot be distinguished, affecting the work efficiency.

Method used

By determining the reference mark position, vector along line and vertical vector of the marker word in the world coordinate system, and converting it to the normalized device coordinate NDC coordinate system, screen vertex calculation is performed to render the marker word to avoid the influence of depth values.

Benefits of technology

This makes the size of the rendered labeled characters not affected by distance and is clearly distinguishable, improving the efficiency of relevant workers in performing operations based on labeled characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119850818A_ABST
    Figure CN119850818A_ABST
Patent Text Reader

Abstract

The invention provides a word processing method and device for an electronic map, electronic equipment, a computer readable storage medium and a computer program product, and can be applied to the field of maps. The method comprises the following steps: acquiring a line in an electronic map and a marking word corresponding to the line; determining a line vector in the world coordinate system according to the reference marking position of the marking word on the line, and determining a vertical vector vertical to the line vector; converting the reference labeling position, the line vector and the vertical vector of the labeling word in the world coordinate system into a normalized equipment coordinate NDC coordinate system; performing screen vertex calculation according to the reference labeling position, the line vector and the vertical vector of the labeling word in the NDC coordinate system to obtain the vertex position of the labeling word in the screen; and rendering the annotation word according to the vertex position of the annotation word in the screen. According to the method and the device, the size of the rendered annotation word cannot be influenced by far and near distances, and the efficiency of performing operation according to the annotation word by related operators can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to map technology, and in particular to a word processing method, device, electronic device, computer-readable storage medium and computer program product for an electronic map. Background Art

[0002] In 3D application scenarios, in order to allow the observer to see the depth and three-dimensionality of objects on a two-dimensional plane, perspective projection is generally selected. Perspective projection is a projection method that simulates the perspective of objects in the real world. The conversion between world coordinate units (meter) and pixels (pixel) is performed through meters per pixel (meterPerPixel). Since the projection matrix in perspective projection affects the coordinate calculation, objects in the distance will appear smaller than nearby objects in the final display.

[0003] For three-dimensional electronic maps, it may involve attribute annotation of the lines in the electronic map. If perspective projection is performed according to the solution provided by the relevant technology, the annotation text displayed after projection will have an effect of being larger when near and smaller when far away, that is, the annotation text at a farther position is too small, making it impossible to distinguish, thereby affecting the work efficiency of the relevant operators. Summary of the invention

[0004] The present application provides a word processing method, device, electronic device, computer-readable storage medium and computer program product for an electronic map, which can make the rendered annotation words clear and legible without being affected by the distance, thereby improving the efficiency of relevant operators in performing operations based on the annotation words.

[0005] The technical solution of this application is implemented as follows:

[0006] The present application provides a word processing method for an electronic map, comprising:

[0007] Obtaining a route in an electronic map and an annotation word corresponding to the route;

[0008] Determine a line vector according to the reference marking position of the marking word on the line in the world coordinate system, and determine a perpendicular vector perpendicular to the line vector;

[0009] Convert the reference mark position, along-line vector and vertical vector of the mark word in the world coordinate system to the normalized device coordinate NDC coordinate system;

[0010] Calculate the screen vertex according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word on the screen;

[0011] The annotation word is rendered according to the vertex position of the annotation word on the screen.

[0012] The present application provides a word processing device for an electronic map, comprising:

[0013] An acquisition module, used to acquire a route in an electronic map and an annotation word corresponding to the route;

[0014] A determination module, used to determine the along-line vector according to the reference marking position of the marking word on the line in the world coordinate system, and determine a perpendicular vector perpendicular to the along-line vector;

[0015] A conversion module, used for converting the reference annotation position, the line vector and the vertical vector of the annotation word in the world coordinate system into the normalized device coordinate NDC coordinate system;

[0016] A calculation module, used for calculating the screen vertex according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word on the screen;

[0017] A rendering module is used to render the annotation word according to the vertex position of the annotation word on the screen.

[0018] In the above scheme, the calculation module is also used to: perform NDC vertex calculation according to the base annotation position, along-line vector and vertical vector of the annotation character in the NDC coordinate system to obtain the vertex position of the annotation character in the NDC coordinate system; perform position conversion processing on the vertex position of the annotation character in the NDC coordinate system according to the screen resolution to obtain the vertex position of the annotation character on the screen.

[0019] In the above scheme, the calculation module is also used for: performing vector update processing on the along-line vector of the annotation word in the NDC coordinate system according to the word size of the annotation word to obtain an updated along-line vector; performing vector update processing on the vertical vector of the annotation word in the NDC coordinate system according to the word size of the annotation word to obtain an updated vertical vector; performing NDC vertex calculation according to the base annotation position of the annotation word in the NDC coordinate system, the updated along-line vector and the updated vertical vector to obtain the vertex position of the annotation word in the NDC coordinate system.

[0020] In the above scheme, the character size of the annotation character includes the character width and the character height; the calculation module is also used to: perform component updating processing on the components of the along-line vector of the annotation character in the NDC coordinate system on the x-axis according to the character width of the annotation character, so as to obtain the updated components of the along-line vector on the x-axis; perform component updating processing on the components of the along-line vector of the annotation character in the NDC coordinate system on the y-axis according to the character width of the annotation character, so as to obtain the updated components of the along-line vector on the y-axis; perform component updating processing on the components of the vertical vector of the annotation character in the NDC coordinate system on the x-axis according to the character height of the annotation character, so as to obtain the updated components of the vertical vector on the x-axis; perform component updating processing on the components of the vertical vector of the annotation character in the NDC coordinate system on the y-axis according to the character height of the annotation character, so as to obtain the updated components of the vertical vector on the y-axis.

[0021] In the above scheme, the vertex positions of the annotation character in the NDC coordinate system include a first vertex position, a second vertex position, a third vertex position and a fourth vertex position used to constitute a rectangular area; the calculation module is also used to: determine the base annotation position of the annotation character in the NDC coordinate system as the first vertex position; move from the base annotation position of the annotation character in the NDC coordinate system according to the along-line vector to obtain the second vertex position; move from the base annotation position of the annotation character in the NDC coordinate system according to the vertical vector to obtain the third vertex position; move from the second vertex position in the NDC coordinate system according to the vertical vector to obtain the fourth vertex position; or, move from the third vertex position in the NDC coordinate system according to the along-line vector to obtain the fourth vertex position.

[0022] In the above scheme, the determination module is also used to: convert the line from the world coordinate system to the screen; perform position selection processing on multiple line positions of the line on the screen to obtain the base marking position of the annotation characters on the line on the screen; convert the base marking position of the annotation characters on the line on the screen to the world coordinate system to obtain the base marking position of the annotation characters on the line in the world coordinate system.

[0023] In the above scheme, the determination module is also used to: calculate the length of the line according to multiple line positions of the line on the screen to obtain the line length of the line on the screen; calculate the reference marking position of marking the mark word to the line on the screen according to the line length of the line on the screen and the width of the mark word.

[0024] In the above scheme, there are multiple annotation characters; the determination module is also used to: summarize the character widths corresponding to the multiple annotation characters to obtain the total width; calculate the reference marking position for marking the first annotation character on the line on the screen according to the line length and the total width of the line on the screen; calculate the reference marking position for marking other annotation characters on the screen according to the reference marking position for marking the first annotation character on the line on the screen and the character widths corresponding to the multiple annotation characters.

[0025] In the above scheme, the conversion module is also used to: move the base marking position of the annotation character in the world coordinate system according to the along-line vector to obtain the along-line position; move the base marking position of the annotation character in the world coordinate system according to the vertical vector to obtain the vertical position; convert the base marking position, along-line position and vertical position of the annotation character in the world coordinate system to the NDC coordinate system; determine the vector from the base marking position of the annotation character to the along-line position in the NDC coordinate system as the along-line vector in the NDC coordinate system; determine the vector from the base marking position of the annotation character to the vertical position in the NDC coordinate system as the vertical vector in the NDC coordinate system.

[0026] The present application provides an electronic device, including:

[0027] A memory for storing executable instructions;

[0028] The processor is used to implement the word processing method of the electronic map provided by the present application when executing the executable instructions stored in the memory.

[0029] The present application provides a computer-readable storage medium storing executable instructions for causing a processor to execute the instructions to implement the word processing method of the electronic map provided by the present application.

[0030] The present application provides a computer program product, which includes executable instructions for causing a processor to execute and implement the word processing method of the electronic map provided by the present application.

[0031] This application has the following beneficial effects:

[0032] For the annotation characters that need to be marked on the lines in the electronic map, the present application first determines the base annotation position, along-line vectors and vertical vectors of the annotation characters in the world coordinate system, and then converts the base annotation position, along-line vectors and vertical vectors of the annotation characters in the world coordinate system to the NDC coordinate system to calculate the vertex position of the annotation characters on the screen. Due to the characteristics of the NDC coordinate system, the depth value (z value) is not considered when converting from the NDC coordinate system to the screen. Therefore, the size of the annotation characters finally rendered will not be affected by the distance, so that the annotation characters are clearly distinguishable when displayed, thereby improving the efficiency of relevant operators in performing operations based on the annotation characters. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0034] Figure 1 It is a schematic diagram of the architecture of the word processing system of the electronic map provided in the embodiment of the present application;

[0035] Figure 2 is a structural diagram of a terminal device provided in an embodiment of the present application;

[0036] Figure 3A It is a flowchart of a word processing method for an electronic map provided in an embodiment of the present application;

[0037] Figure 3B is another flowchart of the word processing method of the electronic map provided in the embodiment of the present application;

[0038] Figure 3C is another flowchart of the word processing method of the electronic map provided in the embodiment of the present application;

[0039] Figure 3D is another flowchart of the word processing method of the electronic map provided in the embodiment of the present application;

[0040] Figure 4 It is a schematic diagram of the along-line vector and the perpendicular vector of the annotated word in the world coordinate system provided by the embodiment of the present application;

[0041] Figure 5 It is a schematic diagram of the lines and the marked words in the screen provided in the embodiment of the present application;

[0042] Figure 6 is another flowchart of the word processing method of the electronic map provided in the embodiment of the present application;

[0043] Figure 7 is a schematic diagram of the vertex position of the annotation word provided in the embodiment of the present application;

[0044] Figure 8 This is a schematic diagram of an electronic map rendered by the word processing method for an electronic map provided by an embodiment of the present application. DETAILED DESCRIPTION

[0045] To make the objectives, technical solutions, and advantages of this application clearer, the following will further describe this application in detail with reference to the accompanying drawings. The described embodiments should not be construed as limitations on this application. All other embodiments obtained by those of ordinary skill in the art without creative efforts fall within the scope of protection of this application.

[0046] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments. However, it can be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict. In the following description, the term "a plurality" refers to at least two.

[0047] In the following description, the terms "first / second / third / fourth" are only used to distinguish similar objects and do not represent a specific order for the objects. It can be understood that "first / second / third / fourth" can be interchanged in a specific order or sequence when permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0049] Before further elaborating on the embodiments of this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are subject to the following explanations.

[0050] 1) Electronic map: That is, a digital map, which is a map stored and retrieved digitally using computer technology. In the embodiments of this application, the electronic map refers to a three-dimensional electronic map, which contains lines and annotation words that need to be marked on the lines.

[0051] 2) Line: Generally refers to various geographical elements presented in the form of lines in the electronic map, such as lanes, sidewalks, and protective line facilities.

[0052] 3) Annotation word: The text used to annotate the attributes of a line. One or more annotation words can form an annotation text with a specific meaning, such as "marking line", etc. Among them, the annotation text "marking line" includes the annotation word "mark" and the annotation word "line".

[0053] 4) Coordinate system: The embodiments of the present application mainly involve a world coordinate system, a camera coordinate system, a clipping coordinate system, a normalized device coordinate (NDC) coordinate system, and a pixel coordinate system, which will be described separately below.

[0054] World coordinate system: refers to a coordinate system that wraps the entire world (such as an electronic map). The world coordinate system is also called the global coordinate system (a set of coordinate systems shared by all objects) or the absolute coordinate system (which does not change with viewing angle or other factors).

[0055] Camera coordinate system: corresponds to a coordinate system with the camera as the origin and the camera focus direction as the positive direction of the Z axis. This coordinate system is established for the need to obtain relative coordinates with the observer (player or camera) as the reference origin. The position information of a static model in the camera space coordinate system will change with the movement and rotation of the camera.

[0056] Clipping coordinate system: It is the spatial coordinate system obtained after the camera coordinate system is transformed by the projection matrix. In the clipping coordinate system, x, y, z are used to define the position of a 3D point, and the w component is used for perspective division. The value range of the point is x, y, z∈[-w,w]. Coordinates outside the range will be discarded during the clipping process, so it is called the clipping coordinate system.

[0057] NDC coordinate system: It is obtained by dividing the four-dimensional coordinates in the clipping coordinate system by the w component. This process is called perspective division. After perspective division, the conversion of coordinates from four-dimensional space to three-dimensional space is completed. The NDC coordinate system is a three-dimensional coordinate system that is independent of the device platform. For example, for the same object, no matter what screen resolution the device uses, the value in the NDC coordinate system is the same.

[0058] Pixel coordinate system: also known as screen space coordinate system, is a two-dimensional plane coordinate system, and the coordinate range is consistent with the screen resolution.

[0059] 5) MVP transformation matrix: refers to a matrix transformation used in computer graphics to convert a three-dimensional model to a two-dimensional screen display. It includes the product of three matrices: the model transformation matrix (Model Matrix), the view transformation matrix (View Matrix) and the projection transformation matrix (Projection Matrix). The M matrix transforms the three-dimensional model from the model space to the world space, the V matrix transforms the model in the world space to the observer's perspective, and the P matrix converts the three-dimensional coordinates in the view space to the two-dimensional screen coordinates. In the embodiment of the present application, the conversion (transformation) between different coordinate systems can be achieved based on the MVP transformation matrix.

[0060] 6) Central Processing Unit (CPU): It is the core component of the computer responsible for reading instructions, decoding instructions and executing instructions.

[0061] 7) Graphics Processing Unit (GPU): It is a processor dedicated to image and graphics related computing. It converts geometric shapes into final pixel images by executing various graphics algorithms and rendering pipelines. GPU can use shaders to replace fixed rendering pipelines to achieve image rendering. Shaders mainly include vertex shaders and pixel shaders. Vertex shaders are mainly responsible for computing the geometric relationship of vertices, while pixel shaders are also called fragment shaders, which are mainly responsible for calculating fragment colors, etc.

[0062] The embodiments of the present application provide a word processing method, device, electronic device, computer-readable storage medium, and computer program product for an electronic map, which can make the rendered annotation words clear and legible without being affected by the distance, thereby improving the efficiency of relevant operators in performing operations based on the annotation words. The following describes an exemplary application of the electronic device provided by the embodiments of the present application. The electronic device provided by the embodiments of the present application can be implemented as various types of terminal devices or as a server.

[0063] See also Figure 1 , Figure 1 It is a schematic diagram of the architecture of the word processing system 100 of the electronic map provided in an embodiment of the present application. The terminal device 400 is connected to the server 200 via the network 300, wherein the network 300 may be a wide area network or a local area network, or a combination of the two.

[0064] In some embodiments, taking the electronic device as a terminal device as an example, the word processing method of the electronic map provided in the embodiment of the present application can be implemented by the terminal device. For example, the terminal device 400 obtains the relevant data of the electronic map from the local or server 200, including the line and the annotation word corresponding to the line. Then, the terminal device 400 determines the line vector according to the reference annotation position of the annotation word on the line in the world coordinate system, and determines the vertical vector perpendicular to the line vector; the reference annotation position, the line vector and the vertical vector of the annotation word in the world coordinate system are converted to the normalized device coordinate NDC coordinate system; the screen vertex calculation is performed according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system, and the vertex position of the annotation word on the screen of the terminal device 400 is obtained; according to the vertex position of the annotation word on the screen, the annotation word is rendered to the screen of the terminal device 400. In addition, the line can also be rendered to the screen of the terminal device 400. The embodiment of the present application does not limit the rendering method of the line. For example, multiple line positions of the line in the world coordinate system can be input into the shader for rendering. In this way, relevant operating personnel can perform work processing according to the image (i.e., electronic map) displayed on the screen of the terminal device 400. The embodiment of the present application does not limit the method of job processing, such as checking and correcting the corresponding route according to the marked words, or checking and correcting the marked words themselves.

[0065] As an example, in Figure 1 FIG. 4 shows an electronic map 410 displayed on the screen of a terminal device 400 . The electronic map 410 includes two routes and a label on each route.

[0066] In some embodiments, the word processing method of the electronic map provided in the embodiments of the present application can also be implemented by the terminal device and the server in collaboration. For example, the server 200 can obtain the rendering instruction of the electronic map sent by the terminal device 400, and the server 200 responds to the rendering instruction and obtains the relevant data of the electronic map from the database or other storage location, including the lines and the annotation words corresponding to the lines. Then, the server 200 obtains the rendered image (including the lines and the annotation words marked on the lines) after a series of processing, and the server 200 sends the rendered image to the terminal device 400 to display the image on the screen of the terminal device 400, such as Figure 1 The electronic map 410 is shown. In this way, the computing power of the server 200 can be used to achieve rendering, improve rendering efficiency, and also save local computing resources of the terminal device 400.

[0067] In some embodiments, the terminal device 400 or the server 200 can implement the method provided in the embodiments of the present application by running a computer program. For example, the computer program can be a native program or software module in the operating system; it can be a native application (APP, Application), that is, a program that needs to be installed in the operating system to run; it can also be a small program, that is, a program that can be run only after being downloaded to a browser environment; it can also be a small program that can be embedded in any APP, wherein the small program can be controlled to run or closed by the user. In short, the above-mentioned computer program can be an application, module or plug-in in any form.

[0068] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal device 400 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart TV, a smart watch, etc., but is not limited thereto. The terminal device and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0069] Taking the electronic device provided in the embodiment of the present application as a terminal device as an example, it can be understood that in the case where the electronic device is a server, Figure 2 Parts of the structure shown in FIG. 1 (such as a user interface, a presentation module, and an input processing module) may be omitted. Figure 2 , Figure 2 is a schematic diagram of the structure of a terminal device 400 provided in an embodiment of the present application, Figure 2 The terminal device 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the terminal device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not shown in FIG. Figure 2 Various buses are labeled as bus system 440 .

[0070] Processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0071] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.

[0072] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.

[0073] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.

[0074] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0075] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0076] A network communication module 452, for reaching other computing devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Authentication (WiFi), and Universal Serial Bus (USB);

[0077] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);

[0078] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.

[0079] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 A word processing device 455 of an electronic map stored in a memory 450 is shown, which may be software in the form of a program or a plug-in, including the following software modules: an acquisition module 4551, a determination module 4552, a conversion module 4553, a calculation module 4554, and a rendering module 4555. These modules are logical, and therefore may be arbitrarily combined or further split according to the functions implemented. The functions of each module will be described below.

[0080] The word processing method of the electronic map provided by the embodiment of the present application will be explained in combination with the exemplary application and implementation of the electronic device provided by the embodiment of the present application.

[0081] See also Figure 3A , Figure 3A is a flowchart of a word processing method for an electronic map provided in an embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.

[0082] In step 101, routes in an electronic map and annotations corresponding to the routes are obtained.

[0083] Here, the relevant data of the electronic map is obtained, including the route and the annotation words that need to be marked on the route. Among them, the route refers to the geographical elements represented by the shape of the line, such as lanes, protective line facilities, sidewalks, etc.; the annotation words are used to mark the route to explain the route attributes. One or more annotation words can constitute an annotation text with a specific meaning, such as "road", "marking line", "county road", etc.

[0084] It is worth noting that the embodiment of the present application does not limit the number of routes in the electronic map, which can be one or more. Each route in the electronic map can correspond to a label, or some routes in the electronic map may not correspond to a label, that is, no labeling is required. The starting position and the end position of the route can be arbitrarily defined according to the actual application scenario. For example, the route can refer to a certain road section or a combination of multiple continuous road sections.

[0085] It is worth noting that obtaining the route in this step refers to obtaining the position information of the route in the world coordinate system, wherein the route can be represented by a string of points, and therefore, the position information of the route in the world coordinate system may include the route positions of multiple position points on the string of points representing the route, that is, multiple route positions of the route in the world coordinate system have been predetermined; obtaining the marked words in this step refers to obtaining the words that need to be marked on the line, and it can be understood that for a route, the words that need to be marked on it can be one or more.

[0086] In step 102, an along-line vector is determined in the world coordinate system according to the reference marking position of the marking word on the line, and a perpendicular vector perpendicular to the along-line vector is determined.

[0087] Since multiple line positions of the line in the world coordinate system have been determined, the base marking position of the annotation word on the line in the world coordinate system can be determined according to the multiple line positions of the line in the world coordinate system. For example, according to a preset marking strategy, a line position can be selected from the multiple line positions of the line in the world coordinate system as the base marking position of the annotation word on the line.

[0088] Considering that the reference marking position in the world coordinate system is only the position of a point, it is impossible to accurately locate the annotation characters. Therefore, at the reference marking position of the annotation characters in the world coordinate system, the along-line vector of the annotation characters along the line and the vertical vector perpendicular to the along-line vector are further determined. In this way, on the one hand, the area used to present the annotation characters can be accurately located according to the reference marking position of the annotation characters in the world coordinate system, the along-line vector and the vertical vector. The area can be a rectangular area. Correspondingly, in this case, the determined reference marking position can be the position of a vertex in the rectangular area. On the other hand, the effect of along-line marking can also be achieved in the final rendering, so that relevant operators can accurately know the correspondence between the annotation characters and the line.

[0089] It is worth noting that the inline vector and the vertical vector of the annotation word in the world coordinate system both start from the base annotation position of the annotation word; the inline vector and the vertical vector of the annotation word in the world coordinate system can both be unit vectors with a modulus of 1.

[0090] In some embodiments, the above-mentioned determination of the along-line vector according to the reference marking position of the annotation character on the line in the world coordinate system and determination of the vertical vector perpendicular to the along-line vector can be achieved in the following manner: determining the along-line vector according to the tangent of the line at the reference marking position of the annotation character in the world coordinate system; rotating the along-line vector in the world coordinate system to obtain the vertical vector in the world coordinate system.

[0091] Here, the tangent of the line at the reference annotation position of the annotation character in the world coordinate system can be determined, and a direction can be set for the undirected tangent to obtain a line vector. It should be noted that either of the two directions can be set for the tangent. Taking the tangent with endpoints A and B as an example, the above two directions refer to the direction from endpoint A to endpoint B and the direction from endpoint B to endpoint A. In some embodiments, when the line is a lane, the direction corresponding to the line vector can be the driving direction of the lane or the reverse direction of the driving direction.

[0092] On the basis of determining the line vector of the annotation character in the world coordinate system, rotation processing is performed on the line vector in the world coordinate system. For example, the line vector in the world coordinate system is rotated by 90 degrees through a rotation matrix to obtain a vertical vector in the world coordinate system. Among them, the rotation can be performed in the clockwise direction or the counterclockwise direction, and the rotation direction determines on which side of the line the annotation character is located. It is worth mentioning that in the present application, the line vector is rotated on the plane where the road surface where the line is located, so as to ensure that the obtained vertical vector and the line vector are both located on the plane where the road surface where the line is located in the world coordinate system.

[0093] As an example, the embodiments of the present application provide a Figure 4 schematic diagram of the line vector and the vertical vector of the annotation character in the world coordinate system as shown in Figure 4 which shows a line and the annotation character "road" marked on the line. There are 4 representation forms of the vectors (referring to the line vector and the vertical vector) of the annotation character. Among them, the line vector is Figure 4 the vector in the horizontal direction (parallel to the line) in Figure 4 and the vertical vector is

[0094] the vector in the vertical direction (perpendicular to the line) in

[0095] The intersection point between the line vector and the vertical vector is the reference annotation position. Through the above method, the line vector and the vertical vector can be quickly and accurately determined based on the reference annotation position of the annotation character in the world coordinate system.

[0096] In step 103, based on the transformation matrix between the world coordinate system and the NDC coordinate system (such as the MVP transformation matrix), the base marking position, along-line vector and vertical vector of the annotation character in the world coordinate system can be converted to the NDC coordinate system to obtain the base marking position, along-line vector and vertical vector of the annotation character in the NDC coordinate system.

[0097] In step 104, the screen vertex is calculated according to the reference annotation position, the line vector and the vertical vector of the annotation character in the NDC coordinate system to obtain the vertex position of the annotation character in the screen.

[0098] Here, the NDC coordinate system is converted to the screen, that is, the screen vertex calculation is performed based on the base annotation position, along-line vectors and vertical vectors of the annotation characters in the NDC coordinate system to obtain the vertex position of the annotation characters in the screen. The vertex position of the annotation characters in the screen is actually the vertex position of the annotation characters in the pixel coordinate system of the screen.

[0099] The screen vertex calculation here may refer to positioning an area for presenting the annotation characters according to the base annotation position, along-line vectors and vertical vectors of the annotation characters in the NDC coordinate system. The vertex position of the annotation characters on the screen is the vertex position of the area on the screen. Taking the area as a rectangular area as an example, the vertex positions of the annotation characters on the screen include four, namely, the lower left vertex position, the lower right vertex position, the upper left vertex position and the upper right vertex position.

[0100] Since the depth value is not considered when converting from the NDC coordinate system to the screen, the distance (depth) of the annotation word does not affect the process of calculating the screen vertex.

[0101] It is worth noting that, in the case where the annotation text includes multiple annotation characters, steps 102 to 104 can be executed for each annotation character to obtain the vertex position of each annotation character on the screen; in other embodiments, on the basis of determining the vertex position of the first annotation character, the vertex position of the first annotation character can be translated along the direction of the line, and the vertex position obtained by translation can be used as the vertex position of the next annotation character.

[0102] In step 105 , the label words are rendered according to the vertex positions of the label words on the screen.

[0103] Through step 104, the vertex position of the annotation word on the screen can be obtained, and then the annotation word can be rendered on the screen according to the vertex position to realize the display of the annotation word on the screen. It is worth noting that if there are multiple annotation words, it means rendering the corresponding annotation word according to the vertex position of each annotation word on the screen. It is worth noting that the vertex position on the screen includes the x coordinate and the y coordinate, but does not include the z coordinate.

[0104] The embodiment of the present application does not limit the method of rendering graphics based on vertex positions. For example, the Web Graphics Library (WebGL) protocol can be used. Taking the vertex positions of the labeled words on the screen as the four vertex positions of the rectangular area as an example, during the rendering process, the labeled words are split into two triangles for rendering, so as to realize the calculation of geometric relationships, where one triangle is composed of the lower left vertex position, the upper left vertex position and the lower right vertex position, and the other triangle is composed of the lower left vertex position, the lower right vertex position and the upper right vertex position. During the rendering process, in addition to calculating geometric relationships, it is also necessary to calculate the color of the fragment, etc. The former can be achieved by a vertex shader, and the latter can be achieved by a fragment shader.

[0105] In some embodiments, after step 101, the electronic map word processing method further includes: converting the route from the world coordinate system to the screen; and rendering the route according to multiple route positions of the route on the screen.

[0106] The annotation words exist to describe the attributes of the line. Therefore, in addition to rendering the annotation words on the screen, the line can also be rendered on the screen so that the relevant operators can perform operations according to the electronic map displayed on the screen (including the line and the corresponding annotation words). For example, the line can be converted from the world coordinate system to the screen, and the line can be rendered according to multiple line positions of the line on the screen, wherein the conversion method (or projection method) from the world coordinate system to the screen is not limited. The above method realizes the rendering of the road and can meet the operation requirements in actual application scenarios.

[0107] It is worth mentioning that the line in the world coordinate system is complete, but on the screen, considering the limited screen range, multiple line positions of the line on the screen may only correspond to part of the line positions of the line in the world coordinate system, and the final rendered line may only correspond to part of the line in the world coordinate system.

[0108] like Figure 3A As shown, the embodiment of the present application converts the reference annotation position, along-line vector and vertical vector of the annotation word in the world coordinate system into the NDC coordinate system to calculate the vertex position of the annotation word on the screen. Due to the characteristics of the NDC coordinate system, the depth value is not considered when converting from the NDC coordinate system to the screen. Therefore, the size of the annotation word finally rendered will not be affected by the distance, so that the annotation word is clearly distinguishable when displayed; at the same time, the annotation word rendered by the embodiment of the present application can achieve the effect of along-line annotation, thereby clearly reflecting the correspondence between the annotation word and the line. In summary, the embodiment of the present application can effectively improve the efficiency of relevant operators in performing operations based on the annotation words, and is suitable for various operation scenarios for electronic maps.

[0109] In some embodiments, see Figure 3B , Figure 3B is a flow chart of a word processing method for an electronic map provided in an embodiment of the present application. Figure 3A The illustrated step 104 can be implemented through steps 201 to 202 , which will be described in conjunction with each step.

[0110] In step 201, NDC vertex calculation is performed according to the reference annotation position, the line vector and the vertical vector of the annotation character in the NDC coordinate system to obtain the vertex position of the annotation character in the NDC coordinate system.

[0111] Here, NDC vertex calculation is performed in the NDC coordinate system based on the base annotation position, along-line vectors and vertical vectors of the annotation characters in the NDC coordinate system. For example, the area for presenting the annotation characters is located in the NDC coordinate system, and the vertex positions in the area are used as the vertex positions of the annotation characters in the NDC coordinate system.

[0112] In some embodiments, the vertex positions of the annotation character in the NDC coordinate system include a first vertex position, a second vertex position, a third vertex position and a fourth vertex position for constituting a rectangular area; the above-mentioned NDC vertex calculation based on the base annotation position, the line vector and the vertical vector of the annotation character in the NDC coordinate system can be implemented in the following manner to obtain the vertex position of the annotation character in the NDC coordinate system: the base annotation position of the annotation character in the NDC coordinate system is determined as the first vertex position; the second vertex position is obtained by moving from the base annotation position of the annotation character in the NDC coordinate system according to the line vector; the third vertex position is obtained by moving from the base annotation position of the annotation character in the NDC coordinate system according to the vertical vector; the fourth vertex position is obtained by moving from the second vertex position in the NDC coordinate system according to the vertical vector; or, the fourth vertex position is obtained by moving from the third vertex position in the NDC coordinate system according to the line vector.

[0113] Here, the position of the annotation word can be described by a rectangular area, and the process of obtaining the vertex position of the annotation word in the NDC coordinate system is the process of obtaining the vertex position of the rectangular area used to present the annotation word in the NDC coordinate system.

[0114] For ease of understanding, the case where the reference annotation position is positioned as the lower left corner vertex position is used as an example. First, the reference annotation position of the annotation character in the NDC coordinate system is determined as the first vertex position (lower left corner vertex position); in the NDC coordinate system, the reference annotation position of the annotation character is moved along the line vector to obtain the second vertex position, which is the lower right corner vertex position; in the NDC coordinate system, the reference annotation position of the annotation character is moved according to the vertical vector to obtain the third vertex position, which is the upper left corner vertex position; in the NDC coordinate system, the second vertex position is moved according to the vertical vector to obtain the fourth vertex position, or in the NDC coordinate system, the third vertex position is moved according to the line vector from the third vertex position to obtain the fourth vertex position, which is the upper right corner vertex position. Of course, the reference annotation position can also be positioned as other vertex positions, not limited to the lower left corner vertex position. The above method can accurately describe the position of the annotation character by calculating the first vertex position, the second vertex position, the third vertex position and the fourth vertex position, thereby facilitating accurate rendering.

[0115] In some embodiments, before step 201, the word processing method of the electronic map further includes: performing vector update processing on the line vector of the labeled word in the NDC coordinate system according to the word size of the labeled word to obtain an updated line vector; performing vector update processing on the vertical vector of the labeled word in the NDC coordinate system according to the word size of the labeled word to obtain an updated vertical vector. The above-mentioned NDC vertex calculation based on the reference annotation position, the line vector and the vertical vector of the labeled word in the NDC coordinate system to obtain the vertex position of the labeled word in the NDC coordinate system can be implemented in the following manner: performing NDC vertex calculation based on the reference annotation position, the updated line vector and the updated vertical vector of the labeled word in the NDC coordinate system to obtain the vertex position of the labeled word in the NDC coordinate system.

[0116] Here, the font size of the annotation font can be preset, and the font size includes font width and font height. The font size can be set based on the pixel coordinate system of the screen, for example, the font width is M pixels and the font height is N pixels. It is worth noting that for multiple annotation fonts in the same annotation text, in order to ensure a uniform display effect, the font sizes of different annotation fonts are usually set to be the same; and for annotation fonts belonging to different annotation texts, the font sizes can be the same or different. For example, different font sizes can be set for annotation fonts corresponding to different types of lines, such as setting font size A for annotation fonts corresponding to lanes and setting font size B for annotation fonts corresponding to sidewalks, and font size A is different from font size B.

[0117] Under the premise of presetting the size of the annotation word, the vector along the line vector of the annotation word in the NDC coordinate system is updated according to the size of the annotation word to obtain the updated along the line vector. For example, considering that the along the line vector corresponds to the width of the annotation word, the component along the line vector of the annotation word in the NDC coordinate system on the x-axis is updated according to the width of the annotation word to obtain the updated component along the line vector on the x-axis, and the component along the line vector of the annotation word in the NDC coordinate system on the y-axis is updated according to the width of the annotation word to obtain the updated component along the line vector on the y-axis. In this way, the vector update processing of the along the line vector is realized on the x-axis and the y-axis. Among them, the component of the along-line vector on the x-axis refers to the vector obtained by mapping the along-line vector to the x-axis; when the component is updated according to the word width of the annotated word, considering that the word width is based on the screen setting, the word width in the screen can be converted to the NDC coordinate system to obtain the NDC word width, and then the NDC word width and the corresponding component (referring to the component of the along-line vector on the x-axis or the component of the along-line vector on the y-axis) are subjected to specific operations, such as multiplication or multiplication followed by weighted processing.

[0118] Similarly, the vertical vector of the tagged word in the NDC coordinate system is updated according to the size of the tagged word to obtain an updated vertical vector. For example, considering that the vertical vector corresponds to the height of the tagged word, the component of the vertical vector of the tagged word in the NDC coordinate system on the x-axis is updated according to the height of the tagged word to obtain the component of the updated vertical vector on the x-axis; the component of the vertical vector of the tagged word in the NDC coordinate system on the y-axis is updated according to the height of the tagged word to obtain the component of the updated vertical vector on the y-axis. In this way, the vector update processing of the vertical vector is realized on the x-axis and the y-axis.

[0119] Thus, updating the inline vector may indicate the width of the labeled word corresponding to the width in the NDC coordinate system, and updating the vertical vector may indicate the height of the labeled word corresponding to the height in the NDC coordinate system.

[0120] Then, the NDC vertex calculation can be performed based on the base annotation position of the annotation character in the NDC coordinate system, the updated along-line vector and the updated vertical vector, to obtain the vertex position of the annotation character in the NDC coordinate system. In this way, when the annotation character is finally rendered on the screen, the actual displayed character size of the annotation character can be guaranteed to correspond to the preset character size, thereby improving the display effect and thus improving the work efficiency of relevant operators. At the same time, the character size supports customization, which can improve flexibility, that is, relevant operators can set the character size according to the needs of actual application scenarios, such as setting different character sizes for different types of lines, so that the type of line can be distinguished according to the actual displayed character size in the final display.

[0121] In step 202, the vertex positions of the annotation characters in the NDC coordinate system are converted according to the screen resolution to obtain the vertex positions of the annotation characters in the screen.

[0122] The screen resolution includes the screen width and the screen height. In the NDC coordinate system, the value ranges of the x-axis and the y-axis are both [-1, 1]. Therefore, the value of each unit in the x-axis of the NDC coordinate system corresponds to the value of ClientWidth / 2 in the x-axis of the screen, where ClientWidth represents the width of the screen; the value of each unit in the y-axis of the NDC coordinate system corresponds to the value of ClientHeight / 2 in the y-axis of the screen, where ClientHeight represents the height of the screen.

[0123] Therefore, after obtaining the vertex position of the labeled word in the NDC coordinate system, the vertex position of the labeled word in the NDC coordinate system is converted according to the numerical relationship between the NDC coordinate system and the screen to obtain the vertex position of the labeled word on the screen. It is worth noting that the position conversion processing here involves the x-coordinate axis and the y-coordinate axis, but not the z-coordinate axis.

[0124] like Figure 3B As shown, the embodiment of the present application first calculates the vertex position of the annotation character in the NDC coordinate system, and then converts the vertex position of the annotation character in the NDC coordinate system into the vertex position of the annotation character on the screen. It can achieve accurate conversion based on the numerical relationship between the NDC coordinate system and the screen. At the same time, the influence of the z value can also be avoided during the conversion process, so that the size of the annotation character finally rendered will not be affected by the distance.

[0125] In some embodiments, see Figure 3C , Figure 3C is a flow chart of a word processing method for an electronic map provided in an embodiment of the present application. Figure 3A Before step 102 shown, the line may be converted from the world coordinate system to the screen in step 301 .

[0126] Considering the limited screen range, the screen may display a complete route or only a portion of the complete route. In the embodiment of the present application, in order to effectively mark the route displayed on the screen, the route is first converted from the world coordinate system to the screen to obtain multiple route positions of the route on the screen.

[0127] It is worth mentioning that the content displayed on the screen may change over time. For example, if the user drags or zooms the content displayed on the screen, the multiple line positions of the line on the screen can be determined based on the content displayed on the screen at the current moment, thereby improving real-time performance and accuracy.

[0128] In step 302, position selection processing is performed on multiple line positions of the line on the screen to obtain a reference marking position of the marking word on the line on the screen.

[0129] Here, multiple line positions of the line on the screen can be regarded as multiple candidate reference marking positions. Therefore, position selection processing can be performed on the multiple line positions of the line on the screen, and a selected line position is used as the reference marking position of the annotation word on the line on the screen.

[0130] The embodiment of the present application does not limit the method of position selection processing, for example, it can be a random selection, or it can be selected by the user according to needs.

[0131] In some embodiments, the above-mentioned position selection processing of multiple line positions of the line in the screen can be implemented in the following way to obtain the reference marking position of the annotation word on the line in the screen: perform length calculation based on the multiple line positions of the line in the screen to obtain the line length of the line in the screen; calculate the reference marking position of marking the annotation word to the line in the screen based on the line length of the line in the screen and the width of the annotation word.

[0132] An example of position selection processing is provided here. For example, a preset width of a label word can be obtained, and the width is defined based on the screen. At the same time, a length calculation is performed based on multiple line positions of the line in the screen to obtain the line length of the line in the screen. Then, based on the line length of the line in the screen and the width of the label word, a reference labeling position for labeling the label word to the line in the screen is calculated, wherein the calculation method depends on a preset labeling strategy for labeling the label word to the line, such as labeling the label word to the first quarter, the center, or the last quarter of the line.

[0133] For ease of understanding, the following are provided: Figure 5Schematic diagram of the circuit and the labeled text in the shown screen. When the preset labeling strategy is to label the labeled text in the center of the circuit and there is only one labeled text, which is "road", assuming the circuit length of the circuit in the screen is a and the character width of the labeled text "road" is b, then (a - b) / 2 can be calculated to locate the reference labeling position of the labeled text in the screen, that is, the distance from the reference labeling position to the starting position (or the ending position) of the circuit in the screen is (a - b) / 2; in this way, it can be ensured that the labeled text is located in the middle of the circuit. Through the above method, the accurate positioning of the reference labeling position of the labeled text in the screen can be achieved, so that the labeling effect in the final display corresponds to the preset labeling strategy.

[0134] In some embodiments, there are multiple labeled texts; the following method can be used to calculate the reference labeling position of labeling the labeled text to the circuit in the screen according to the circuit length of the circuit in the screen and the character width of the labeled text: perform a summary process on the character widths corresponding to the multiple labeled texts respectively to obtain the total width; calculate the reference labeling position of labeling the first labeled text to the circuit in the screen according to the circuit length of the circuit in the screen and the total width; calculate the reference labeling position of labeling the other labeled texts to the circuit in the screen according to the reference labeling position of labeling the first labeled text to the circuit in the screen and the character widths corresponding to the multiple labeled texts respectively.

[0135] Here, when the labeled text includes multiple labeled texts, first perform a summary process on the character widths corresponding to all the labeled texts in the labeled text to obtain the total width, where the summary process is, for example, an addition process. Then, calculate the reference labeling position of labeling the first labeled text to the circuit in the screen according to the circuit length of the circuit in the screen and the total width. For example, Figure 5 Taking another example, assuming the total width is c, then (a - c) / 2 can be calculated to locate the reference labeling position of labeling the first labeled text to the circuit in the screen.

[0136] It should be noted that the first marked character here refers to the marked character for calculating the first reference marking position. Corresponding to the marked text, it can be the first marked character or the last marked character in the marked text. That is, the order of calculating the reference marking positions for multiple marked characters can be the same as or different from the order of multiple marked characters in the marked text, which depends on the definition of the reference marking position. Taking the marked text "marking line" as an example, the first marked character in the marked text is "mark", and the last marked character in the marked text is "line". If the reference marking position is defined as the lower left vertex position or the upper left vertex position, then first calculate the reference marking position for marking the marked character "mark" on the line in the screen, and then calculate the reference marking position for marking the marked character "line" on the line in the screen; if the reference marking position is defined as the lower right vertex position or the upper right vertex position, then first calculate the reference marking position for marking the marked character "line" on the line in the screen, and then calculate the reference marking position for marking the marked character "mark" on the line in the screen.

[0137] It should be noted that the above summarization process is achieved on the premise that there is no character spacing or the character spacing is ignored between adjacent marked characters in the marked text. If the character spacing is considered, then the character widths corresponding to all marked characters in the marked text and the character spacing between every two adjacent marked characters are summarized to obtain the total width. Among them, the character spacing can be preset in advance.

[0138] According to the order of calculating the reference marking positions for multiple marked characters, based on obtaining the reference marking position for marking the first marked character on the line in the screen, it is possible to further deduce the reference marking positions for marking other marked characters on the line in the screen. Taking the above example again, assuming the total width is c, then (a - c) / 2 can be calculated to locate the reference marking position for marking the first marked character on the line in the screen. On this basis, if the character width of this first marked character is d, then ((a - c) / 2) + d can be calculated to locate the reference marking position for marking the second marked character on the line in the screen. Among them, if the character spacing is considered, the character spacing between the first marked character and the second marked character can also be superimposed on the basis of ((a - c) / 2) + d, and the reference marking position for marking the second marked character on the line in the screen can be located according to the superimposed result. Then, based on the reference marking position for marking the second marked character on the line in the screen and the character width of the second marked character (if the character spacing is considered, the character spacing between the second marked character and the third marked character can also be added), the reference marking position for marking the third marked character on the line in the screen can be calculated, and so on. Through the above method, the reference marking positions for marking each marked character on the line in the screen can be calculated in sequence, and at the same time, it can be ensured that the final displayed marking effect conforms to the preset marking strategy.

[0139] In step 303, the reference marking position of the marking word on the line on the screen is converted into the world coordinate system to obtain the reference marking position of the marking word on the line in the world coordinate system.

[0140] The base marking position of the label characters on the line on the screen is described based on the pixel coordinate system where the screen is located, that is, it is a pixel coordinate. Therefore, it is necessary to convert the base marking position of the label characters on the line on the screen into the world coordinate system to obtain the base marking position of the label characters on the line in the world coordinate system, and then, according to the base marking position of the label characters on the line in the world coordinate system, calculate the vertex position of the label characters on the screen.

[0141] like Figure 3C As shown, since the annotation characters are marked on the line, the embodiment of the present application determines the base annotation position of the annotation characters on the line on the screen based on multiple line positions of the line on the screen, which can meet the characteristics of the annotation scene, improve the accuracy of the obtained base annotation position, and thus improve the annotation effect reflected in the final rendering.

[0142] In some embodiments, see Figure 3D , Figure 3D is a flow chart of a word processing method for an electronic map provided in an embodiment of the present application. Figure 3A The illustrated step 103 can be implemented through steps 401 to 405 , which will be described in conjunction with each step.

[0143] In step 401, the reference marking position of the marking character is moved in the world coordinate system according to the along-line vector to obtain the along-line position.

[0144] Here, in the process of converting from the world coordinate system to the NDC coordinate system, direct conversion of the vector cannot be achieved. Therefore, indirect conversion of the vector can be achieved through position (coordinate) conversion.

[0145] For example, in the world coordinate system, the base marking position of the marking word is moved according to the along-line vector, and the position obtained by the movement is named as the along-line position.

[0146] In step 402, the reference marking position of the marking character is moved according to the vertical vector in the world coordinate system to obtain a vertical position.

[0147] Here, the reference marking position of the marking character is moved according to the vertical vector in the world coordinate system, and the position obtained by the movement is named the vertical position.

[0148] Thus, for the annotation characters, there are three corresponding points in the world coordinate system, namely the reference annotation position, the position along the line, and the vertical position.

[0149] In step 403, the reference marking position, the position along the line and the vertical position of the marking character in the world coordinate system are converted into the NDC coordinate system.

[0150] Here, the base marking position of the annotation character in the world coordinate system is converted to the NDC coordinate system to obtain the base marking position of the annotation character in the NDC coordinate system; the along-line position of the annotation character in the world coordinate system is converted to the NDC coordinate system to obtain the along-line position of the annotation character in the NDC coordinate system; the vertical position of the annotation character in the world coordinate system is converted to the NDC coordinate system to obtain the vertical position of the annotation character in the NDC coordinate system.

[0151] In step 404, a vector from the reference annotation position of the annotation character to the along-line position in the NDC coordinate system is determined as an along-line vector in the NDC coordinate system.

[0152] It is understandable that a vector may refer to a quantity with a direction from the starting point to the end point. Based on this, the vector from the reference annotation position (i.e., the starting point) of the annotation word to the position along the line (i.e., the end point) in the NDC coordinate system is determined as the along-line vector in the NDC coordinate system.

[0153] In step 405, a vector from the reference marking position of the marking character to the vertical position in the NDC coordinate system is determined as a vertical vector in the NDC coordinate system.

[0154] Similarly, the vector from the reference marking position (ie, the starting point) of the marking character to the vertical position (ie, the end point) in the NDC coordinate system is determined as the vertical vector in the NDC coordinate system.

[0155] like Figure 3D As shown, the embodiment of the present application realizes the conversion of vectors between different coordinate systems by converting positions between different coordinate systems, which can overcome the problem that vectors cannot be directly converted and at the same time ensure the accuracy of vector conversion.

[0156] The following will describe an exemplary application of the embodiment of the present application in an actual application scenario. The embodiment of the present application can be applied to the attribute annotation of lines such as roads, lanes, and protective line facilities in the 3D scene of the map data integration platform. The word processing solution of the electronic map provided by the embodiment of the present application can solve the problem that the perspective projection in the 3D scene causes the text in the distance to be indistinguishable, so that the size of the rendered text (corresponding to the annotated text above) is independent of the distance, ensuring that the rendered text is clear and identifiable. At the same time, by annotating along the line, it can be convenient for operators to distinguish the line to which the text belongs more simply and clearly.

[0157] The present application embodiment provides Figure 6 The flowchart of the word processing method of the electronic map shown in FIG. Figure 6 Provide explanation.

[0158] First, the CPU in the electronic device converts the line from the world coordinate system to the screen, and calculates the reference marking position of the target text that needs to be marked on the line according to the part of the line on the screen. Then, the reference marking position is converted from pixel coordinates back to world coordinates to obtain the reference marking position of the target text in the world coordinate system. At the same time, the along-line vector of the target text at the reference marking position in the world coordinate system is stored. Among them, the target text refers to any text that needs to be marked on the line, and the target text is used as an example for explanation.

[0159] Secondly, the CPU transmits the reference marking position of the target text in the world coordinate system, the font size of the target text, and the line vector of the target text in the world coordinate system to the vertex shader in the GPU of the electronic device, and the vertex shader is used to calculate geometric relationships.

[0160] Then, in the vertex shader, the line position (dirPosition) is calculated based on the reference position (position) and the line vector of the target text in the world coordinate system, for example, 1m along the line, to determine the line vector of the target text in the NDC coordinate system. At the same time, the line vector of the target text in the world coordinate system is rotated 90 degrees clockwise using the rotation matrix to obtain the vertical vector of the target text in the world coordinate system, and the vertical position (norPosition) is calculated based on the reference position (position) and the vertical vector of the target text in the world coordinate system to determine the vertical vector of the target text in the NDC coordinate system.

[0161] The position, dirPosition and norPosition of the target text in the world coordinate system are converted to the clipping coordinate system using the MVP transformation matrix, and divided by the 4th dimension w component to convert to NDC coordinates, and the ndc_pos (converted from position), ndc_dir_pos (converted from dirPosition) and ndc_nor_pos (converted from norPosition) of the target text in the NDC coordinate system are obtained. According to the ndc_pos and ndc_dir_pos of the target text in the NDC coordinate system, the along-line vector of the target text in the NDC coordinate system can be calculated; according to the ndc_pos and ndc_nor_pos of the target text in the NDC coordinate system, the vertical vector of the target text in the NDC coordinate system can be calculated.

[0162] In the NDC coordinate system, the value range of x and y is [-1,1], where each unit in the x direction corresponds to (clientWidth) / 2 pixels on the screen, and each unit in the y direction corresponds to (clientHeight) / 2 pixels on the screen, where clientWidth represents the screen width and clientHeight represents the screen height. According to the size of the target text, the along-line vector and the vertical vector of the target text in the NDC coordinate system are expanded (corresponding to the vector update process above), and the numerical conversion from the NDC coordinate system to the screen is performed according to the screen resolution, so that the four vertex positions of the target text on the screen can be obtained, as shown in Figure 7 As shown, Figure 7 The "0" in the is the upper left vertex, "1" is the lower left vertex, "2" is the lower right vertex, and "3" is the upper right vertex.

[0163] Finally, the four vertex positions of the target text on the screen are assigned to gl_Position to render the target text according to the four vertex positions of the target text on the screen. During the rendering process, the target text can be split into two triangles for rendering, for example, based on Figure 7 , the triangle formed by [0,1,2] and the triangle formed by [3,1,2] can be combined. In addition, texture sampling and other tasks are performed through the fragment shader in the GPU of the electronic device to complete the rendering of text texture and color.

[0164] In the perspective projection scheme provided by the related art, the z value is needed to realize the effect of near large and far small. However, in the embodiment of the present application, after perspective projection, the vertex position is calculated in the NDC coordinate system by manually dividing by the w component, thereby avoiding the influence of the projection matrix on the vertex calculation. Therefore, the size of the rendered text is not affected by the distance (z value). As an example, the following is provided: Figure 8 The schematic diagram of the rendered electronic map shown in Figure 8 Each character is marked along the line, with the same size and clear and legible, making it convenient for relevant operators to carry out their work.

[0165] The following is a description of an exemplary structure of a word processing device 455 provided in an embodiment of the present application implemented as a software module. In some embodiments, for example, Figure 2As shown, the software modules stored in the word processing device 455 of the memory 450 may include: an acquisition module 4551, used to acquire the lines in the electronic map and the annotation characters corresponding to the lines; a determination module 4552, used to determine the along-line vector according to the reference annotation position of the annotation characters on the lines in the world coordinate system, and determine the vertical vector perpendicular to the along-line vector; a conversion module 4553, used to convert the reference annotation position, the along-line vector and the vertical vector of the annotation characters in the world coordinate system into the normalized device coordinate NDC coordinate system; a calculation module 4554, used to perform screen vertex calculation according to the reference annotation position, the along-line vector and the vertical vector of the annotation characters in the NDC coordinate system to obtain the vertex position of the annotation characters on the screen; a rendering module 4555, used to render the annotation characters according to the vertex position of the annotation characters on the screen.

[0166] In some embodiments, the calculation module 4554 is also used to: perform NDC vertex calculation based on the base annotation position, along-line vector and vertical vector of the annotation character in the NDC coordinate system to obtain the vertex position of the annotation character in the NDC coordinate system; perform position conversion processing on the vertex position of the annotation character in the NDC coordinate system according to the screen resolution to obtain the vertex position of the annotation character on the screen.

[0167] In some embodiments, the calculation module 4554 is also used to: perform vector update processing on the along-line vector of the annotation word in the NDC coordinate system according to the word size of the annotation word to obtain an updated along-line vector; perform vector update processing on the vertical vector of the annotation word in the NDC coordinate system according to the word size of the annotation word to obtain an updated vertical vector; perform NDC vertex calculation based on the base annotation position of the annotation word in the NDC coordinate system, the updated along-line vector and the updated vertical vector to obtain the vertex position of the annotation word in the NDC coordinate system.

[0168] In some embodiments, the character size of the annotation character includes a character width and a character height; the calculation module 4554 is also used to: perform component update processing on the components of the along-line vector of the annotation character in the NDC coordinate system on the x-axis according to the character width of the annotation character, and obtain the updated components of the along-line vector on the x-axis; perform component update processing on the components of the along-line vector of the annotation character in the NDC coordinate system on the y-axis according to the character width of the annotation character, and obtain the updated components of the along-line vector on the y-axis; perform component update processing on the components of the vertical vector of the annotation character in the NDC coordinate system on the x-axis according to the character height of the annotation character, and obtain the updated components of the vertical vector on the x-axis; perform component update processing on the components of the vertical vector of the annotation character in the NDC coordinate system on the y-axis according to the character height of the annotation character, and obtain the updated components of the vertical vector on the y-axis.

[0169] In some embodiments, the vertex positions of the annotation character in the NDC coordinate system include a first vertex position, a second vertex position, a third vertex position and a fourth vertex position for constituting a rectangular area; the calculation module 4554 is further used to: determine the base annotation position of the annotation character in the NDC coordinate system as the first vertex position; move from the base annotation position of the annotation character in the NDC coordinate system according to a line vector to obtain a second vertex position; move from the base annotation position of the annotation character in the NDC coordinate system according to a vertical vector to obtain a third vertex position; move from the second vertex position in the NDC coordinate system according to a vertical vector to obtain a fourth vertex position; or, move from the third vertex position in the NDC coordinate system according to a line vector to obtain a fourth vertex position.

[0170] In some embodiments, the determination module 4552 is also used to: convert the line from the world coordinate system to the screen; perform position selection processing on multiple line positions of the line on the screen to obtain the base marking position of the annotation characters on the line on the screen; convert the base marking position of the annotation characters on the line on the screen to the world coordinate system to obtain the base marking position of the annotation characters on the line in the world coordinate system.

[0171] In some embodiments, the determination module 4552 is further used to: calculate the length of the line according to multiple line positions of the line on the screen to obtain the line length of the line on the screen; calculate the reference marking position for marking the annotation word to the line on the screen according to the line length of the line on the screen and the width of the annotation word.

[0172] In some embodiments, there are multiple annotation characters; the determination module 4552 is also used to: summarize the character widths corresponding to the multiple annotation characters to obtain the total width; calculate the reference marking position for marking the first annotation character on the line on the screen according to the line length and the total width of the line on the screen; calculate the reference marking position for marking other annotation characters on the screen according to the reference marking position for marking the first annotation character on the line on the screen and the character widths corresponding to the multiple annotation characters.

[0173] In some embodiments, the conversion module 4553 is also used to: move the base marking position of the annotation character in the world coordinate system according to the along-line vector to obtain the along-line position; move the base marking position of the annotation character in the world coordinate system according to the vertical vector to obtain the vertical position; convert the base marking position, along-line position and vertical position of the annotation character in the world coordinate system to the NDC coordinate system; determine the vector from the base marking position of the annotation character to the along-line position in the NDC coordinate system as the along-line vector in the NDC coordinate system; determine the vector from the base marking position of the annotation character to the vertical position in the NDC coordinate system as the vertical vector in the NDC coordinate system.

[0174] The embodiment of the present application provides a computer program product or a computer program, which includes executable instructions stored in a computer-readable storage medium. A processor of an electronic device reads the executable instructions from the computer-readable storage medium, and the processor executes the executable instructions, so that the electronic device executes the word processing method of the electronic map described in the embodiment of the present application.

[0175] An embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein executable instructions are stored. When the executable instructions are executed by a processor, the processor will execute the word processing method of the electronic map provided in the embodiment of the present application.

[0176] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface storage, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0177] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0178] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0179] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0180] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A word processing method for an electronic map, characterized in that: include: Obtaining a route in an electronic map and an annotation word corresponding to the route; Determine a line vector according to the reference marking position of the marking word on the line in the world coordinate system, and determine a perpendicular vector perpendicular to the line vector; Convert the reference mark position, along-line vector and vertical vector of the mark word in the world coordinate system to the normalized device coordinate NDC coordinate system; Calculate the screen vertex according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word on the screen; The annotation word is rendered according to the vertex position of the annotation word on the screen.

2. The method according to claim 1, characterized in that The screen vertex calculation is performed according to the reference annotation position of the annotation word in the NDC coordinate system, the line vector and the vertical vector to obtain the vertex position of the annotation word on the screen, including: Perform NDC vertex calculation according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word in the NDC coordinate system; The vertex positions of the annotated characters in the NDC coordinate system are converted according to the screen resolution to obtain the vertex positions of the annotated characters in the screen.

3. The method according to claim 2, characterized in that Before performing NDC vertex calculation according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system, the method further includes: Performing vector update processing on the line vector of the marked word in the NDC coordinate system according to the word size of the marked word to obtain an updated line vector; Performing vector updating processing on the vertical vector of the marked word in the NDC coordinate system according to the word size of the marked word to obtain an updated vertical vector; The NDC vertex calculation is performed according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word in the NDC coordinate system, including: The NDC vertex calculation is performed according to the reference annotation position of the annotation word in the NDC coordinate system, the updated along-line vector and the updated vertical vector to obtain the vertex position of the annotation word in the NDC coordinate system.

4. The method according to claim 3, characterized in that The word size of the marked word includes a word width and a word height; performing vector updating processing on the line vector of the marked word in the NDC coordinate system according to the word size of the marked word to obtain the updated line vector, including: Performing component updating processing on the component of the line vector of the annotation word in the NDC coordinate system on the x-coordinate axis according to the word width of the annotation word, so as to obtain the component of the updated line vector on the x-coordinate axis; Performing component updating processing on the component of the line vector of the annotation word in the NDC coordinate system on the y-coordinate axis according to the word width of the annotation word, so as to obtain the component of the line vector on the y-coordinate axis; The step of performing a vector updating process on the vertical vector of the marked word in the NDC coordinate system according to the word size of the marked word to obtain an updated vertical vector includes: Performing component updating processing on the component of the vertical vector of the marked word on the x-coordinate axis in the NDC coordinate system according to the word height of the marked word, to obtain the component of the updated vertical vector on the x-coordinate axis; The component of the vertical vector of the marked word in the NDC coordinate system on the y-coordinate axis is updated according to the word height of the marked word to obtain the component of the updated vertical vector on the y-coordinate axis.

5. The method according to claim 2, characterized in that: The vertex positions of the annotation characters in the NDC coordinate system include a first vertex position, a second vertex position, a third vertex position and a fourth vertex position for constituting a rectangular area; The NDC vertex calculation is performed according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word in the NDC coordinate system, including: Determine the reference annotation position of the annotation character in the NDC coordinate system as the first vertex position; Moving the reference annotation position of the annotation character according to the line vector in the NDC coordinate system to obtain a second vertex position; Moving the reference annotation position of the annotation character according to the vertical vector in the NDC coordinate system to obtain a third vertex position; The fourth vertex position is obtained by moving from the second vertex position according to the perpendicular vector in the NDC coordinate system; or, the fourth vertex position is obtained by moving from the third vertex position according to the along-line vector in the NDC coordinate system.

6. The method according to claim 1, characterized in that Before determining the along-line vector at the reference marking position of the line according to the marking word in the world coordinate system, the method further comprises: Transforming the line from the world coordinate system to the screen; Performing position selection processing on multiple line positions of the line on the screen to obtain a reference marking position of the marking word on the line on the screen; The reference marking position of the annotation word on the line on the screen is converted into the world coordinate system to obtain the reference marking position of the annotation word on the line in the world coordinate system.

7. The method according to claim 6, characterized in that The performing position selection processing on a plurality of line positions of the line on the screen to obtain a reference marking position of the marking word on the line on the screen includes: Calculating the length of the line on the screen according to multiple line positions of the line, to obtain the line length of the line on the screen; According to the line length of the line on the screen and the character width of the annotation character, a reference annotation position for annotating the annotation character to the line on the screen is calculated.

8. The method according to claim 7, characterized in that There are multiple annotation characters; and calculating, based on the line length of the line on the screen and the character width of the annotation character, a reference annotation position for marking the annotation character on the line on the screen includes: The character widths corresponding to the multiple annotation characters are aggregated to obtain the total width; Calculate, according to the line length of the line on the screen and the total width, a reference marking position for marking the first marking word on the line on the screen; The reference marking positions for marking other marking characters on the screen to the line are calculated according to the reference marking position for marking the first marking character on the screen to the line and the character widths respectively corresponding to the plurality of marking characters.

9. The method according to any one of claims 1 to 8, characterized in that: The converting the reference annotation position, the line vector and the vertical vector of the annotation word in the world coordinate system into the normalized device coordinate NDC coordinate system includes: In the world coordinate system, the reference marking position of the marking word is moved according to the along-line vector to obtain the along-line position; Moving the reference marking position of the marking character in the world coordinate system according to the vertical vector to obtain a vertical position; Convert the reference mark position, along-line position and vertical position of the mark character in the world coordinate system to the NDC coordinate system; Determine the vector from the reference marking position of the marking character to the along-line position in the NDC coordinate system as the along-line vector in the NDC coordinate system; A vector from the reference marking position of the marking character to the vertical position in the NDC coordinate system is determined as a vertical vector in the NDC coordinate system.

10. A word processing device for an electronic map, characterized in that: include: An acquisition module, used to acquire a route in an electronic map and an annotation word corresponding to the route; A determination module, used to determine the along-line vector according to the reference marking position of the marking word on the line in the world coordinate system, and determine a perpendicular vector perpendicular to the along-line vector; A conversion module, used for converting the reference annotation position, the line vector and the vertical vector of the annotation word in the world coordinate system into the normalized device coordinate NDC coordinate system; A calculation module, used for calculating the screen vertex according to the reference annotation position, the line vector and the vertical vector of the annotation word in the NDC coordinate system to obtain the vertex position of the annotation word on the screen; A rendering module is used to render the annotation word according to the vertex position of the annotation word on the screen.

11. An electronic device, characterized in that: include: A memory for storing executable instructions; The processor is used to implement the word processing method of the electronic map as described in any one of claims 1 to 9 when executing the executable instructions stored in the memory.

12. A computer-readable storage medium, characterized in that: Executable instructions are stored, and when executed by a processor, the word processing method of the electronic map described in any one of claims 1 to 9 is implemented.

13. A computer program product, characterized in that It includes executable instructions for implementing the word processing method of the electronic map as claimed in any one of claims 1 to 9 when executed by a processor.