Electronic chart vector graph plotting method
By encapsulating the vector graphics drawing module in the electronic chart system, loading and analyzing the SVG file, the adaptive drawing and multi-cycle accurate drawing functions of the SVG file are realized, and the storage, management and display problems of the existing electronic chart SVG drawing methods are solved, and the practicality and accuracy of the sea chart drawing are improved.
Patent Information
- Application Number
- CN202411982348.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-04-29
AI Technical Summary
The existing SVG drawing method of electronic charts has problems such as limited storage and management methods, difficulty in reading, rough vector display, and poor operability, and cannot effectively utilize the characteristics of the SVG format.
By encapsulating the vector graphics drawing module, it is used as a plug-in function in the electronic chart drawing system, loading SVG file parsing information, storing and classifying, realizing the adaptive drawing and multi-loop accurate drawing functions of SVG files.
The effect of lossless drawing is achieved, the practicality and accuracy of sea icon drawing is improved, and the problem of poor types of traditional electronic sea icon drawing elements and complicated steps to add elements are solved.
Smart Images

Figure CN119904596A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an electronic chart vector graphics marking method, which mainly realizes the SVG marking and drawing function on the electronic chart interface, achieves the effect of lossless drawing, and the marking and drawing has adaptive drawing and multi-cycle accurate drawing functions, thereby improving the practicability and accuracy of chart drawing. Background Art
[0002] The Electronic Chart System (ECDIS) is an innovative marine information technology that provides an efficient and accurate marine navigation solution by integrating digital charts with ship management software. This system can display the precise position of the ship on the chart in real time. At the same time, it also has advanced route planning functions, allowing crew members to formulate and adjust routes based on current sea and weather conditions to ensure safe and economical navigation. In addition, ECDIS also supports automatic recording of ship navigation data, providing valuable information resources for ship management, accident investigation and marine education. Through these advanced software functions, the electronic chart system not only improves the efficiency and safety of navigation, but also provides crew members with an intuitive and easy-to-operate navigation environment, which is an indispensable part of modern navigation. At present, the drawing methods of electronic nautical charts are mainly divided into primitive drawing and vector graphics (SVG) drawing methods. Primitive drawing requires dividing the graphics into three elements: points, lines, and surfaces. Adding a primitive requires a large amount of engineering work, and the adaptability to multiple primitives is poor; SVG drawing can draw a primitive as a whole, which is suitable for the use of a large number of graphics. However, the existing SVG drawing method has limitations. In terms of storage and management, there are problems such as limited addition formats and difficulty in reading. In terms of display and control, there are problems such as rough vector display and poor operability, which cannot give full play to the characteristics of the SVG format. Summary of the invention
[0003] In view of the deficiencies in the prior art, the present invention provides a method for marking vector graphics of electronic nautical charts, proposes a feasible SVG file drawing implementation scheme, and provides a technical solution for the electronic nautical chart element marking system. A method for plotting vector graphics of an electronic nautical chart, the present invention adopts the following technical scheme: (1) SVG storage and management (1.1) By encapsulating the vector graphics drawing module, it can be used as a plug-in function in the electronic nautical chart drawing system. (1.2) By loading the SVG file, the SVG format information is parsed and stored in the menu bar system. The menu bar displays the SVG file thumbnail and related name. The original height, width, line width and other information of the SVG file will be recorded. (1.3) According to the information recorded in the SVG file, the SVG is classified and screened based on the database system and stored in different groups. (2) SVG plotting and display (2.1) By double-clicking the stored SVG thumbnail icon in the menu bar, you can enter the drawing state of the corresponding icon; in the drawing state, use the mouse to select a coordinate point on the electronic chart, and the SVG file will be drawn to the coordinate point position. The drawing can be continued until the drawing mode is exited; according to the pixel size of the SVG file itself, the algorithm calculates the Enve l ope attribute value of the SVG element as the basis for judging whether the current element is located in the display part of the chart. Elements that are not located in the display part of the chart are not drawn to save system resources. (2.2) After the primitive is drawn, it will be bound to a unique MapID attribute, with MapID as the index value, and the primitive latitude and longitude, coordinate point and other information will be recorded in the hash table. (2.3) After the primitive is drawn, it is bound to the loop drawing attribute to detect whether the sea layer is drawn multiple times. The screen points for multiple drawing are calculated using geographic spatial information points, and the drawing is done accurately multiple times. (2.4) The SVG file is drawn using a separate layer independent of the electronic chart. The refresh of the chart is bound to the refresh of the graphic layer through the signal and slot mechanism. When the chart layer is dragged and rotated, the algorithm automatically updates the drawing status and information of the graphic layer by calculating the recorded graphic information. (3) SVG plotting interaction (3.1) Click the SVG drawing drawn on the map with the left button of the mouse, and generate three function points based on the Envelope judgment area generated during drawing. By dragging different function points, you can realize the functions of clicking and dragging the current drawing to translate, clicking to modify the rotation angle of the current drawing, and clicking to modify the size of the current drawing. After each modification action is completed, the hash table will automatically update and record the new status information, location information, etc. of the current drawing. (3.2) Right-click on the SVG plot that has been drawn on the map to provide a submenu bar selection function at the current location. The menu bar has the functions of copy, paste, cut, and delete. The new plot generated by copying and pasting will generate a new key value in the hash table, and the plot changed by cutting and pasting will record the change of the original plot information. The beneficial effects of the present invention are: (1) The present invention provides a vector graphics drawing method based on electronic nautical charts, which introduces the function of SVG file drawing, thereby solving the problems of the lack of drawing element types in traditional electronic nautical charts and the cumbersome steps of adding element types. (2) The mapping method provided by the present invention introduces the Envelope attribute setting, and determines whether the primitive needs to be drawn according to the Envelope attribute of the primitive, which helps to improve the system fluency when a large number of primitives exist. (3) The mapping method provided by the present invention distinguishes the mapping layer from the nautical chart layer, and binds the parameters of the layers through a signal mechanism. While ensuring the separation of the layers, the mapping layer is also updated in real time as the nautical chart layer is dragged and rotated. BRIEF DESCRIPTION OF THE DRAWINGS
[0004] Figure 1 is a flow chart of the method of the present invention; Figure 2 is a flow chart of SVG storage and management of the present invention; Figure 3 is a flow chart of the drawing and display method of the present invention; Figure 4 It is the SVG plotting interaction flow chart of the present invention; DETAILED DESCRIPTION
[0005] This study focuses on the application of SVG drawing technology in electronic nautical chart systems and explores how to use SVG technology to achieve dynamic presentation and interactive functions of nautical charts. With the diversification of electronic nautical chart requirements and the advancement of navigation technology, SVG drawing technology, with its high scalability and excellent interactivity of vector graphics, provides strong support for the dynamic display and user interaction of electronic nautical charts. In order to make the purpose and technical solution of the present invention clearer, the present invention is further described below in conjunction with the accompanying drawings. The specific implementation method of the present invention is as follows: See also Figure 2 , which shows a flow chart of the SVG storage and management method implemented by the present invention, and the specific steps are as follows: (1.1) By loading the existing SVG file information, create the corresponding ECustomPlottingType enumeration type to record the type of the currently drawn graphic. (1.2) Parse the XML information stored in the current SVG file, and record the line width, actual height, actual width, and grouping status of the required line through keyword search and filtering. Automatically create a tree structure based on the grouping information to facilitate subsequent indexing of the graphics elements. (1.3) Based on the SVG file name in the enumeration type, a query function can be performed to locate and display the grouped area of the searched plot. See also Figure 3 , which shows a flow chart of the method for drawing and displaying SVG plotting implemented by the present invention, and the specific steps are as follows: (2.1) Read the current drawing type information; enter the drawing state; (2.2) Select the drawing point by clicking the mouse, record the coordinate system position information of the current selected point, and convert it into longitude and latitude coordinate data. After clicking and adding, the coordinate position information, drawing time information, drawing size, drawing rotation angle, and drawing record of the current drawing are added to the associated container. (2.3) The algorithm calculates the geographic space coordinate information (GeoPoint) corresponding to the selected screen coordinate point (ScrPoint), and GeoPoint records the coordinate attribute value of the geographic space cycle (GeoCycle). By introducing this value, the ScrPoint point is recalculated when the chart interface is dragged, ensuring that when the electronic chart is drawn multiple times due to the large scale, the graphics element is accurately drawn multiple times according to the number of cycles. (2.4) Render the SVG image in pixmap format and assign it the Envelope attribute. The Envelope attribute is an attribute of the outline of the element that is adaptively selected based on the element information of different SVG elements. On the one hand, this attribute provides a basis for the subsequent mouse click operation to determine the selected element. On the other hand, it calculates whether the Envelope overlaps with the current chart interface. If not, it is determined that the element is not in the current chart area and the element is not drawn. (2.5) Traverse the MAP associated container generated by the drawing, read the basic drawing information, and display it in the sub-window; in the sub-window, the information of the drawing can be modified, and whether the drawing is drawn is determined by judging whether the Isdraw parameter that controls the drawing is selected. See also Figure 4 , which shows a flow chart of the SVG plotting interaction method implemented by the present invention, and the specific steps are as follows: (3.1) Determine whether the mouse click position on the screen coincides with the drawn SVG icon canvas frame. The judgment logic is: set a pixel distance threshold. If the distance between the click position and the canvas frame is lower than the threshold, the judgment is considered successful. If there is overlap between the markings, the drawing order is prioritized. (3.2) When the left mouse button is pressed successfully, the canvas frame will be provided with translation, rotation, and resizing functions based on its location. The associated container that records the plotting attributes contains relevant numerical records. When the mouse is dragged to modify, the data in the associated container is recorded synchronously with the dragging change to ensure data accuracy and real-time performance. (3.3) If the right-click judgment is successful, a submenu will be provided for cutting, copying, pasting, and deleting functions; select the plot and right-click to copy, and right-click anywhere on the chart to select the paste function to generate a copy of the original plotted graphics, and record the plotted data after the modified position coordinates in the associated container; select the plot and right-click to cut, and right-click anywhere on the chart to paste, the original plotted data in the associated container is deleted, and the new plotted data is recorded.
Claims
1. A method for plotting vector graphics of an electronic nautical chart, characterized in that: The vector graphics plotting and control method based on electronic nautical charts includes three parts: SVG plotting storage and management, SVG plotting drawing and display, and SVG plotting interaction. The SVG plotting storage and management method supports unified classification and management of SVG images, and stores SVG files in the corresponding group menu bar and displays them as icons at the same time. The SVG plotting drawing and display method supports drawing SVG files under the group menu bar, and stores relevant drawing information in the drawing layer to achieve lossless plotting function. The SVG plotting interaction method supports copying, cutting, moving, deleting and other functions of the plotted SVG files by dragging and clicking the mouse.
2. The method for plotting vector graphics of an electronic nautical chart according to claim 1, characterized in that: The SVG plotting storage and management method includes a group storage function for the read SVG files, and the SVG files are read and stored in the Filenameall file; Each SVG file is assigned as a unique AnimationButton button and dynamically displayed in the system. The AnimationButton button is assigned animation event module, click event module and query event module, and the events are bound to corresponding functions through the signal and slot mechanism.
3. The method for plotting vector graphics of an electronic nautical chart according to claim 1, characterized in that: The SVG plotting and displaying method includes double-clicking the corresponding SVG thumbnail file in the menu bar, and the electronic chart system enters the plotting mode of the corresponding file. At this time, by clicking on a point in the chart, the coordinates of the corresponding screen pixel point are obtained according to the mouse position and converted into longitude and latitude information. At this time, the corresponding SVG file is drawn to the clicked position, and the plotting information drawing time, drawing longitude and latitude, etc. are stored and recorded in the relevant hash table for subsequent processing. At the same time, based on the loop drawing variable value, the screen point map is drawn based on the geographic space point value calculation loop, and multiple points are accurately drawn in the chart system. The drawing primitive is given the Envelope attribute, which is used for mouse control judgment and whether the primitive is drawn to save system resource space. The SVG file drawing layer is a separate layer independent of the chart display system. It is covered on the chart display interface as a new canvas. By reading the global variable DrawPara, the parameters of the current canvas and the chart canvas are unified. When the chart is zoomed and dragged, the SVG plot reads the current parameters in real time and performs adaptive drawing.
4. The method for plotting vector graphics of an electronic nautical chart according to claim 1, characterized in that: When you click the left button of the mouse on a single plot drawn on the electronic chart system, three points are provided according to the pattern adaptation, corresponding to the methods of clicking and dragging to modify the plot position, dragging to modify the plot angle, and dragging to modify the plot size. Click and drag to modify the plot position, and the plot will follow the mouse track in real time to display the preview effect. When the left button of the mouse is released, the dragging is completed, and the corresponding plot position information stored in the hash table is synchronously updated; Click and drag to modify the plot angle function to achieve the plot rotation with the custom angle of the mouse pointer, and store the rotation angle information in the hash table after rotation; The function of clicking and dragging to modify the size of the plot can realize the custom change of the icon size by dragging the mouse, supports arbitrary aspect ratio modification, and stores the changed information in the hash table. When you right-click a single plot drawn on the electronic chart system, a submenu selection window is provided, with cut, copy, paste, and attribute function selections; the new plot obtained by the copy and paste function will be stored as a new key value.