A plotting system and method based on a plotting template
Patent Information
- Application Number
- CN202311838378.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2026-08-21
- Estimated Expiration
- 2043-12-28
AI Technical Summary
为每一个标绘都设计算法工作量巨大且低效
[0022]本发明与现有技术相比,其显著优点为:1)提出了统一的标绘模板创建方案,规范了标绘模板创建流程;2)提供了具有普适性、规范性的标绘模板定义流程,可以可视化的完成标绘模板创建,有效降低了定义标绘的工作量和人力成本;3)以方便的通过程序实现可视化的定义线标,提高线标文件定义的效率;4)基于统一的算法库,可以大大提高基于本发明定义的标绘的绘制效率。
Smart Images

Figure CN117763643B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to geographic graphic plotting technology, specifically to a plotting system and method based on plotting templates. Background Technology
[0002] In geographic mapping software, plotting is frequently used to annotate maps. As a visual representation of geographic information, plotting can be problematic in practice; the same symbols may convey different meanings depending on the plotting standards used. A mature geographic mapping software needs to support multiple plotting standards and be able to easily switch between different plotting systems. A comprehensive line marker library often contains hundreds or even thousands of line marker types. Simply defining the drawing algorithms for each line marker manually through code is inefficient and cumbersome to modify.
[0003] Current plotting methods all work by converting control points into plotted graphics, calculating the actual plotted outline based on the control points. Transforming a set of plotted control points into the actual plotted graphic requires a library of line markers. Designing an algorithm for each plot is extremely labor-intensive and inefficient. Summary of the Invention
[0004] The purpose of this invention is to propose a plotting system and method based on plotting templates.
[0005] The technical solution for achieving the objective of this invention is: a plotting drawing system based on plotting templates, comprising a plotting customization module, a plotting algorithm library module, and a plotting drawing module, wherein:
[0006] The plotting customization module is used to construct plotting templates according to standardized plotting template specifications. The plotting templates describe graphic information and basic plotting information. The graphic information includes control points, auxiliary points, auxiliary lines, plotting elements, and graphic constraints. The basic plotting information includes the plotting name and number.
[0007] The plotting algorithm library module provides algorithmic support for plotting.
[0008] The plotting module is used to draw plotted objects. Based on the plotting information input by the user, including the plotting library number (lib), plotting number (Code), plotting control point information, and plotting display attributes, it retrieves the corresponding plotting template and instantiates the plotting template into a specific plotting object.
[0009] Furthermore, the plotting customization module includes a plotting customization interface submodule, a plotting template specification submodule, and a plotting template persistence submodule, wherein:
[0010] The plotting custom interface submodule is used to create plotting templates through visual interaction, and set the properties of the plotting template, including the plotting library number Lib, the plotting number Code in the plotting library, the default color, the plotting name, the plotting preview image, and the plotting description;
[0011] The plotting template specification submodule is used to save and provide plotting template specification information for use by the plotting custom module. It provides basic support for creating basic plotting templates, including plotting template specifications, blank plotting templates, and basic graphic element information.
[0012] The plotting template persistence submodule is used to convert the created plotting template into a persistent JSON or XML format and save it to the plotting template file and the plotting database.
[0013] Furthermore, in the plotting template, a control point is a coordinate point, and the control points of the line marker are a set of coordinate points, using latitude and longitude coordinates. Auxiliary points are coordinate points calculated based on multiple control points, including: points located at a certain proportion of a line segment starting from a point on the line connecting two points; points located at a certain distance on the perpendicular line connecting two points; and points obtained by rotating one point around another by a certain angle. Auxiliary lines are straight lines calculated based on control points and auxiliary points. Plotting elements are basic graphic elements drawn using control points, auxiliary points, and auxiliary lines as positioning points, including line segments, curves, polygons, kidney shapes, and text. The size and position of the graphic elements are determined by the positioning points. Graphic constraints are the constraint relationships between control points, auxiliary points, auxiliary lines, and plotting elements, used to adjust the position and attributes of control points, auxiliary points, auxiliary lines, and graphic elements when updating the shape during plotting.
[0014] Furthermore, the plotting template allows for different plotting drawing schemes corresponding to different numbers of control points. When two control points are input, a straight line is drawn; when three control points are input, a triangle is drawn; and when a point has only one control point, it corresponds to only one drawing scheme.
[0015] Furthermore, the plotting algorithm library module provides drawing algorithms for basic graphics, which are divided into two categories: open lines and closed lines. Open lines include: straight lines, curves, fixed dashed lines, parallel double straight lines, and parallel hyperbolas; closed lines include circles, polygons, and kidney shapes. At the same time, it provides basic graphic calculation functions to realize the calculation of specific proportional positions between two points, the calculation of perpendicular lines, and the calculation of distances between two points, which are used to generate new coordinate points when drawing plotting templates.
[0016] A plotting method based on a plotting template, utilizing the aforementioned plotting template-based plotting system, performs plotting. The specific process is as follows:
[0017] Set the plotting library number (lib) and plotting number (Code) to automatically match the corresponding plotting template;
[0018] Input the plotting control points, match the corresponding drawing scheme according to the number of input control points, calculate the position of auxiliary lines, auxiliary control points, auxiliary control lines, vertex coordinates, vertex color, texture, and texture coordinates of primitives based on the input control points, and submit the primitive information for rendering;
[0019] Set the display properties of the plotted object, including line color, fill color, and text content. Update the vertex coordinates, vertex color, texture, and texture coordinates of the primitive according to the set properties, and submit the primitive information for rendering.
[0020] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs plotting using the plotting template-based plotting system.
[0021] A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it performs plotting using the plotting template-based plotting system.
[0022] Compared with the prior art, the significant advantages of this invention are: 1) It proposes a unified scheme for creating plotting templates and standardizes the plotting template creation process; 2) It provides a universal and standardized plotting template definition process, which can complete the creation of plotting templates visually, effectively reducing the workload and manpower cost of defining plotting; 3) It can conveniently achieve visual definition of line markers through programs, improving the efficiency of line marker file definition; 4) Based on a unified algorithm library, it can greatly improve the drawing efficiency of plotting defined by this invention. Attached Figure Description
[0023] Figure 1 This is a block diagram of the plotting system based on plotting templates according to the present invention.
[0024] Figure 2 This is a flowchart defining the plotting template in this invention.
[0025] Figure 3 This is a flowchart of the process for creating a plotted object according to the present invention. Detailed Implementation
[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0027] This invention provides a plotting system and method based on plotting templates. Through a standardized plotting template creation process and a plotting drawing workflow based on these templates, it standardizes the plotting definition process, allows users to create new plotting templates themselves, and reduces the cost of developing a plotting library. The overall system diagram is as follows: Figure 1 As shown, it includes a custom plotting module, a plotting algorithm library module, and a plotting drawing module, wherein:
[0028] (1) Plotting Custom Module
[0029] The custom plotting module constructs plotting templates based on standardized plotting template specifications. The plotting template describes information such as control points, auxiliary points, auxiliary lines, plotting elements, graphic constraints, and basic plotting information (plotting name, plotting number). A control point is a single coordinate point; for line markers, the control points are a set of coordinate points, using latitude and longitude coordinates. Auxiliary points (including auxiliary calculation points and auxiliary control points) are coordinate points calculated from multiple control points, including: points located at a certain proportion of a line segment from the beginning of a segment on the line connecting two points; points at a certain distance on the perpendicular line connecting two points; and points obtained by rotating one point around another by a certain angle. Auxiliary lines are straight lines calculated from control points and auxiliary points. Plotting elements are basic graphic elements drawn using control points, auxiliary points, and auxiliary lines as positioning points, including line segments, curves, polygons, kidney shapes, and text. More specifically, text can be further subdivided into custom text, flag text, and annotations. The size and position of the elements are determined by the positioning points. Meanwhile, graphic elements have their own attributes. For example, closed graphic elements can be set to have attributes such as whether they can be filled, whether they are filled by default, whether the fill color is fixed, and the default fill color. Graphic constraints are the constraints between control points, auxiliary points, auxiliary lines, and graphic elements. They are used to describe the geometric relationships between elements and to adjust the position and attributes of control points, auxiliary points, auxiliary lines, and graphic elements when updating shapes. For example, when a user provides input to adjust the size of a text graphic element, the text at the auxiliary points will be adjusted in reverse according to the constraints.
[0030] The plotting customization module includes a plotting customization interface submodule, a plotting template specification submodule, and a plotting template persistence submodule. The plotting customization interface submodule is used to create plotting templates and set their attributes through a visual interactive method. The plotting template specification submodule saves and provides plotting template specification information for the plotting customization module to use, providing basic support for creating basic plotting templates, such as plotting template specifications, blank templates, and basic graphic element information. The plotting template persistence submodule converts the plotting templates created by the plotting customization interface submodule into persistently storable JSON or XML format and saves them to the plotting template file and the plotting database.
[0031] The plotting template allows for different plotting graphic drawing schemes corresponding to different numbers of control points. It differentiates the line marker drawing based on the number of input control points, and the plotting style can differ depending on the situation. For example, a straight line is drawn when two control points are input, and a triangle is drawn when three control points are input. Specifically, a point marker with only one control point corresponds to only one drawing scheme.
[0032] (2) Plotting Algorithm Library Module
[0033] The plotting algorithm library module provides algorithm support for plotting, including Bézier interpolation and geodetic interpolation algorithms.
[0034] The plotting algorithm library module implements basic plotting algorithms for various types of fundamental graphics, such as:
[0035] Unclosed lines: such as straight lines, curves, fixed dashed lines, parallel double straight lines, parallel hyperbolas, etc.;
[0036] Closed lines: such as circles, polygons, kidney diagrams, etc.;
[0037] The plotting algorithm library module also provides basic graphic calculation functions, enabling various graphic calculation functions such as calculating the position of two points at a specific ratio, calculating the perpendicularity of a line, and calculating the distance between two points, which are used to generate new coordinate points when drawing plotting templates.
[0038] (3) Plotting module
[0039] The plotting module is used to actually draw plotted objects. Users input information through a graphical interface or API. The system retrieves the corresponding plotting template based on the user-input plotting library number (lib) and label code, and instantiates the template into a specific plotted object based on the user's input. Plotting display attributes include line color, overall transparency, fill color, fill texture, text, and text color. When the user modifies plotted object attributes or control points, the plotting module will update the corresponding attributes or regenerate the plotted object accordingly.
[0040] like Figure 2 As shown, the method for creating a plotting template includes the following steps:
[0041] Step 1. First, set the initial properties of the graph. These properties are used for the subsequent definition of the graph and will also be written to the graph template file and the graph library. The initial properties in the graph template include the graph identifier, such as the graph library number Lib, the graph number Code in the graph library, the default color, the graph name, the graph preview image, the graph description, etc.
[0042] Step 2. Set the number of plotting schemes, dividing the plotting schemes for different numbers of input line marker control points, and setting the entry conditions for each case. For example, use plotting scheme 1 when there are 0-2 input control points, and use plotting scheme 2 when there are more than 2 input control points. In special cases, a point marker only needs one control point, so there is only one plotting scheme.
[0043] Step 3. Set up the plotting scheme flow under different control points. The implementation method is as follows:
[0044] Step 3.1 Add control points to the scheme;
[0045] Step 3.2 Based on the input control points in the previous step, create auxiliary lines, auxiliary calculation points, and auxiliary control points;
[0046] Step 3.3 Select the input control points and auxiliary control points to add graphic elements, and adjust the default values of the graphic element size and related attributes;
[0047] Step 3.4 Set the constraints of the drawing. After the current drawing scheme is set, start the next drawing scheme until all drawing schemes are set.
[0048] Step 4 confirms the end of the definition. The plotting template persistence submodule generates plotting template information in JSON or XML format and stores it in a file and database.
[0049] After the primitive information is calculated, primitives are merged, including merging Geometry, merging rendering states (StateSet), and sharing textures to optimize display efficiency. Text primitives are rendered using a shared text texture method. The text primitives are drawn using the shared texture method according to the following steps:
[0050] Step 1. Count the characters that need to be added to the large texture atlas, and create a small texture for each character;
[0051] Step 2. Organize the generated character textures according to the Unicode codes of the characters, etc., so as to create texture atlases later;
[0052] Step 3. Combine all the small textures of the characters into a large texture atlas;
[0053] Step 4. Calculate the position and texture coordinates of each character in the large texture atlas to facilitate accurate texture positioning and sampling during subsequent rendering;
[0054] Step 5. Integrate the generated large texture atlas into the rendering pipeline, using shared textures and texture coordinates to render each character.
[0055] like Figure 3As shown, the process of creating a plotting object using a plotting template and then drawing the plotting is as follows:
[0056] Step 1: The user sets the plotting library number (lib) and plotting code (Code). The plotting module will automatically match the corresponding plotting template;
[0057] Step 2: The user inputs plotting control points. The plotting module will match the corresponding drawing scheme according to the number of input control points, calculate the position of auxiliary lines, auxiliary control points, auxiliary control lines, vertex coordinates, vertex colors, textures, and texture coordinates of primitives based on the input control points, and submit the primitive information for rendering.
[0058] Step 3: Set the display attributes of the plotted object, such as line color, fill color, and text content. The system updates the vertex coordinates, vertex color, texture, and texture coordinates of the primitive according to the set attributes, and submits the primitive information for rendering.
[0059] Example
[0060] Taking the definition of a plot with two control points, the center of each control point being a circle with arrows at both ends as an example, the process of creating the plot template is as follows:
[0061] Step 1: In the plotting customization module, select to create a new plotting template;
[0062] Step 2: Add a case where one control point is input into the newly created plotting template. When the number of input control points is 1, output the point primitives of the control point position.
[0063] Step 3: Add the case of inputting two control points to the newly created plotting template;
[0064] Step 4: Add auxiliary control points to the plotting template and set the information for each auxiliary control point (through the interface visualization operation; in actual use, it is a simple operation of connecting lines, clicking, and right-clicking to set).
[0065] Auxiliary control point 1: The midpoint of the line connecting control points 1 and 2;
[0066] Auxiliary control point 2: It is obtained by shifting the distance between control points 1 and 2 by 10% from the position of control point 1 in the direction from control point 1 to auxiliary control point 1;
[0067] Auxiliary control point 3: It is obtained by shifting the distance between control points 1 and 2 by 10% from the position of control point 2 in the direction from control point 1 to auxiliary control point 1;
[0068] Step 5: Add graphic elements to the plotting template and set the information of the graphic elements;
[0069] Line segment 1: Starting point control point 1, ending point control point 2;
[0070] Circle: The radius of the circle is 10% of the distance between the auxiliary control points 1 and 2. The element attribute is set to fillable. The default is no fill. Solid color fill. The fill color follows the plot color by default.
[0071] Arrow 1: The arrow's vertex is controlled by point 1, the arrow's tail is midpoint, and the auxiliary control point is 2. The arrow's length is 10% of the distance between control point 1 and auxiliary control point 2. The arrow's apex angle is 30. The primitive attribute is set to fillable, with the default fill color following the plotting color.
[0072] Arrow 2: The arrow's vertex is controlled by point 2, the arrow's tail is midpoint, and the auxiliary control point is 3. The arrow's length is 10% of the distance between control point 2 and auxiliary control point 3. The arrow's apex angle is 30. The primitive attribute is set to fillable, with the default fill color following the plotting color.
[0073] Step 6: Set constraints for the graphic;
[0074] Set constraints: The distances between auxiliary control point 2 and control point 1, and between auxiliary control point 3 and control point 2 are equal (when the position of auxiliary control point 2 is adjusted on the line connecting control points 1 and 2, auxiliary control point 3 also moves synchronously, and vice versa).
[0075] Step 7: Add a case where three or more control points are entered into the new plotting template. Set the plotting process to not draw in this case and exit the drawing process directly.
[0076] Step 8: Save the plotting template. The system will serialize the set information into JOSN or XML format and save it to the file and database.
[0077] Using the same plot as an example, the plotting process is as follows:
[0078] Step 1: The user selects the number of the plot to be drawn. The system searches for the corresponding plot template based on the number. If no template is found, the system exits the plotting process; otherwise, it loads the found template.
[0079] Step 2: The user inputs control points, and the system matches the corresponding situation in the plotting template according to the number of input control points. When the number of control points is 1, the point primitives at the control point positions are directly output. When the number of control points is 3 or more, the drawing process is exited. When there are 3 control points, the next step is performed.
[0080] Step 3: The system calculates the position of each auxiliary control point in the template one by one according to the order of the auxiliary control points. The positions of auxiliary control points 1, 2, and 3 are calculated in sequence. The algorithm for calculating the midpoint of the line segment and the translation algorithm are provided by the plotting algorithm library module.
[0081] Step 4: The system creates primitives according to the primitive information in the template, and calculates the vertex coordinates, vertex color, texture, and texture coordinates of each primitive. It calculates the vertex coordinates and vertex color of line segment 1 and the circle; it searches for a texture in the shared texture pool based on the fill color or creates a fill texture and adds it to the shared texture pool; and it calculates the vertex coordinates, vertex color, and texture coordinates of arrows 1 and 2.
[0082] Step 5: The system iterates through the primitives of each plotted object in the data processing thread, extracts the vertex coordinates, vertex colors, and texture coordinates of the primitives, merges them according to the rendering state, and submits the rendering after the merging is completed.
[0083] In summary, this invention abstracts the common structure of plotting in actual use. When defining plotting, only the structure and constraints of the plotting itself need to be defined without involving the actual algorithm implementation, which can greatly improve efficiency. At the same time, by replacing the algorithm with a better general structure, the drawing efficiency and display effect of large-scale plotting can be optimized without manually modifying the algorithm of each plotting.
[0084] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0085] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these modifications and improvements all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A plotting system based on a plotting template, characterized in that, It includes a custom plotting module, a plotting algorithm library module, and a plotting drawing module, among which: The plotting customization module is used to construct plotting templates according to standardized plotting template specifications. The plotting templates describe graphic information and basic plotting information. The graphic information includes control points, auxiliary points, auxiliary lines, plotting elements, and graphic constraints. The basic plotting information includes the plotting name and number. The plotting algorithm library module provides algorithmic support for plotting. The plotting module is used to draw plotted objects. Based on the plotting information input by the user, including the plotting library number (lib), plotting number (Code), plotting control point information, and plotting display attributes, it retrieves the corresponding plotting template and instantiates the plotting template into a specific plotting object.
2. The plotting system based on plotting templates according to claim 1, characterized in that, The plotting customization module includes a plotting customization interface submodule, a plotting template specification submodule, and a plotting template persistence submodule, wherein: The plotting custom interface submodule is used to create plotting templates through visual interaction, and set the properties of the plotting template, including the plotting library number Lib, the plotting number Code in the plotting library, the default color, the plotting name, the plotting preview image, and the plotting description; The plotting template specification submodule is used to save and provide plotting template specification information for use by the plotting custom module. It provides basic support for creating basic plotting templates, including plotting template specifications, blank plotting templates, and basic graphic element information. The plotting template persistence submodule is used to convert the created plotting template into a persistent JSON or XML format and save it to the plotting template file and the plotting database.
3. The plotting system based on plotting templates according to claim 1, characterized in that, In the plotting template, a control point is a single coordinate point, while the control points of a line marker are a set of coordinate points, using latitude and longitude coordinates in the coordinate format. Auxiliary points are coordinate points calculated based on multiple control points, including: points located at a certain proportion of a line segment starting from a point on the line connecting two points; points located at a certain distance on the perpendicular line connecting two points; and points obtained by rotating one point around another by a certain angle. Auxiliary lines are straight lines calculated based on control points and auxiliary points. Graphical elements are basic graphic elements drawn based on control points, auxiliary points, and auxiliary lines as positioning points, including line segments, curves, polygons, kidney shapes, and text. The size and position of the graphic elements are determined by the positioning points. Graphical constraints are the constraints between control points, auxiliary points, auxiliary lines, and plotted elements. They are used to adjust the position and attributes of control points, auxiliary points, auxiliary lines, and elements when plotting and updating shapes.
4. The plotting system based on plotting templates according to claim 3, characterized in that, The plotting template allows for different plotting drawing schemes depending on the number of control points. When two control points are input, a straight line is drawn; when three control points are input, a triangle is drawn; and when a point has only one control point, it corresponds to only one drawing scheme.
5. The plotting system based on plotting templates according to claim 1, characterized in that, The plotting algorithm library module provides drawing algorithms for basic graphics, which are divided into two categories: open lines and closed lines. Open lines include: straight lines, curves, fixed dashed lines, parallel double straight lines, and parallel hyperbolas; closed lines include circles, polygons, and kidney shapes. At the same time, it provides basic graphic calculation functions to realize the calculation of specific proportional positions between two points, the calculation of perpendicular lines, and the calculation of distances between two points, which are used to generate new coordinate points when drawing plotting templates.
6. A plotting method based on a plotting template, characterized in that, Using the plotting template-based plotting system according to any one of claims 1-5, plotting is performed, and the specific process is as follows: Set the plotting library number (lib) and plotting number (Code) to automatically match the corresponding plotting template; Input the plotting control points, match the corresponding drawing scheme according to the number of input control points, calculate the position of auxiliary lines, auxiliary control points, auxiliary control lines, vertex coordinates, vertex color, texture, and texture coordinates of primitives based on the input control points, and submit the primitive information for rendering; Set the display properties of the plotted object, including line color, fill color, and text content. Update the vertex coordinates, vertex color, texture, and texture coordinates of the primitive according to the set properties, and submit the primitive information for rendering.
7. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it performs plotting using the plotting drawing system based on a plotting template as described in any one of claims 1-5.
8. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it performs plotting using the plotting drawing system based on a plotting template as described in any one of claims 1-5.
Citation Information
Patent Citations
WebGIS-based military standard symbol plotting system and method
CN116681798A
Electronic chart-based primitive plotting and management method
CN117171280A