Graph selection rendering method and device for realizing stepless scaling of electronic chart and medium
Through algorithms for dynamically selecting and rendering chart data, the stepless scaling and intelligent cache of electronic chart systems are realized, solving the problems of restricted scaling and slow chart loading in the existing technology, and improving the chart rendering efficiency and user experience.
Patent Information
- Application Number
- CN202411606128.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-04
AI Technical Summary
The existing electronic chart system cannot achieve true stepless scaling. The scaling operation is limited by the preset editing scale, which limits the user's operation flexibility and continuity. At the same time, due to the lack of an effective caching mechanism, the chart loads slowly.
The algorithm for dynamically selecting and rendering chart data can realize stepless scaling, determine the scale range of the chart editing scale based on the current screen display scale, filter and divide the chart graph into a set of scales that reduce, match and enlarge the graph, and process the latitude and longitude ranges of the viewport and the area to be cached in the rendering thread and the cache thread respectively to achieve fast loading and smooth display.
It realizes the fast and clear presentation of chart data, improves the flexibility and convenience of user operations, reduces system resource consumption, and improves user experience.
Smart Images

Figure CN119559277A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electronic nautical chart rendering, and in particular to a method, device and medium for selecting and rendering an electronic nautical chart for achieving stepless zooming. Background Art
[0002] In the existing electronic chart system, since the chart is usually designed based on a fixed editing scale, the editing scale of the electronic chart is currently divided into multiple levels, which are divided according to the detail level and application scope of the chart. Generally speaking, the editing scale levels of electronic charts include but are not limited to the following:
[0003] Large scale: 1:3 million and below: These editorial scales are usually used to show large areas of the sea, such as the world or transoceanic shipping routes;
[0004] Medium scale: 1:1.5 million, 1:700,000, 1:350,000, etc. These editing scales are suitable for displaying larger areas of sea, such as shipping routes or important sea areas between coastal countries;
[0005] Small scale: 1:180,000, 1:90,000, 1:45,000, 1:22,000, 1:12,000, 1:8,000, 1:4,000, etc. These editing scales provide more detailed sea area information, which are suitable for navigation and positioning in coastal, nearshore, port and berth areas.
[0006] In traditional ECS (Electronic Chart System) / ECDIS (Electronic Chart Display and Information System), the system designs the corresponding display scale according to the preset editing scale. Under a specific display scale, the system will directly call the chart sheet corresponding to the editing scale for rendering. This method cannot achieve true stepless zooming. The zooming operation is often limited by the preset editing scale, which limits the flexibility and continuity of the user when performing the zooming operation.
[0007] At the same time, due to the lack of a caching mechanism or the caching mechanism is not smart enough, it is impossible to effectively reduce data loading time and increase data reuse rate, resulting in slow chart loading. Summary of the invention
[0008] In view of this, the purpose of the present invention is to propose a chart selection and rendering method that realizes stepless scaling of electronic nautical charts, improve the chart rendering efficiency and operation convenience of terminal devices such as ECS (electronic chart system) and ECDIS (electronic chart display and information system), realize fast and clear presentation of chart data, while reducing system resource consumption and improving user fluency and satisfaction during use.
[0009] In order to achieve the above technical objectives, the technical solution adopted by the present invention is:
[0010] The present invention provides a method for selecting and rendering an electronic nautical chart for achieving stepless zooming, comprising the following steps:
[0011] Step 1: Determine the scale range for editing the chart according to the current screen display scale, maximum reduction factor, and maximum magnification factor;
[0012] Step 2: Filter out the chart sheets whose editing scales are within the editing scale range of the chart from all the chart sheets, and divide them into a reduced chart sheet set, a matched chart sheet set, and an enlarged chart sheet set;
[0013] Step 3, executing the rendering thread: calculating the latitude and longitude range of the current screen viewport at the current screen display scale according to the center point position of the current screen viewport and the current screen display scale; calculating the minimum set of rendered chart sheets that matches the latitude and longitude range of the current screen viewport from the matching sheet set, the enlarged sheet set and the reduced sheet set in accordance with the sheet set checking process; querying from the memory to determine whether the minimum set of rendered chart sheets has been cached, if so, selecting the tile corresponding to the sheet with the closest scale from the memory for rendering; if not, loading the sheets of the minimum set of rendered chart sheets and cutting them into tiles according to different scales and storing them in the memory, selecting the tile corresponding to the sheet with the closest scale from the memory for rendering;
[0014] Step 4, execute the cache thread: calculate the longitude and latitude range of the predicted area at different scales according to the center point position of the current screen viewport and the current screen display scale; add the longitude and latitude ranges at different scales to the area to be cached; calculate the minimum set of nautical chart sheets to be cached that matches the area to be cached from the matching sheet set, the enlarged sheet set and the reduced sheet set in turn according to the sheet set inspection process; load the sheets in the minimum set of nautical chart sheets to be cached and cut them into tiles according to different scales and store them in the memory; Step 3 and Step 4 are executed simultaneously, without any order.
[0015] Furthermore, the step 1 specifically includes:
[0016] Step 11, defining the maximum allowable reduction factor r1, the maximum allowable enlargement factor r2 and the current screen display scale r;
[0017] Step 12: Based on the maximum allowable reduction factor r1, the maximum allowable magnification factor r2 and the current screen display scale r, determine that the chart editing scale range is [r / r1, r*r2].
[0018] Furthermore, the step 2 specifically includes:
[0019] Step 21, traverse all chart sheets, and filter out the sheets whose editing scales are within the editing scale range of the chart;
[0020] Step 22: divide the map with an editing scale smaller than the current screen display scale r into a reduced map set; divide the map with an editing scale equal to the current screen display scale r into a matched map set; divide the map with an editing scale larger than the current screen display scale r into an enlarged map set.
[0021] Step 23, the maps with the same editing scale size in all the maps in the reduced map set are grouped together, and each group is arranged in order from large to small; all the maps in the matching map set are grouped together; all the maps in the enlarged map set with the same editing scale size are grouped together, and each group is arranged in order from small to large.
[0022] Furthermore, in step 4, the latitude and longitude ranges of the prediction area at different scales are calculated according to the center point position of the current screen viewport and the current screen display scale; and the latitude and longitude ranges at different scales are added to the to-be-cached area; specifically including:
[0023] Step 41, real-time monitoring of the center point of the current screen viewport and the current screen display scale r;
[0024] Step 42: fix the center point of the current screen viewport to remain unchanged, and expand the boundary of the current screen viewport outward to form a prediction area;
[0025] Step 43: Calculate the latitude and longitude ranges of the prediction area at different scales based on the plane coordinate information, longitude and latitude information of the center point of the current screen viewport and the current screen display scale r:
[0026] 1) If there is no inertial operation, the edit scale range of the prediction area is [r / r1, r*r2]; calculate the latitude and longitude range of the prediction area at multiple scales obtained by equidistant interpolation processing within the scale range of r, r / r1, r*r2, (r / r1, r) and multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2);
[0027] 2) If there is a reduction inertia, the editing scale range of the prediction area is [r / r1 / n1, r*r2], where n1 represents the expansion reduction multiple, and the value of n1 is set by the user; the latitude and longitude ranges of the prediction area are calculated at multiple scales obtained by equidistant interpolation processing within the scales of r, r / r1, r*r2, [r / r1 / n1, r / r1), multiple scales obtained by equidistant interpolation processing within the range of (r / r1, r), and multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2);
[0028] 4) If there is a magnification inertia, the editing scale range of the prediction area is [r / r1, r*r2*n2], where n2 represents the expansion magnification factor and the value of n2 is set by the user; the latitude and longitude range of the prediction area is calculated at scales of r, r / r1, r*r2, multiple scales obtained by equidistant interpolation processing within the range of (r / r1, r), multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2), and multiple scales obtained by equidistant interpolation processing within the range of (r*r2, r*r2*n2);
[0029] Step 44: Mark the predicted areas with multiple groups of longitude and latitude ranges calculated as areas to be cached.
[0030] Furthermore, the step 42 specifically includes:
[0031] Step 421, record each zoom-in or zoom-out operation of the user, including the timestamp of the operation, the operation type, and the scale after the operation; record the direction and distance of each translation operation of the user, and the center point position of the current screen viewport after the operation;
[0032] Step 422: setting inertia judgment thresholds, including time thresholds, operation times thresholds, and direction consistency thresholds;
[0033] Step 423: If the user continuously performs multiple zoom-in or zoom-out operations within the time threshold, and the number of operations exceeds the set operation number threshold, it is determined to be an inertial operation; the center point position of the current screen viewport is fixed unchanged, and the boundary of the current screen viewport is expanded outward within the same set range to form a prediction area; if the zoom-in inertia is used, the editing scale range under the prediction area is adjusted to [r / r1, r*r2*n2], where n2 represents the expansion magnification, and the value of n2 is set by the user; if the zoom-out inertia is used, the editing scale range under the prediction area is adjusted to [r / r1 / n1, r*r2], where n1 represents the expansion reduction multiple, and the value of n1 is set by the user;
[0034] Step 424: If the user performs multiple translation operations in the same direction within the time threshold, and the number of operations exceeds the set direction consistency threshold, it is determined to be an inertial operation; the center point position of the current screen viewport is fixed unchanged, the boundary of the current screen viewport is expanded outward within the same set range, and then a set range is expanded outward along the translation direction to form a prediction area.
[0035] Further, in step 3, according to the map set checking process, the minimum set of rendered chart sheets that matches the latitude and longitude range of the current screen viewport is calculated from the matching map set, the enlarged map set and the reduced map set in turn, and in step 4, according to the map set checking process, the minimum set of to-be-cached chart sheets that matches the to-be-cached area is calculated from the matching map set, the enlarged map set and the reduced map set in turn; specifically, it includes:
[0036] Step a1, initializing the remaining viewports, where the initialized remaining viewports are the same as the current screen viewport / area to be cached;
[0037] Step a2, selecting the first image frame in the matching image frame set as the current image frame, and proceeding to step a3;
[0038] Step a3, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a4; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a4; if not, return all selected target maps as the minimum set of rendered chart sheets / minimum set of chart sheets to be cached;
[0039] Step a4, determining whether all the images in the matching image set have been traversed, if so, proceeding to step a5; if not, selecting the next image in the matching image set as the current image, and returning to step a3;
[0040] Step a5, selecting the first picture frame in the enlarged picture frame set as the current picture frame, and proceeding to step a6;
[0041] Step a6, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a7; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a7; if not, return all selected target maps as the minimum set of rendered chart sheets / minimum set of chart sheets to be cached;
[0042] Step a7, determining whether all the images in the enlarged image set have been traversed, if so, proceeding to step a8; if not, selecting the next image in the enlarged image set as the current image, and returning to step a6;
[0043] Step a8, selecting the first picture frame in the reduced picture frame set as the current picture frame, and proceeding to step a9;
[0044] Step a9, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a10; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a10; if not, return all selected target maps as the minimum set of rendered chart sheets / minimum set of chart sheets to be cached;
[0045] Step a10, determine whether all the pictures in the reduced picture set have been traversed. If so, it means that there is no minimum set of nautical chart pictures that completely matches the current screen viewport / area to be cached, and the process ends; if not, select the next picture in the reduced picture set as the current picture, and return to step a9.
[0046] Furthermore, in the steps a3, a6 and a9, determining whether the latitude and longitude range of the bounding box of the current image sheet intersects with the latitude and longitude range of the current remaining viewports specifically includes:
[0047] Step a31, define the latitude and longitude range of the current remaining viewport and convert it into a polygon object;
[0048] Step a32, defining the latitude and longitude range of the bounding box of the map sheet, and converting it into a polygon object;
[0049] Step a33, create a Clipper object using the clipping library and configure it to perform an intersection operation;
[0050] Step a34, taking the polygonal object of the current remaining viewport as the clipping object, taking the polygonal object of the bounding box of the image sheet as the clipped object, and adding them to the Clipper object;
[0051] Step a35, performing an intersection operation and obtaining a polygon set, wherein the polygon set represents the intersection surface between the clipping object and the clipped object;
[0052] Step a36, check whether the polygon set returned by the intersection operation is empty. If it is empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport do not intersect; if it is not empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport intersect.
[0053] Furthermore, the step 3 of loading the minimum set of rendered nautical chart sheets and cutting them into tiles at different scales and storing them in the memory and the step 4 of loading the minimum set of nautical chart sheets to be cached and cutting them into tiles at different scales and storing them in the memory specifically includes:
[0054] Step b1, dividing the unbuffered target map sheets in the minimum set of rendered nautical chart sheets / the minimum set of nautical chart sheets to be cached into multiple groups of tiles according to geographical areas and different scales and loading them; the different scales include the current editing scales r', r' / r1 and r'*r2 of the target map sheets, each group of tiles includes multiple tiles, each tile covers an area on the target map sheet, and contains map data of the area at the corresponding scale;
[0055] Step b2: Record the usage status information of each tile, and when a user uses a tile, update the usage status information of the tile;
[0056] Step b3: Use the LRU cache elimination algorithm to clean up infrequently used tiles;
[0057] Step b4: Set up a regular cleaning mechanism to regularly check and clean tiles that are not frequently used;
[0058] Step b5: Set a cache space threshold. When the memory storage space is greater than the cache space threshold, start the LRU cache elimination algorithm to clean up infrequently used tiles.
[0059] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for selecting and rendering an electronic nautical chart for stepless zooming is implemented as described above.
[0060] The present invention also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the method for selecting and rendering an electronic nautical chart for stepless zooming is implemented as described above.
[0061] By adopting the above technical solution, the present invention has the following beneficial effects compared with the prior art:
[0062] 1. The present invention uses an algorithm that can dynamically select and render chart data according to user zoom requirements to achieve stepless zoom, that is, continuous zoom function, ensuring clear and continuous chart display at any zoom level. This ensures fast loading and smooth display of chart data, greatly improving the flexibility and convenience of user operation.
[0063] 2. Establish an intelligent cache system to automatically store and manage commonly used chart data blocks to improve chart performance. Through intelligent prediction and cache strategies, reduce repeated loading time and improve data access efficiency.
[0064] 3. The present invention greatly optimizes the user experience through stepless scaling and intelligent caching. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 The present invention provides an execution flow chart of a method for selecting and rendering an electronic nautical chart for implementing stepless zooming.
[0067] Figure 2 It is a schematic diagram of the calculation process of the minimum set of rendered chart sheets / the minimum set of cached chart sheets provided by an embodiment of the present invention.
[0068] Figure 3 It is a schematic diagram of an electronic device provided by an embodiment of the present invention.
[0069] Figure 4 It is a schematic diagram of a computer-readable storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0070] The present invention will be further described in detail below in conjunction with the accompanying drawings and examples. It is particularly noted that the following examples are only used to illustrate the present invention, but are not intended to limit the scope of the present invention. Similarly, the following examples are only partial embodiments of the present invention rather than all embodiments, and all other embodiments obtained by those of ordinary skill in the art without creative work are within the scope of protection of the present invention.
[0071] See also Figure 1 A method for selecting and rendering an electronic nautical chart for realizing stepless zooming of the electronic nautical chart of the present invention comprises the following steps:
[0072] Step 1: Determine the scale range for editing the chart according to the current screen display scale, maximum reduction factor, and maximum magnification factor;
[0073] In this embodiment, the step 1 specifically includes:
[0074] Step 11, define the maximum allowable reduction factor r1, the maximum allowable magnification factor r2 and the current screen display scale r; the maximum allowable reduction factor r1 and the maximum allowable magnification factor r2 are two key parameters for filtering the chart sheets;
[0075] Step 12: Based on the maximum allowable reduction factor r1, the maximum allowable magnification factor r2 and the current screen display scale r, determine the chart editing scale range as [r / r1, r*r2]. The chart editing scale range can be used to screen out qualified chart sheets and filter out unnecessary sheets, thereby reducing the amount of data and improving calculation efficiency.
[0076] For example: the current screen display scale is 1:10000, the multiples r1 and r2 are both 2, and the chart editing scale range is [1:20000~1:5000].
[0077] Step 2: Filter out the chart sheets whose editing scales are within the editing scale range of the chart from all the chart sheets, and divide them into a reduced chart sheet set, a matched chart sheet set, and an enlarged chart sheet set;
[0078] In this embodiment, step 2 specifically includes:
[0079] Step 21, traverse all chart sheets, and filter out the sheets whose editing scales are within the range of the chart editing scales; filter out the chart sheets within the range of the chart editing scales, filter out unnecessary sheets, reduce the amount of data, and improve calculation efficiency.
[0080] Step 22, divide the map sheets whose editing scale is less than the current screen display scale r and not less than r / r1 into a reduced map sheet set; divide the map sheets whose editing scale is equal to the current screen display scale r into a matching map sheet set; divide the map sheets whose editing scale is greater than the current screen display scale r and not greater than r*r2 into an enlarged map sheet set. The screened maps are divided into three sets in order to facilitate the priority selection of maps with a closer scale in the process of finding the minimum set of nautical chart sheets. Selecting a map with a scale closer to the map sheet can ensure that the accuracy and detail of the map content match the map sheet, and avoid information distortion or insufficiency caused by excessive or small scales;
[0081] Step 23, the maps with the same editing scale size in all the maps in the reduced map set are grouped together, and each group is arranged in order from large to small; all the maps in the matching map set are grouped together; all the maps in the enlarged map set with the same editing scale size are grouped together, and each group is arranged in order from small to large.
[0082] The sheets in each set will be further grouped according to their editing scales for easy management and selection. The grouping method is as follows: Assuming that the current screen display scale is 1:10000, the maximum reduction factor r1 and the maximum allowed magnification factor r2 are both 2, then the editing scale range is [1:20000~1:5000]. If the editing scales of sheets A and B are 1:5000, the editing scales of sheets C and D are 1:8000, the editing scales of sheets E and F are 1:10000, the editing scales of sheets G and H are 1:12000, and the editing scales of sheets I and J are 1:15000, the chart sheets are classified as follows:
[0083] Enlarge the image collection:
[0084] 1:5000: A, B
[0085] 1:8000: C, D
[0086] The collection is arranged in ascending order according to the editing scale size: C, D, A, B. The order within each group is not limited;
[0087] Matching image collection:
[0088] 1:10000: E, F
[0089] There is only one group in this set;
[0090] Reduce the image collection:
[0091] 1:12000: G, H
[0092] 1:15000: I, J
[0093] The order of the editing scale in this set from large to small is: G, H, I, J. The order within each group is not limited;
[0094] Step 3, executing the rendering thread: calculating the latitude and longitude range of the current screen viewport at the current screen display scale according to the center point position of the current screen viewport and the current screen display scale; calculating the minimum set of rendered chart sheets that matches the latitude and longitude range of the current screen viewport from the matching sheet set, the enlarged sheet set and the reduced sheet set in accordance with the sheet set checking process; querying from the memory to determine whether the minimum set of rendered chart sheets has been cached, if so, selecting the tile corresponding to the sheet with the closest scale from the memory for rendering; if not, loading the sheets of the minimum set of rendered chart sheets and cutting them into tiles according to different scales and storing them in the memory, selecting the tile corresponding to the sheet with the closest scale from the memory for rendering;
[0095] In this embodiment, in step 3, the minimum set of rendered nautical chart sheets that match the longitude and latitude range of the current screen viewport is calculated from the matching sheet set, the enlarged sheet set and the reduced sheet set in turn according to the sheet set checking process; the screen viewport refers to the longitude and latitude range of the current screen display, and each sheet also has its own longitude and latitude range. The longitude and latitude range of the sheet set covers the longitude and latitude range displayed on the screen, and the sheet set that meets the requirements is found. The minimum set of the sheet set is found by covering the longitude and latitude range displayed on the screen with as few sheets as possible.
[0096] like Figure 2 As shown, specifically including:
[0097] Step a1, initializing the remaining viewports, the initialized remaining viewports are the same as the current screen viewport;
[0098] Step a2, selecting the first image frame in the matching image frame set as the current image frame, and proceeding to step a3;
[0099] Step a3, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a4; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a4; if not, return all selected target maps as the minimum set of rendered chart maps;
[0100] Step a4, determining whether all the images in the matching image set have been traversed, if so, proceeding to step a5; if not, selecting the next image in the matching image set as the current image, and returning to step a3;
[0101] Step a2 to step a4 is to check the sheets in the matching sheet set according to the sheet set check process. When selecting sheets, first focus on the matching sheet set. In this set, the sheets with the same editing scale as the current screen display scale will be selected as the first choice. When selecting chart sheets, the sheets with the same scale are given priority because the sheets with the same scale have higher comparability and accuracy. Scale is a way to express the level of detail of the map content. Sheets with the same scale can ensure that the ratio of the distance on the map and the actual distance is consistent, so that it is more accurate when comparing and analyzing maps.
[0102] Step a5, selecting the first picture frame in the enlarged picture frame set as the current picture frame, and proceeding to step a6;
[0103] Step a6, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a7; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a7; if not, return all selected target maps as the minimum set of rendered chart maps;
[0104] Step a7, determining whether all the images in the enlarged image set have been traversed, if so, proceeding to step a8; if not, selecting the next image in the enlarged image set as the current image, and returning to step a6;
[0105] Step a5 to step a7 is to check the maps in the enlarged map set according to the map set checking process. If the minimum set of rendered chart maps cannot be obtained in the matching map set, the enlarged map set will be turned to. In the enlarged map set, the enlarged map set checking process will be traversed in the order of editing scale from small to large, that is, the maps with a scale close to the current screen display will be checked first. Selecting a map with a scale closer to the map can ensure that the accuracy and detail of the map content match the map, avoiding distortion or insufficiency of information caused by too large or too small a scale.
[0106] For example, if E and F in the matching map set are checked and do not occupy the entire screen viewport range, that is, the remaining viewport is not empty, then maps C and D in the 1:8000 group will be checked first, and then maps A and B in the 1:5000 group will be checked.
[0107] When selecting the order of enlarged map sheet set and reduced map sheet set, when the actual range represented is the same, the larger the scale, the larger the required map sheet area; the smaller the scale, the smaller the required map sheet area. The goal of the minimum set of nautical chart sheets is to minimize the number of nautical chart sheets, so the sheets in the enlarged map sheet set are preferred.
[0108] Step a8, selecting the first picture frame in the reduced picture frame set as the current picture frame, and proceeding to step a9;
[0109] Step a9, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a10; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a10; if not, return all selected target maps as the minimum set of rendered chart maps;
[0110] Step a10, determine whether all the pictures in the reduced picture set have been traversed. If so, it means that there is no minimum set of nautical chart pictures that completely matches the current screen viewport, and the process ends; if not, select the next picture in the reduced picture set as the current picture, and return to step a9.
[0111] Step a8-step a10 is to check the maps in the reduced large map set according to the map set checking process. If the minimum set of nautical chart maps cannot be obtained after using the matching map set and the enlarged map set, the reduced map set will be turned. In the reduced map set, the reduced map set checking process will be traversed in the order of editing scale from large to small, that is, the maps with a scale close to the current screen display will be checked first. Selecting a map with a scale closer to the map can ensure that the accuracy and detail of the map content matches the map, avoiding distortion or insufficiency of information caused by too large or too small a scale.
[0112] For example, if all the enlarged image sets C, D, A, and B are checked, and the screen viewport range is not fully occupied, that is, the remaining viewport is not empty, then the images G and H in the 1:12000 group will be checked first, and then the images I and J in the 1:15000 group will be checked.
[0113] In this embodiment, the steps a3, a6 and a9 determine whether the latitude and longitude range of the bounding box of the current image sheet intersects with the latitude and longitude range of the current remaining viewport, specifically including:
[0114] Step a31, define the latitude and longitude range of the current remaining viewport and convert it into a polygon object;
[0115] The initialized remaining viewport is the same as the screen viewport because no clipping operation has been performed. Therefore, the polygon object of the screen viewport can be directly assigned to the polygon object of the remaining viewport. The screen viewport is a rectangular area determined by the longitude and latitude coordinates of four vertices (or two diagonal vertices). Convert this rectangular area into a rectangle (also a polygon) object, which will represent the screen viewport.
[0116] The remaining viewport that is clipped is then a polygonal area, which is determined by the longitude and latitude coordinates of multiple points, and this polygonal area is converted into a polygon object.
[0117] Step a32, define the latitude and longitude range of the bounding box of the map sheet and convert it into a polygonal object; the bounding box is an algorithm for solving the optimal enclosing space of a discrete point set. The basic idea is to use a geometric body with a slightly larger volume and simpler characteristics (called a bounding box) to approximately replace complex geometric objects.
[0118] Step a33, using a clipping library (Clipper library or other similar clipping libraries) to create a Clipper object, and configure it to perform an intersection operation;
[0119] Step a34, taking the polygonal object of the current remaining viewport as the clipping object (clip), taking the polygonal object of the bounding box of the image sheet as the clipped object (subject), and adding them to the Clipper object;
[0120] Step a35, performing an intersection operation and obtaining a polygon set, wherein the polygon set represents the intersection surface between the clipping object and the clipped object;
[0121] Step a36, check whether the polygon set returned by the intersection operation is empty. If it is empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport do not intersect; if it is not empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport intersect.
[0122] In this embodiment, the step 3 of loading the minimum set of rendered nautical chart sheets and cutting them into tiles at different scales and storing them in the memory specifically includes:
[0123] Step b1, dividing the unbuffered target map sheets in the minimum set of rendered nautical chart sheets into multiple groups of tiles according to geographical areas and different scales and loading them; the different scales include the current editing scales r', r' / r1 and r'*r2 of the target map sheets, each group of tiles includes multiple tiles, each tile covers an area on the target map sheet, and contains map data of the area at the corresponding scale;
[0124] Step b2: Record the usage status information of each tile, and when a user uses a tile, update the usage status information of the tile;
[0125] Step b3: Use the LRU cache elimination algorithm to clean up infrequently used tiles;
[0126] Step b4: Set up a regular cleaning mechanism to regularly check and clean tiles that are not frequently used;
[0127] Step b5, set the cache space threshold, when the memory storage space is greater than the cache space threshold, start the LRU cache elimination algorithm to clean up infrequently used tiles. Step b2-step b5 is the memory management of tiles corresponding to the map.
[0128] Step 4, execute the cache thread: calculate the longitude and latitude range of the predicted area at different scales according to the center point position of the current screen viewport and the current screen display scale; add the longitude and latitude ranges at different scales to the area to be cached, and calculate the minimum set of nautical chart sheets to be cached that matches the area to be cached from the matching sheet set, the enlarged sheet set and the reduced sheet set in accordance with the sheet set inspection process; load the sheets in the minimum set of nautical chart sheets to be cached and cut them into tiles at different scales and store them in the memory; Step 3 and Step 4 are executed simultaneously, without any order of precedence.
[0129] In this embodiment, the step 4 calculates the longitude and latitude ranges of the prediction area at different scales according to the center point position of the current screen viewport and the current screen display scale; and adds the longitude and latitude ranges at different scales to the to-be-cached area; specifically includes:
[0130] Step 41, real-time monitoring of the center point of the current screen viewport and the current screen display scale r;
[0131] Step 42, fix the center point position of the current screen viewport unchanged, expand the boundary of the current screen viewport outward (to a certain range, such as an additional percentage of the screen viewport range) to form a prediction area; expanding the prediction area outward plays a role of preloading, and loads the nautical charts needed in the surrounding area in advance.
[0132] In this embodiment, step 32 specifically includes:
[0133] Step 421: Record each zoom-in or zoom-out operation of the user, including the timestamp of the operation, the operation type (zoom-in or zoom-out), and the scale after the operation; record the direction (left, right, up, down), distance, and the center point position of the current screen viewport after the operation of each translation operation of the user;
[0134] Step 422: setting inertia judgment thresholds, including time thresholds, operation times thresholds, and direction consistency thresholds;
[0135] Time threshold: Set a time window to determine whether the user's continuous operations belong to the same inertial behavior. For example, if the user continuously zooms in within a short period of time, it can be considered that the inertial operation of zooming in is being performed.
[0136] Operation count threshold: Set an operation count threshold to confirm the user's habitual behavior. For example, if the user zooms in three or more times in a row, it can be considered that they are more likely to continue zooming in.
[0137] Direction consistency threshold: For panning operations, set a direction consistency threshold. For example, if the user performs three or more consecutive left panning operations, it can be considered that the user is more likely to continue panning to the left.
[0138] Step 423: If the user continuously performs multiple zoom-in or zoom-out operations within the time threshold, and the number of operations exceeds the set operation number threshold, it is determined to be an inertial operation; the center point position of the current screen viewport is fixed unchanged, and the boundary of the current screen viewport is expanded outward within the same set range to form a prediction area; if under the zoom inertia, the editing scale range under the prediction area is adjusted to [r / r1, r*r2*n2], where n2 represents the expansion magnification, and the value of n2 is set by the user. n2 can be set to the magnification of the last zoom operation. The maximum zoom factor, the average zoom factor of multiple zoom operations, the maximum zoom factor of multiple zoom operations, or a random zoom factor of multiple zoom operations; if the zoom inertia is reduced, the editing scale range under the prediction area is adjusted to [r / r1 / n1, r*r2], where n1 represents the extended zoom factor, and the value of n1 is set by the user. n1 can be set to the zoom factor of the last zoom operation, the average zoom factor of multiple zoom operations, the maximum zoom factor of multiple zoom operations, or a random zoom factor of multiple zoom operations;
[0139] At this point, it is predicted that the user will continue to zoom in (or zoom out) in the next step. The predicted scale can be calculated based on the scale after the user's last operation and a preset zoom in (or zoom out) multiple.
[0140] Step 424: If the user continuously performs translation operations in the same direction for multiple times within the time threshold, and the number of operations exceeds the set direction consistency threshold, it is determined to be an inertial operation; the center point position of the current screen viewport is fixed unchanged, the boundary of the current screen viewport is expanded outward within the same set range, and then a set range is expanded outward along the translation direction to form a prediction area;
[0141] At this point, it is predicted that the user will continue to perform a translation operation in the direction in the next step. The predicted coordinates of the new viewport center point can be calculated based on the coordinates after the user's last operation and a preset translation distance.
[0142] Step 43, according to the plane coordinate information, longitude and latitude information of the center point of the current screen viewport and the current screen display scale r, the longitude and latitude range of the prediction area at different scales is calculated; the prediction area is converted into the longitude and latitude range because the bounding box of each sheet of the nautical chart is a longitude and latitude range, which is convenient for calculation.
[0143] 1) If there is no inertial operation, the editing scale range of the prediction area is [r / r1, r*r2]; the prediction area is calculated by equidistant interpolation in the scales of r, r / r1, r*r2, (r / r1, r) and the longitude and latitude ranges in multiple scales are calculated by equidistant interpolation in the range of (r, r*r2) (the specific distance value is set by the user);
[0144] For example: r / r1=1:20000, r=1:10000, r*r2=1:5000, the edit scale range of the prediction area is [r / r1, r*r2]=[1:20000,1:5000]; then the latitude and longitude ranges of 1:20000, 1:18000, 1:160000, 1:14000, 1:12000, 1:10000, 1:8000, 1:6000, 1:5000 are calculated.
[0145] 2) If there is a reduction inertia, the editing scale range of the prediction area is [r / r1 / n1, r*r2], where n1 represents the expansion reduction multiple, and the value of n1 is set by the user; the latitude and longitude ranges of the prediction area are calculated at multiple scales obtained by equidistant interpolation processing within the scales of r, r / r1, r*r2, [r / r1 / n1, r / r1), multiple scales obtained by equidistant interpolation processing within the range of (r / r1, r), and multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2);
[0146] For example: r / r1 / n1=1:40000, r=1:10000, the edit scale range of the prediction area is [1:40000, 1:5000]; then the latitude and longitude ranges of 1:40000, 1:38000, 1:36000, 1:34000, 1:32000, 1:30000, 1:28000, 1:26000, 1:24000, 1:22000, 1:20000, 1:18000, 1:16000, 1:14000, 1:12000; 1:10000, 1:8000, 1:6000, 1:5000;
[0147] 3) If there is magnification inertia, the editing scale range of the prediction area is [r / r1, r*r2*n2], where n2 represents the expansion magnification factor and the value of n2 is set by the user; the latitude and longitude range of the prediction area is calculated at scales of r, r / r1, r*r2, multiple scales obtained by equidistant interpolation processing within the range of (r / r1, r), multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2), and multiple scales obtained by equidistant interpolation processing within the range of (r*r2, r*r2*n2);
[0148] For example: r*r2*n2=1:2500, r=1:10000, the edit scale range under the prediction area is [1:20000, 1:2500]; then calculate the latitude and longitude ranges under 1:20000, 1:18000, 1:16000, 1:14000, 1:12000; 1:10000, 1:8000, 1:6000, 1:5000, 1:4500, 1:4000, 1:3500, 1:3000, 1:2500;
[0149] According to the next operation type and parameters (scale, translation direction and distance) of the prediction, calculate the latitude and longitude range of the prediction area at the corresponding scale and location;
[0150] Step 44: Mark the predicted areas with multiple groups of longitude and latitude ranges calculated as areas to be cached.
[0151] In this embodiment, in step 4, the minimum set of chart sheets to be cached that matches the area to be cached is calculated from the matching chart sheet set, the enlarged chart sheet set, and the reduced chart sheet set in turn according to the chart sheet set checking process; since the loading and rendering efficiency of electronic charts is inversely proportional to the number of chart sheets used, loading only the required minimum set of chart sheets is the key to improving chart performance. The minimum set of chart sheets refers to the minimum set of chart sheets that can render the current screen. It is necessary to find the minimum set of chart sheets needed to render the chart from a large number of chart sheets to improve the chart loading speed.
[0152] In this embodiment, if Figure 2 As shown, specifically including:
[0153] Step a1, initializing the remaining viewports, where the initialized remaining viewports are the same as the area to be cached;
[0154] Step a2, selecting the first image frame in the matching image frame set as the current image frame, and proceeding to step a3;
[0155] Step a3, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a4; if so, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If so, proceed to step a4; if not, return all selected target maps as the minimum set of nautical chart maps to be cached;
[0156] Step a4, determining whether all the images in the matching image set have been traversed, if so, proceeding to step a5; if not, selecting the next image in the matching image set as the current image, and returning to step a3;
[0157] Step a2 to step a4 is to check the sheets in the matching sheet set according to the sheet set check process. When selecting sheets, first focus on the matching sheet set. In this set, the sheets with the same editing scale as the current screen display scale will be selected as the first choice. When selecting chart sheets, the sheets with the same scale are given priority because the sheets with the same scale have higher comparability and accuracy. Scale is a way to express the level of detail of the map content. Sheets with the same scale can ensure that the ratio of the distance on the map and the actual distance is consistent, so that it is more accurate when comparing and analyzing maps.
[0158] Step a5, selecting the first picture frame in the enlarged picture frame set as the current picture frame, and proceeding to step a6;
[0159] Step a6, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a7; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a7; if not, return all selected target maps as the minimum set of nautical chart maps to be cached;
[0160] Step a7, determining whether all the images in the enlarged image set have been traversed, if so, proceeding to step a8; if not, selecting the next image in the enlarged image set as the current image, and returning to step a6;
[0161] Step a5 to step a7 is to check the maps in the enlarged map set according to the map set checking process. If the minimum set of nautical charts to be cached cannot be obtained in the matching map set, the enlarged map set will be turned to. In the enlarged map set, the enlarged map set checking process will be traversed in the order of editing scale from small to large, that is, the maps with a scale close to the current screen display will be checked first. Selecting a map with a scale closer to the map can ensure that the accuracy and detail of the map content match the map, avoiding distortion or insufficiency of information caused by too large or too small a scale.
[0162] For example, if E and F in the matching map set are checked and do not occupy the entire screen viewport range, that is, the remaining viewport is not empty, then maps C and D in the 1:8000 group will be checked first, and then maps A and B in the 1:5000 group will be checked.
[0163] When selecting the order of enlarged map sheet set and reduced map sheet set, when the actual range represented is the same, the larger the scale, the larger the required map sheet area; the smaller the scale, the smaller the required map sheet area. The goal of the minimum set of nautical chart sheets is to minimize the number of nautical chart sheets, so the sheets in the enlarged map sheet set are preferred.
[0164] Step a8, selecting the first picture frame in the reduced picture frame set as the current picture frame, and proceeding to step a9;
[0165] Step a9, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a10; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a10; if not, return all selected target maps as the minimum set of nautical chart maps to be cached;
[0166] Step a10, determine whether all the sheets in the reduced sheet set have been traversed. If so, it means that there is no minimum set of nautical chart sheets that completely matches the area to be cached, and the process ends; if not, select the next sheet in the reduced sheet set as the current sheet, and return to step a9.
[0167] Step a8-step a10 is to check the maps in the reduced large map set according to the map set checking process. If the minimum set of nautical chart maps cannot be obtained after using the matching map set and the enlarged map set, the reduced map set will be turned. In the reduced map set, the reduced map set checking process will be traversed in the order of editing scale from large to small, that is, the maps with a scale close to the current screen display will be checked first. Selecting a map with a scale closer to the map can ensure that the accuracy and detail of the map content matches the map, avoiding distortion or insufficiency of information caused by too large or too small a scale.
[0168] For example, if all the enlarged image sets C, D, A, and B are checked, and the screen viewport range is not fully occupied, that is, the remaining viewport is not empty, then the images G and H in the 1:12000 group will be checked first, and then the images I and J in the 1:15000 group will be checked.
[0169] In this embodiment, the steps a3, a6 and a9 determine whether the latitude and longitude range of the bounding box of the current image sheet intersects with the latitude and longitude range of the current remaining viewport, specifically including:
[0170] Step a31, define the latitude and longitude range of the current remaining viewport and convert it into a polygon object;
[0171] The initialized remaining viewport is the same as the screen viewport because no clipping operation has been performed. Therefore, the polygon object of the screen viewport can be directly assigned to the polygon object of the remaining viewport. The screen viewport is a rectangular area determined by the longitude and latitude coordinates of four vertices (or two diagonal vertices). Convert this rectangular area into a rectangle (also a polygon) object, which will represent the screen viewport.
[0172] The remaining viewport that is clipped is then a polygonal area, which is determined by the longitude and latitude coordinates of multiple points, and this polygonal area is converted into a polygon object.
[0173] Step a32, define the latitude and longitude range of the bounding box of the map sheet and convert it into a polygonal object; the bounding box is an algorithm for solving the optimal enclosing space of a discrete point set. The basic idea is to use a geometric body with a slightly larger volume and simpler characteristics (called a bounding box) to approximately replace complex geometric objects.
[0174] Step a33, using a clipping library (Clipper library or other similar clipping libraries) to create a Clipper object, and configure it to perform an intersection operation;
[0175] Step a34, taking the polygonal object of the current remaining viewport as the clipping object (clip), taking the polygonal object of the bounding box of the image sheet as the clipped object (subject), and adding them to the Clipper object;
[0176] Step a35, performing an intersection operation and obtaining a polygon set, wherein the polygon set represents the intersection surface between the clipping object and the clipped object;
[0177] Step a36, check whether the polygon set returned by the intersection operation is empty. If it is empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport do not intersect; if it is not empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport intersect.
[0178] In this embodiment, the calculation of the remaining area after removing the intersecting parts as the current remaining viewport in steps a3, a6 and a9 specifically includes:
[0179] The remaining viewport polygons are used as clipped objects, the polygon set is used as the clipping object, and the clipping library is used to perform the difference operation;
[0180] The result of the subtraction operation will be a new set of polygons representing the portion of the remaining viewport that is not covered by the bounding box of the image frame;
[0181] Update the remaining viewport polygons to this new polygon set.
[0182] In this embodiment, the step 4 loads the minimum set of nautical chart sheets to be cached and cuts them into tiles at different scales and stores them in the memory; specifically includes:
[0183] Step b1, dividing the unbuffered target map sheets in the minimum set of rendered nautical chart sheets / minimum set of nautical chart sheets to be cached into multiple groups of tiles according to geographical areas and different scales and loading them; the different scales include the current editing scales r', r' / r1 and r'*r2 of the target map sheets, each group of tiles includes multiple tiles, each tile covers an area on the target map sheet and contains map data of the area at the corresponding scale; the size and shape of the tile can be defined according to actual needs, and the common tile size is 256x256 pixels;
[0184] Step b2: record the usage status information of each tile (such as the most recent usage time, usage frequency, etc.), and update the usage status information of the tile when the user uses the tile;
[0185] Step b3: Use the LRU (least recently used) cache elimination algorithm to clean up infrequently used tiles;
[0186] Step b4: Set a regular cleaning mechanism to regularly check and clean infrequently used tiles; this can be triggered based on time intervals (such as every hour, every day) or cache usage rate;
[0187] Step b5: Set a cache space threshold. When the memory storage space is greater than the cache space threshold, start the LRU cache elimination algorithm to clean up infrequently used tiles. Set a reasonable cache space size limit to avoid insufficient memory or storage space due to excessive cache size.
[0188] In this embodiment, the latitude and longitude range of the current screen viewport at the current screen display scale is calculated according to the center point position of the current screen viewport and the current screen display scale in step 3; and the latitude and longitude range of the prediction area at different scales is calculated according to the center point position of the current screen viewport and the current screen display scale in step 4; specifically as follows:
[0189] Calculation of the latitude and longitude range of the screen viewport / prediction area at a specific scale:
[0190] Calculate the latitude and longitude range within the screen range
[0191] 1. Set parameters
[0192] Center point longitude: lon_C
[0193] Center point latitude: lat_C
[0194] Chart scale: S
[0195] Screen viewport / prediction area resolution: width pixels × height pixels
[0196] DPI (dots per inch): DPI
[0197] 2. Calculate the screen size (in centimeters)
[0198] Calculate screen width and height in inches:
[0199] Screen viewport / prediction area width (meters)
[0200]
[0201] Screen viewport / prediction area height (meters):
[0202]
[0203] 3. Calculate the actual distance based on the scale
[0204] The actual distance from the center of the screen viewport / prediction area to the left and right edges:
[0205]
[0206] The actual distance from the center of the screen viewport / prediction area to the top and bottom edges:
[0207]
[0208] 4. Calculate the change in longitude and latitude
[0209] The circumference of the Earth is approximately 40,075 km (at the equator), so:
[0210] The actual distance per degree of longitude is about 111.32 kilometers at the equator;
[0211] The actual distance per degree of latitude is approximately 111.32 kilometers.
[0212] Latitude change:
[0213]
[0214] Longitude change:
[0215] Calculate the screen viewport / prediction area latitude and longitude range:
[0216] Latitude range: {lat_C+Δlat,lat_C-Δlat}
[0217] Longitude range: {lon_C+Δlon,lon_C-Δlon}
[0218] After the chart is zoomed in or out or moved, the chart display range changes. The chart selection algorithm is used to select the chart sheets that need to be used. If the chart sheet tile data is already in the cache, the cache is used directly to efficiently render the chart sheet. If the chart sheet is not in the cache, the chart tile data is loaded and then rendered. At the same time, the background uses an intelligent prediction algorithm to predict the chart sheets that need to be preloaded within the current screen range, and uses LRU (least recently used) or other cache elimination algorithms to manage cache data and improve cache hit rate. This improves the rendering performance of the chart.
[0219] like Figure 3 As shown, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the above-mentioned method for selecting and rendering an electronic nautical chart for stepless zooming is implemented.
[0220] like Figure 4 As shown, an embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned method for selecting and rendering an electronic nautical chart for stepless zooming is implemented.
[0221] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0222] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0223] The above descriptions are only some embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent device or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for selecting and rendering electronic charts to achieve stepless zooming, characterized in that: The steps include: Step 1: Determine the scale range for editing the chart according to the current screen display scale, maximum reduction factor, and maximum magnification factor; Step 2: Filter out the chart sheets whose editing scales are within the editing scale range of the chart from all the chart sheets, and divide them into a reduced chart sheet set, a matched chart sheet set, and an enlarged chart sheet set; Step 3, executing the rendering thread: calculating the longitude and latitude range of the current screen viewport at the current screen display scale according to the center point position of the current screen viewport and the current screen display scale; calculating the minimum set of rendered chart sheets that match the longitude and latitude range of the current screen viewport from the matching sheet set, the enlarged sheet set and the reduced sheet set in accordance with the sheet set checking process; It is determined by querying from the memory whether the minimum set of the rendered nautical chart sheets has been cached. If so, the tile corresponding to the sheet with the closest scale is selected from the memory for rendering; if not, the sheets of the minimum set of the rendered nautical chart sheets are loaded and cut into tiles according to different scales and stored in the memory, and the tile corresponding to the sheet with the closest scale is selected from the memory for rendering; Step 4, executing the cache thread: calculating the longitude and latitude ranges of the prediction area at different scales according to the center point position of the current screen viewport and the current screen display scale; adding the longitude and latitude ranges at different scales to the to-be-cached area, and calculating the minimum set of to-be-cached chart sheets that match the to-be-cached area from the matching sheet set, the enlarged sheet set and the reduced sheet set in accordance with the sheet set checking process; The minimum set of chart sheets to be cached is loaded and cut into tiles at different scales and stored in the memory; step 3 and step 4 are executed simultaneously without any order.
2. A method for selecting and rendering electronic nautical charts to achieve stepless zooming according to claim 1, characterized in that: The step 1 specifically includes: Step 11, define the maximum allowable reduction factor r1, the maximum allowable magnification factor r2 and the current screen display scale r; Step 12: Based on the maximum allowable reduction factor r1, the maximum allowable magnification factor r2 and the current screen display scale r, determine that the chart editing scale range is [r / r1, r*r2].
3. A method for selecting and rendering electronic nautical charts to achieve stepless zooming according to claim 2, characterized in that: The step 2 specifically includes: Step 21, traverse all chart sheets, and filter out the sheets whose editing scales are within the editing scale range of the chart; Step 22: divide the map with an editing scale smaller than the current screen display scale r into a reduced map set; divide the map with an editing scale equal to the current screen display scale r into a matched map set; divide the map with an editing scale larger than the current screen display scale r into an enlarged map set. Step 23, the maps with the same editing scale size in all the maps in the reduced map set are grouped together, and each group is arranged in order from large to small; all the maps in the matching map set are grouped together; all the maps in the enlarged map set with the same editing scale size are grouped together, and each group is arranged in order from small to large.
4. A method for selecting and rendering electronic charts to achieve stepless zooming according to claim 3, characterized in that: In the step 4, the latitude and longitude ranges of the prediction area at different scales are calculated according to the center point position of the current screen viewport and the current screen display scale; and the latitude and longitude ranges at different scales are added to the to-be-cached area; specifically, the steps include: Step 41, real-time monitoring of the center point of the current screen viewport and the current screen display scale r; Step 42: fix the center point of the current screen viewport to remain unchanged, and expand the boundary of the current screen viewport outward to form a prediction area; Step 43: Calculate the latitude and longitude ranges of the prediction area at different scales based on the plane coordinate information, longitude and latitude information of the center point of the current screen viewport and the current screen display scale r: 1) If there is no inertial operation, the edit scale range of the prediction area is [r / r1, r*r2]; calculate the latitude and longitude range of the prediction area at multiple scales obtained by equidistant interpolation processing within the scale range of r, r / r1, r*r2, (r / r1, r) and multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2); 2) If there is a reduction inertia, the editing scale range of the prediction area is [r / r1 / n1, r*r2], where n1 represents the expansion reduction multiple, and the value of n1 is set by the user; the latitude and longitude ranges of the prediction area are calculated at multiple scales obtained by equidistant interpolation processing within the scales of r, r / r1, r*r2, [r / r1 / n1, r / r1), multiple scales obtained by equidistant interpolation processing within the range of (r / r1, r), and multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2); 3) If there is magnification inertia, the editing scale range of the prediction area is [r / r1, r*r2*n2], where n2 represents the expansion magnification factor and the value of n2 is set by the user; the latitude and longitude range of the prediction area is calculated at scales of r, r / r1, r*r2, multiple scales obtained by equidistant interpolation processing within the range of (r / r1, r), multiple scales obtained by equidistant interpolation processing within the range of (r, r*r2), and multiple scales obtained by equidistant interpolation processing within the range of (r*r2, r*r2*n2); Step 44: Mark the predicted areas with multiple groups of longitude and latitude ranges calculated as areas to be cached.
5. A method for selecting and rendering electronic nautical charts to achieve stepless zooming according to claim 4, characterized in that: The step 42 specifically includes: Step 421, record each zoom-in or zoom-out operation of the user, including the timestamp of the operation, the operation type, and the scale after the operation; record the direction and distance of each translation operation of the user, and the center point position of the current screen viewport after the operation; Step 422: setting inertia judgment thresholds, including time thresholds, operation times thresholds, and direction consistency thresholds; Step 423: If the user continuously performs multiple zoom-in or zoom-out operations within the time threshold, and the number of operations exceeds the set operation number threshold, it is determined to be an inertial operation; the center point position of the current screen viewport is fixed unchanged, and the boundary of the current screen viewport is expanded outward within the same set range to form a prediction area; if the zoom-in inertia is used, the editing scale range under the prediction area is adjusted to [r / r1, r*r2*n2], where n2 represents the expansion magnification, and the value of n2 is set by the user; if the zoom-out inertia is used, the editing scale range under the prediction area is adjusted to [r / r1 / n1, r*r2], where n1 represents the expansion reduction multiple, and the value of n1 is set by the user; Step 424: If the user performs multiple translation operations in the same direction within the time threshold, and the number of operations exceeds the set direction consistency threshold, it is determined to be an inertial operation; the center point position of the current screen viewport is fixed unchanged, the boundary of the current screen viewport is expanded outward within the same set range, and then a set range is expanded outward along the translation direction to form a prediction area.
6. A method for selecting and rendering electronic nautical charts to achieve stepless zooming according to claim 5, characterized in that: In step 3, according to the map set checking process, the minimum set of rendered chart sheets that matches the latitude and longitude range of the current screen viewport is calculated from the matching map set, the enlarged map set and the reduced map set in turn; and in step 4, according to the map set checking process, the minimum set of to-be-cached chart sheets that matches the to-be-cached area is calculated from the matching map set, the enlarged map set and the reduced map set in turn; Specifically include: Step a1, initializing the remaining viewports, where the initialized remaining viewports are the same as the current screen viewport / area to be cached; Step a2, selecting the first image frame in the matching image frame set as the current image frame, and proceeding to step a3; Step a3, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a4; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a4; if not, return all selected target maps as the minimum set of rendered chart sheets / minimum set of chart sheets to be cached; Step a4, determining whether all the images in the matching image set have been traversed, if so, proceeding to step a5; if not, selecting the next image in the matching image set as the current image, and returning to step a3; Step a5, selecting the first picture frame in the enlarged picture frame set as the current picture frame, and proceeding to step a6; Step a6, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a7; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a7; if not, return all selected target maps as the minimum set of rendered chart sheets / minimum set of chart sheets to be cached; Step a7, determining whether all the images in the enlarged image set have been traversed, if so, proceeding to step a8; if not, selecting the next image in the enlarged image set as the current image, and returning to step a6; Step a8, selecting the first image frame in the reduced image frame set as the current image frame, and proceeding to step a9; Step a9, determine whether the latitude and longitude range of the bounding box of the current map sheet intersects with the latitude and longitude range of the current remaining viewport. If not, proceed to step a10; if yes, select the current map sheet as the target map sheet, calculate the remaining area after removing the intersecting part as the current remaining viewport; continue to determine whether the current remaining viewport is empty. If yes, proceed to step a10; if not, return all selected target maps as the minimum set of rendered chart sheets / minimum set of chart sheets to be cached; Step a10, determine whether all the pictures in the reduced picture set have been traversed. If so, it means that there is no minimum set of nautical chart pictures that completely matches the current screen viewport / area to be cached, and the process ends; if not, select the next picture in the reduced picture set as the current picture, and return to step a9.
7. A method for selecting and rendering electronic charts to achieve stepless zooming according to claim 6, characterized in that: In the steps a3, a6 and a9, determining whether the latitude and longitude range of the bounding box of the current image sheet intersects with the latitude and longitude range of the current remaining viewports specifically includes: Step a31, define the latitude and longitude range of the current remaining viewport and convert it into a polygon object; Step a32, defining the latitude and longitude range of the bounding box of the map sheet, and converting it into a polygon object; Step a33, create a Clipper object using the clipping library and configure it to perform an intersection operation; Step a34, taking the polygonal object of the current remaining viewport as the clipping object, taking the polygonal object of the bounding box of the image sheet as the clipped object, and adding them to the Clipper object; Step a35, performing an intersection operation and obtaining a polygon set, wherein the polygon set represents the intersection surface of the clipping object and the clipped object; Step a36, check whether the polygon set returned by the intersection operation is empty. If it is empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport do not intersect; if it is not empty, the longitude and latitude range of the bounding box of the map sheet and the longitude and latitude range of the current remaining viewport intersect.
8. The method for selecting and rendering electronic charts to realize stepless zooming according to claim 1, characterized in that: In step 3, the minimum set of rendered nautical chart sheets is loaded and cut into tiles at different scales and stored in the memory; and in step 4, the minimum set of nautical chart sheets to be cached is loaded and cut into tiles at different scales and stored in the memory; Specifically include: Step b1, dividing the unbuffered target map sheets in the minimum set of rendered nautical chart sheets / the minimum set of nautical chart sheets to be cached into multiple groups of tiles according to geographical areas and different scales and loading them; the different scales include the current editing scales r', r' / r1 and r'*r2 of the target map sheets, each group of tiles includes multiple tiles, each tile covers an area on the target map sheet, and contains map data of the area at the corresponding scale; Step b2: Record the usage status information of each tile, and when a user uses a tile, update the usage status information of the tile; Step b3: Use the LRU cache elimination algorithm to clean up infrequently used tiles; Step b4: Set up a regular cleaning mechanism to regularly check and clean tiles that are not frequently used; Step b5: Set a cache space threshold. When the memory storage space is greater than the cache space threshold, start the LRU cache elimination algorithm to clean up infrequently used tiles.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, a method for selecting and rendering an electronic nautical chart for stepless zooming as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, a method for selecting and rendering an electronic nautical chart for stepless zooming as described in any one of claims 1 to 8 is implemented.