CN119559277A - A method, device and medium for selecting and rendering electronic charts for stepless zooming - Google Patents
A method, device and medium for selecting and rendering electronic charts for stepless zooming Download PDFInfo
- Publication number
- CN119559277A CN119559277A CN202411606128.2A CN202411606128A CN119559277A CN 119559277 A CN119559277 A CN 119559277A CN 202411606128 A CN202411606128 A CN 202411606128A CN 119559277 A CN119559277 A CN 119559277A
- Authority
- CN
- China
- Prior art keywords
- chart
- picture
- longitude
- current
- scale
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Landscapes
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a chart selecting and rendering method, equipment and medium for realizing electronic chart stepless scaling, which comprises the steps of determining a chart editing scale range, screening a chart according to the chart editing scale range and dividing the chart into reduced, matched and enlarged chart sets, calculating the longitude and latitude range of a current screen view port under the current screen display scale, calculating a rendered chart minimum set from the matched chart set, the enlarged chart set and the reduced chart set, judging whether the rendered chart minimum set is cached, if so, selecting a tile with the closest scale for rendering, otherwise, loading the chart and cutting the chart into tiles to be stored in a memory, calculating the longitude and latitude range of a prediction area under different scales, adding the to-be-cached area, calculating the chart minimum set to be cached from the matched chart set, the enlarged chart set and the reduced chart set, loading the chart and cutting the chart into tiles to be stored in the memory. The method and the device can realize quick and clear presentation of the chart data.
Description
Technical Field
The present invention relates to the field of electronic chart rendering technologies, and in particular, to a chart selection rendering method, apparatus and medium for implementing electronic chart stepless scaling.
Background
In the existing electronic chart system, since the chart is usually designed based on a fixed editing scale, the editing scale of the current electronic chart is divided into a plurality of levels, and the levels are divided according to the detailed degree and the application range of the chart. Generally, the edit scale level of an electronic chart includes, but is not limited to, the following:
Large scales 1:300 tens of thousands and below, these editorial scales are commonly used to display a wide range of sea areas, such as global or transoceanic airlines, etc.;
middle scales 1:150 tens of thousands, 1:70 tens of thousands, 1:35 tens of thousands, etc., which are suitable for displaying sea areas of larger area, such as airlines between coastal countries or important sea areas;
small scales 1:18 ten thousand, 1:9 ten thousand, 1:45000, 1:22000, 1:12000, 1:8000, 1:4000, etc., which provide more detailed sea area information, and are suitable for navigation and positioning of coastal, offshore, harbor, dock berth, etc.
In the conventional ECS (electronic chart system)/ECDIS (electronic chart display and information system), the system designs a corresponding display scale according to a preset editing scale. Under a specific display scale, the system directly calls the chart diagram of the editing scale corresponding to the system to render. This approach does not enable truly stepless scaling. The zoom operation is often limited to a preset editing scale, which limits the flexibility and continuity of the user in performing the zoom operation.
Meanwhile, the data loading time cannot be effectively reduced and the data multiplexing rate cannot be improved due to the fact that a caching mechanism is not provided or is not intelligent enough, so that the chart loading is slow.
Disclosure of Invention
In view of the above, the present invention aims to provide a chart selecting and rendering method for realizing electronic chart stepless scaling, which improves chart rendering efficiency and operation convenience of terminal devices such as ECS (electronic chart system), ECDIS (electronic chart display and information system), and the like, realizes quick and clear presentation of chart data, reduces system resource consumption, and improves smoothness and satisfaction of users in the use process.
In order to achieve the technical purpose, the invention adopts the following technical scheme:
The invention provides a selective chart rendering method for realizing electronic chart stepless scaling, which comprises the following steps:
Step 1, determining a chart editing scale range according to a current screen display scale, a maximum reduction multiple and a maximum magnification multiple;
Step 2, selecting the chart with the editing scale within the scope of the chart editing scale from all chart charts, and dividing the chart into a reduced chart set, a matched chart set and an enlarged chart set;
Step 3, executing a rendering thread, namely calculating the longitude and latitude range of the current screen view port under the current screen display scale according to the central point position of the current screen view port and the current screen display scale, sequentially calculating a rendering sea chart minimum set matched with the longitude and latitude range of the current screen view port from the matched chart set, the enlarged chart set and the reduced chart set according to a chart set checking flow, inquiring and judging from a memory whether the rendering sea chart minimum set is cached or not, if so, selecting a tile corresponding to a chart with the closest scale from the memory for rendering, otherwise, loading the chart of the rendering sea chart minimum set, cutting the chart into tiles according to different scales, storing the tiles in the memory, and selecting a tile corresponding to the chart with the closest scale from the memory for rendering;
And 4, executing a caching thread, namely calculating the longitude and latitude ranges of the prediction area under different scales according to the central point position of the current screen view port and the current screen display scale, adding the longitude and latitude ranges under different scales into the area to be cached, sequentially calculating a minimum set of the sea chart to be cached, which is matched with the area to be cached, from the matched chart set, the enlarged chart set and the reduced chart set according to the chart set checking flow, loading the chart in the minimum set of the sea chart to be cached, cutting the chart into tiles according to different scales, and storing the tiles in a memory, wherein the steps 3 and 4 are executed simultaneously without sequence.
Further, the step 1 specifically includes:
Step 11, defining an allowable maximum reduction multiple r1, an allowable maximum magnification multiple r2 and a current screen display scale r;
And step 12, determining a chart editing scale range as [ r/r1, r x r2] based on the allowed maximum reduction multiple r1, the allowed maximum magnification multiple r2 and the current screen display scale r.
Further, the step 2 specifically includes:
step 21, traversing all chart pictures, and screening out chart pictures with editing scales within the scope of the chart editing scales;
And 22, dividing the pictures with the editing scale smaller than the current screen display scale r into reduced picture sets, dividing the pictures with the editing scale equal to the current screen display scale r into matched picture sets, and dividing the pictures with the editing scale larger than the current screen display scale r into enlarged picture sets.
And step 23, taking the pictures with the same editing scale in all the pictures in the reduced picture set as the same group, arranging each group according to the sequence from large to small, taking all the pictures in the matched picture set as the same group, and taking the pictures with the same editing scale in all the pictures in the enlarged picture set as the same group, wherein each group is arranged according to the sequence from small to large.
Further, in the step 4, the latitude and longitude ranges of the prediction area under different scales are calculated according to the center point position of the current screen view port and the current screen display scale, and the latitude and longitude ranges under different scales are added into the area to be cached, which specifically comprises:
step 41, monitoring the center point of the current screen view port and the current screen display scale r in real time;
Step 42, fixing the position of the central point of the current screen view port, and expanding the boundary of the current screen view port outwards to form a prediction area;
Step 43, calculating longitude and latitude ranges of the prediction area under different scales according to plane coordinate information, longitude and latitude information and a current screen display scale r of a center point of a current screen view port:
1) Calculating a plurality of scales obtained by equidistant interpolation processing of the prediction area in the ranges of the scales of r, r/r1, r x r2 and longitude and latitude ranges of the prediction area in the ranges of the scales of (r, r x r 2) and a plurality of scales obtained by equidistant interpolation processing in the ranges of the scales of (r/r 1, r) when the inertial operation does not exist;
2) If the shrinkage inertia exists, the editing scale range under the prediction area is [ r/r1/n1, r2], wherein n1 represents the expansion shrinkage multiple, and the value of n1 is set by a user; calculating a plurality of scales obtained by equidistant interpolation processing of a prediction area in the ranges of scales r, r/r1, r x r2, r/r1/n1 and r/r1, (r/r 1, r) and a plurality of scales obtained by equidistant interpolation processing in the ranges of (r, r x r 2);
4) If the amplification inertia exists, the editing scale range under the prediction area is [ r/r1, r x r 2x n2], wherein n2 represents the expansion amplification factor, and the value of n2 is set by a user; calculating a plurality of scales obtained by equidistant interpolation processing of a prediction area in the scale ranges of r, r/r1 and r2, (r/r 1 and r), a plurality of scales obtained by equidistant interpolation processing in the scale ranges of (r, r 2) and longitude and latitude ranges under the plurality of scales obtained by equidistant interpolation processing in the scale ranges of (r 2 and r 2) n 2;
And 44, marking the prediction areas with the calculated multiple groups of longitude and latitude ranges as areas to be cached.
Further, the step 42 specifically includes:
Step 421, recording the operation of each time of zooming in or out by the user, including the time stamp of the occurrence of the operation, the operation type and the scale after the operation;
step 422, setting inertia judgment threshold values, including time threshold values, operation times threshold values and direction consistency threshold values;
Step 423, if the user continuously performs multiple zooming-in or zooming-out operations within a time threshold and the operation times exceed a set operation times threshold, judging that the operation is inertia operation, fixing the central point position of the current screen view port, expanding the boundary of the current screen view port outwards within the same certain setting range to form a prediction area, and if under the zooming-in inertia, adjusting the editing scale range under the prediction area to be [ r/r1, r x r2 x n2], wherein n2 represents the expansion magnification factor, and the value of n2 is set by the user, and if under the zooming-out inertia, adjusting the editing scale range under the prediction area to be [ r/r1/n1, r x r2], wherein n1 represents the expansion magnification factor, and the value of n1 is set by the user;
And 424, if the user continuously performs the translation operation in the same direction for a plurality of times within the time threshold, and the operation times exceed the set direction consistency threshold, judging that the operation is the inertial operation, fixing the central point position of the current screen view port to be unchanged, expanding the boundary of the current screen view port outwards within the same set range, and expanding a set range outwards along the translation direction to form a prediction area.
Further, in the step 3, a rendering chart minimum set matched with the longitude and latitude range of the current screen view port is calculated from the matching chart set, the enlarged chart set and the reduced chart set in sequence according to the chart set checking flow, and in the step 4, a chart minimum set matched with the to-be-cached area is calculated from the matching chart set, the enlarged chart set and the reduced chart set in sequence according to the chart set checking flow, which specifically comprises:
step a1, initializing a residual view port, wherein the initialized residual view port is the same as a current screen view port/a to-be-cached area;
step a2, selecting a first picture in the matched picture set as a current picture, and entering a step a3;
Step a3, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a4, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a4, and if not, returning all the selected target drawings as a minimum set of rendered sea chart drawings/a minimum set of sea chart drawings to be cached;
step a4, judging whether all the pictures in the matched picture set are traversed, if yes, entering a step a5, otherwise, selecting the next picture in the matched picture set as the current picture, and returning to the step a3;
step a5, selecting a first picture in the enlarged picture set as a current picture, and entering a step a6;
Step a6, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a7, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a7, and if not, returning all the selected target drawings as a minimum set of rendered sea chart drawings/a minimum set of sea chart drawings to be cached;
Step a7, judging whether all the pictures in the amplified picture set are traversed, if yes, entering a step a8, otherwise, selecting the next picture in the amplified picture set as the current picture, and returning to the step a6;
Step a8, selecting a first picture in the reduced picture set as a current picture, and entering a step a9;
Step a9, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a10, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a10, and if not, returning all the selected target drawings as a minimum set of rendered sea chart drawings/a minimum set of sea chart drawings to be cached;
and a step a10 of judging whether all the pictures in the reduced picture set are traversed, if so, indicating that the minimum set of the picture with the sea picture completely matched with the view port/the area to be cached of the current screen does not exist, ending the flow, and if not, selecting the next picture in the reduced picture set as the current picture, and returning to the step a9.
Further, in the step a3, the step a6 and the step a9, it is determined whether the latitude and longitude range of the bounding box of the current picture intersects with the latitude and longitude range of the current remaining viewport, and the method specifically includes:
step a31, defining the latitude and longitude range of the current residual viewport, and converting the latitude and longitude range into a polygonal object;
Step a32, defining the longitude and latitude range of a bounding box of the picture and converting the longitude and latitude range into a polygonal object;
step a33, creating a clip object by using a clipping library, and configuring to execute an intersecting operation;
step a34, taking the polygonal object of the current residual view port as a clipping object, taking the polygonal object of the bounding box of the picture as a clipped object, and adding the clipped object into the clip object;
step a35, executing an intersecting operation, and obtaining a polygon set, wherein the polygon set represents an intersecting surface of a cutting object and a cut object;
Step a36, checking whether the polygon set returned by the intersecting operation is empty, if so, the longitude and latitude range of the bounding box of the picture is not intersected with the longitude and latitude range of the current residual view port, and if not, the longitude and latitude range of the bounding box of the picture is intersected with the longitude and latitude range of the current residual view port.
Further, in the step 3, the drawing of the minimum set of the rendered chart drawing is loaded and cut into tiles according to different scales and stored in the memory, and in the step 4, the drawing of the minimum set of the chart drawing to be cached is loaded and cut into tiles according to different scales and stored in the memory, which specifically comprises:
dividing an unbuffered target image in the minimum set of rendered sea image images/the minimum set of sea image images to be buffered into a plurality of groups of tiles according to a geographic area and different scales, and loading the tiles, wherein the different scales comprise current editing scales r ', r '/r1 and r ' ×r2 of the target image, each group of tiles comprises a plurality of tiles, each tile covers an area on the target image, and map data of the area under the corresponding scale are contained;
Step b2, recording the use state information of each tile, and updating the use state information of a certain tile when a user uses the tile;
Step b3, adopting an LRU cache elimination algorithm to clean the unusual tiles;
step b4, setting a periodic cleaning mechanism, and periodically checking and cleaning unusual tiles;
and b5, setting a buffer space threshold, and starting an LRU buffer elimination algorithm to clean the unusual tiles when the storage space of the memory is larger than the buffer space threshold.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor realizes the selective chart rendering method for realizing the electronic chart stepless scaling when executing the program.
The present invention also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a selection map rendering method for achieving electronic chart stepless scaling as described above.
By adopting the technical scheme, compared with the prior art, the invention has the beneficial effects that:
1. The invention adopts an algorithm capable of dynamically selecting and rendering the chart data according to the zoom requirement of the user to realize stepless zoom, namely a continuous zoom function, so as to ensure that clear and continuous chart display can be provided under any zoom level. The quick loading and smooth display of the chart data are ensured, and the flexibility and convenience of user operation are greatly improved.
2. And an intelligent cache system is built, commonly used chart data blocks are automatically stored and managed, and chart performance is improved. Through intelligent prediction and caching strategies, the repeated loading time is reduced, and the data access efficiency is improved.
3. The invention greatly optimizes the user experience through stepless scaling and intelligent caching.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of an implementation of a chart selection rendering method for implementing electronic chart stepless scaling according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a calculation flow of rendering a minimum set of chart frames/a minimum set of chart frames to be cached according to an embodiment of the present invention.
Fig. 3 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of a computer readable storage medium according to an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is specifically noted that the following examples are only for illustrating the present invention, but do not limit the scope of the present invention. Likewise, the following examples are only some, but not all, of the examples of the present invention, and all other examples, which a person of ordinary skill in the art would obtain without making any inventive effort, are within the scope of the present invention.
Referring to fig. 1, the method for rendering a selected chart for realizing electronic chart stepless scaling of the present invention includes the following steps:
Step 1, determining a chart editing scale range according to a current screen display scale, a maximum reduction multiple and a maximum magnification multiple;
in this embodiment, the step 1 specifically includes:
Step 11, defining an allowed maximum reduction multiple r1, an allowed maximum magnification multiple r2 and a current screen display scale r, wherein the allowed maximum reduction multiple r1 and the allowed maximum magnification multiple r2 are two key parameters for filtering a chart;
And step 12, determining a chart editing scale range as [ r/r1, r x r2] based on the allowed maximum reduction multiple r1, the allowed maximum magnification multiple r2 and the current screen display scale r. The chart meeting the conditions can be screened out through the chart editing scale range, unnecessary chart is filtered out, the data volume is reduced, and the calculation efficiency is improved.
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 ].
Step 2, selecting the chart with the editing scale within the scope of the chart editing scale from all chart charts, and dividing the chart into a reduced chart set, a matched chart set and an enlarged chart set;
In this embodiment, the step 2 specifically includes:
and 21, traversing all chart frames, screening out chart frames with editing scales within the chart editing scale range, screening out chart frames within the chart editing scale range, filtering out unnecessary chart frames, reducing data quantity and improving calculation efficiency.
Step 22, dividing the pictures with the editing scale smaller than the current screen display scale r and not smaller than r/r1 into reduced picture sets, dividing the pictures with the editing scale equal to the current screen display scale r into matched picture sets, and dividing the pictures with the editing scale larger than the current screen display scale r and not larger than r x r2 into enlarged picture sets. The screened pictures are divided into three types of sets, so that the pictures with the scales closer to each other can be conveniently and preferentially selected in the process of finding out the minimum set of the sea chart pictures, and the map with the scales closer to the pictures is selected, so that the accuracy and the detail degree of the map content can be ensured to be matched with the pictures, and the information distortion or deficiency caused by the overlarge or the undersize scale can be avoided;
And step 23, taking the pictures with the same editing scale in all the pictures in the reduced picture set as the same group, arranging each group according to the sequence from large to small, taking all the pictures in the matched picture set as the same group, and taking the pictures with the same editing scale in all the pictures in the enlarged picture set as the same group, wherein each group is arranged according to the sequence from small to large.
The pictures in each collection will be further grouped by their edit scale size for subsequent management and selection. The grouping is exemplified by assuming that the current screen display scale is 1:10000, the maximum reduction multiple r1 and the allowed maximum magnification multiple r2 are both 2, the edit scale range is [ 1:20000-1:5000 ], if the edit scale of the drawing A, B is 1:5000, the edit scale of the drawing C, D is 1:8000, the edit scale of the drawing E, F is 1:10000, the edit scale of the drawing G, H is 1:12000, and the edit scale of the drawing I, J is 1:15000, the chart is classified as follows:
enlarging the image collection:
1:5000:A、B
1:8000:C、D
C, D, A, B in the set according to the order of editing scale from small to large, the order in each group can be unlimited;
Matching the graph set:
1:10000:E、F
only one group is within the set;
narrowing the graph collection:
1:12000:G、H
1:15000:I、J
G, H, I, J in the set according to the sequence from large to small of the editing scale, the sequence in each group can be unlimited;
Step 3, executing a rendering thread, namely calculating the longitude and latitude range of the current screen view port under the current screen display scale according to the central point position of the current screen view port and the current screen display scale, sequentially calculating a rendering sea chart minimum set matched with the longitude and latitude range of the current screen view port from the matched chart set, the enlarged chart set and the reduced chart set according to a chart set checking flow, inquiring and judging from a memory whether the rendering sea chart minimum set is cached or not, if so, selecting a tile corresponding to a chart with the closest scale from the memory for rendering, otherwise, loading the chart of the rendering sea chart minimum set, cutting the chart into tiles according to different scales, storing the tiles in the memory, and selecting a tile corresponding to the chart with the closest scale from the memory for rendering;
In this embodiment, in the step 3, a rendered sea chart minimum set that matches the longitude and latitude range of the current screen view port is calculated from the matching chart set, the enlarged chart set and the reduced chart set in sequence according to the chart set checking flow, the screen view port refers to the longitude and latitude range of the current screen display, each chart also has its own longitude and latitude range, the longitude and latitude range of the chart set covers the longitude and latitude range of the screen display, so that the chart set meeting the requirement is found, and the minimum set of the chart set is found by using as few chart coverage screen display longitude and latitude ranges as possible.
As shown in fig. 2, the method specifically includes:
Step a1, initializing a residual view port, wherein the initialized residual view port is the same as a current screen view port;
step a2, selecting a first picture in the matched picture set as a current picture, and entering a step a3;
Step a3, judging whether the longitude and latitude range of the bounding box of the current picture intersects with the longitude and latitude range of the current residual view port, if not, entering a step a4, if so, selecting the current picture as a target picture, calculating a residual area with the intersecting part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a4, and if not, returning all the selected target pictures as a minimum set of rendered sea picture;
step a4, judging whether all the pictures in the matched picture set are traversed, if yes, entering a step a5, otherwise, selecting the next picture in the matched picture set as the current picture, and returning to the step a3;
step a 2-step a4 are checking the pictures in the matching picture set according to the picture set checking procedure. In making the selection of the drawings, attention is first paid to matching the collection of drawings. In this set, a drawing having the same editing scale as the current screen display scale is selected as the first choice. When selecting chart frames, the chart frames with the same scale are preferred because the chart frames with the same scale have higher comparability and accuracy. The scale is a way of representing the detail degree of the map content, and the map sheets with the same scale can ensure that the distances on the map are consistent with the actual distances, so that the map comparison and analysis are more accurate.
Step a5, selecting a first picture in the enlarged picture set as a current picture, and entering a step a6;
Step a6, judging whether the longitude and latitude range of the bounding box of the current picture intersects with the longitude and latitude range of the current residual view port, if not, entering a step a7, if so, selecting the current picture as a target picture, calculating a residual area with the intersecting part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a7, and if not, returning all the selected target pictures as a minimum set of rendered sea picture;
Step a7, judging whether all the pictures in the amplified picture set are traversed, if yes, entering a step a8, otherwise, selecting the next picture in the amplified picture set as the current picture, and returning to the step a6;
Step a 5-step a7 are checking the pictures in the enlarged picture set according to the picture set checking flow. If the minimum set of the rendered sea chart cannot be obtained in the matching chart set, the method turns to the enlarged chart set. In the enlarged picture set, traversing the enlarged picture set checking flow according to the sequence from the small editing scale to the large editing scale, namely checking the picture with priority close to the current screen display scale. The map with the scale closer to the map frame is selected, so that the accuracy and the detail degree of the map content can be ensured to be matched with the map frame, and information distortion or deficiency caused by overlarge or undersize of the scale is avoided.
For example, if E, F in the set of matching pictures is checked, the screen viewport is not full, i.e., the remaining viewports are not empty. The map of C, D in the 1:8000 group is then checked first, followed by the map of A, B in the 1:5000 group.
In the sequence selection of the enlarged image set and the reduced image set, when the actual range of the representation is the same, the larger the scale is, the larger the required image area is, and the smaller the scale is, the smaller the required image area is. The goal of the minimum set of chart frames is to want as few chart frames as possible, so the enlarged sets of chart frames are preferred.
Step a8, selecting a first picture in the reduced picture set as a current picture, and entering a step a9;
Step a9, judging whether the longitude and latitude range of the bounding box of the current picture intersects with the longitude and latitude range of the current residual view port, if not, entering a step a10, if so, selecting the current picture as a target picture, calculating a residual area with the intersecting part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a10, and if not, returning all the selected target pictures as a minimum set of rendered sea picture;
And a step a10 of judging whether all the pictures in the reduced picture set are traversed, if so, indicating that the minimum set of the picture with the chart completely matched with the view port of the current screen does not exist, ending the process, and if not, selecting the next picture in the reduced picture set as the current picture, and returning to the step a9.
Step a8 to step a10 are to inspect the pictures in the reduced large picture set according to the picture set inspection flow. If the minimum set of the chart pictures still cannot be obtained after the matching chart picture set and the enlarged chart picture set are used, the method changes to the reduced chart picture set. In the reduced image set, traversing the reduced image set checking flow according to the order of the editing scale from large to small, namely checking the image with priority close to the current screen display scale. The map with the scale closer to the map frame is selected, so that the accuracy and the detail degree of the map content can be ensured to be matched with the map frame, and information distortion or deficiency caused by overlarge or undersize of the scale is avoided.
For example, if all the magnified graphic assemblies C, D, A, B have been examined, the screen viewport is not full, i.e., the remaining viewports are not empty. The map of the 1:15000 group is then checked first G, H and then the map of the 1:15000 group is checked later I, J.
In this embodiment, in the step a3, the step a6, and the step a9, it is determined whether the latitude and longitude range of the bounding box of the current image intersects with the latitude and longitude range of the current remaining viewport, and the method specifically includes:
step a31, defining the latitude and longitude range of the current residual viewport, and converting the latitude and longitude range into a polygonal object;
The remaining view ports initialized are the same as the screen view ports, since no clipping operations have yet been performed. Therefore, the polygonal object of the screen view port can be directly assigned to the polygonal objects of the remaining view ports. The screen view port is a rectangular area, which is determined by the longitude and latitude coordinates of four vertices (or two diagonal vertices), and is converted into a rectangular (also called polygon) object, and the object represents the screen view port.
The left view port is then cut into a polygonal area, which is then converted into a polygonal object by determining the latitude and longitude coordinates of the points.
In the step a32, the longitude and latitude range of the bounding box of the picture is defined and converted into a polygonal object, wherein the bounding box is an algorithm for solving the optimal bounding space of a discrete point set, and the basic idea is to approximately replace a complex geometric object by a geometric body (called a bounding box) which is slightly large in volume and simple in characteristic.
Step a33, creating a clip object by using a clip library (clip library or other similar clip library), and configured to perform an intersecting operation;
Step a34, taking the polygonal object of the current residual view port as a clipping object (clip), taking the polygonal object of the bounding box of the picture as a clipped object (subject), and adding the clipped object into the clip object;
step a35, executing an intersecting operation, and obtaining a polygon set, wherein the polygon set represents an intersecting surface of a cutting object and a cut object;
Step a36, checking whether the polygon set returned by the intersecting operation is empty, if so, the longitude and latitude range of the bounding box of the picture is not intersected with the longitude and latitude range of the current residual view port, and if not, the longitude and latitude range of the bounding box of the picture is intersected with the longitude and latitude range of the current residual view port.
In this embodiment, in the step 3, the drawing of the minimum set of rendered sea drawing is loaded and cut into tiles according to different scales and stored in the memory, and the method specifically includes:
Dividing the target image which is not buffered in the minimum set of the rendered sea chart images into a plurality of groups of tiles according to a geographic area and different scales, and loading the tiles, wherein the different scales comprise current editing scales r ', r '/r1 and r ' ×r2 of the target image, each group of tiles comprises a plurality of tiles, and each tile covers an area on the target image and comprises map data of the area under the corresponding scale;
Step b2, recording the use state information of each tile, and updating the use state information of a certain tile when a user uses the tile;
Step b3, adopting an LRU cache elimination algorithm to clean the unusual tiles;
step b4, setting a periodic cleaning mechanism, and periodically checking and cleaning unusual tiles;
And b5, setting a buffer space threshold, and starting an LRU buffer elimination algorithm to clean the unusual tiles when the storage space of the memory is larger than the buffer space threshold. Steps b 2-b 5 are management of the corresponding tiles of the map by the memory.
And 4, executing a caching thread, namely calculating the longitude and latitude ranges of the prediction area under different scales according to the central point position of the current screen view port and the current screen display scale, adding the longitude and latitude ranges under different scales into the area to be cached, sequentially calculating a minimum set of the sea chart to be cached, which is matched with the area to be cached, from the matched chart set, the enlarged chart set and the reduced chart set according to the chart set checking flow, loading the chart in the minimum set of the sea chart to be cached, cutting the chart into tiles according to different scales, and storing the tiles in a memory, wherein the steps 3 and 4 are executed simultaneously without sequence.
In this embodiment, in the step 4, the latitude and longitude ranges of the prediction area under different scales are calculated according to the center point position of the current screen view port and the current screen display scale, and the latitude and longitude ranges under different scales are added into the area to be cached, which specifically includes:
step 41, monitoring the center point of the current screen view port and the current screen display scale r in real time;
and 42, fixing the position of the central point of the current screen view port, and expanding the boundary of the current screen view port outwards (expanding a certain range, such as an extra percentage of the screen view port range) to form a prediction area, wherein the expansion forms the prediction area to play a role of preloading, and the sea chart needed by the periphery is loaded in advance.
In this embodiment, the step 32 specifically includes:
Step 421, recording the operation of each time of zooming in or out by the user, including the time stamp of the occurrence of the operation, the type of the operation (zooming in or out) and the scale after the operation;
step 422, setting inertia judgment threshold values, including time threshold values, operation times threshold values and direction consistency threshold values;
And setting a time window for judging whether the continuous operation of the user belongs to the same inertial behavior. For example, if the user continuously performs the amplification operation in a short time, it can be considered that the inertial operation of the amplification action is being performed.
And setting a threshold of operation times for confirming the inertial behavior of the user. For example, if the user successively performs the zoom-in operation three times or more, it may be considered that it is more likely to continue the zoom-in.
The direction consistency threshold value is a threshold value of direction consistency for translation operation. For example, if the user successively performs three or more left-panning operations, it may be considered more likely to continue the left-panning.
Step 423, if the user continuously performs multiple zooming-in or zooming-out operations within a time threshold and the operation times exceed a set operation times threshold, determining that the operation is inertia operation, fixing the central point position of the current screen view port, and expanding the boundary of the current screen view port outwards within the same certain set range to form a predicted area, if under the zooming-in inertia, adjusting the editing scale range under the predicted area to [ r/r1, r x 2x n2], wherein n2 represents the zooming-in magnification, the value of n2 is set by the user, and n2 can be set as one of the zooming-in magnification at the last zooming-in operation, the average value of the zooming-in magnification of the multiple zooming-in operations, the maximum value of the zooming-out magnification of the multiple zooming-in operations, or the random one of the zooming-out magnification of the multiple zooming-out operations, if under the zooming-out inertia, adjusting the editing scale range under the predicted area to [ r/r1/n 2, r x 2], wherein n1 represents the value of the zooming-out magnification of the zooming-out is set by the user, and n1 can be set by the user at the user;
At this time, it is predicted that the user will continue with the zoom-in (or zoom-out) operation next. The predicted scale may be calculated based on the scale after the last operation by the user and a preset magnification (or reduction) factor.
Step 424, if the user continuously performs the translation operation in the same direction for a plurality of times within the time threshold, and the operation times exceed the set direction consistency threshold, determining that the operation is inertia operation;
At this point, it is predicted that the user will continue the panning operation in that direction next. The predicted new view center point coordinates may be calculated based on the coordinates of the last operation of the user and a preset translation distance.
And 43, calculating the longitude and latitude ranges of the prediction area under different scales according to the plane coordinate information, the longitude and latitude information and the current screen display scale r of the center point of the current screen view port, and converting the prediction area into the longitude and latitude ranges because the bounding boxes of each graph of the chart are the longitude and latitude ranges, thereby facilitating calculation.
1) Calculating a plurality of scales obtained by equidistant interpolation processing of the prediction area in the ranges of the scales of r, r/r1, r2 and (r/r 1, r) and longitude and latitude ranges of the scales obtained by equidistant interpolation processing in the ranges of the (r, r) and (specifically adopted distance values set by a user) when the inertial operation does not exist, wherein the editing scale range under the prediction area is [ r/r1, r x r2];
For example, r/r1=1:20000, r=1:10000, r×r2=1:5000, the edit scale range [ r/r1, r×r2] = [1:20000,1:5000] under the prediction area, and the latitude and longitude ranges under 1:20000,1:18000,1:160000,1:14000,1:12000,1:10000,1:8000,1:6000,1:5000 are calculated.
2) If the shrinkage inertia exists, the editing scale range under the prediction area is [ r/r1/n1, r2], wherein n1 represents the expansion shrinkage multiple, and the value of n1 is set by a user; calculating a plurality of scales obtained by equidistant interpolation processing of a prediction area in the ranges of scales r, r/r1, r x r2, r/r1/n1 and r/r1, (r/r 1, r) and a plurality of scales obtained by equidistant interpolation processing in the ranges of (r, r x r 2);
For example, r/r 1/n1=1:40000, r=1:10000, the editing scale range under the prediction area is [1:40000,1:5000];
3) If the amplification inertia exists, the editing scale range under the prediction area is [ r/r1, r x r 2x n2], wherein n2 represents the expansion amplification factor, and the value of n2 is set by a user; calculating a plurality of scales obtained by equidistant interpolation processing of a prediction area in the scale ranges of r, r/r1 and r2, (r/r 1 and r), a plurality of scales obtained by equidistant interpolation processing in the scale ranges of (r, r 2) and longitude and latitude ranges under the plurality of scales obtained by equidistant interpolation processing in the scale ranges of (r 2 and r 2) n 2;
For example, r2 n2=1:2500, r=1:10000, the edit scale range under the prediction area is [1:20000,1:2500];
calculating the longitude and latitude range of the predicted area under the corresponding scale and position according to the predicted operation type and parameters (scale, translation direction and distance) of the next step;
And 44, marking the prediction areas with the calculated multiple groups of longitude and latitude ranges as areas to be cached.
In this embodiment, in the step 4, a minimum set of chart frames to be cached, which is matched with the area to be cached, is calculated from the matching chart frame set, the enlarged chart frame set and the reduced chart frame set in sequence according to the chart frame set checking flow. The minimum set of chart frames refers to the minimum set of chart frames which is expected to be found and can render the current screen, and the minimum required chart frames are found out from a plurality of chart frames to render the chart so as to improve the chart loading speed.
In this embodiment, as shown in fig. 2, the method specifically includes:
Step a1, initializing the remaining view ports, wherein the initialized remaining view ports are the same as the area to be cached;
step a2, selecting a first picture in the matched picture set as a current picture, and entering a step a3;
Step a3, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a4, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a4, and if not, returning all the selected target drawings as the minimum set of the sea chart drawing to be cached;
step a4, judging whether all the pictures in the matched picture set are traversed, if yes, entering a step a5, otherwise, selecting the next picture in the matched picture set as the current picture, and returning to the step a3;
step a 2-step a4 are checking the pictures in the matching picture set according to the picture set checking procedure. In making the selection of the drawings, attention is first paid to matching the collection of drawings. In this set, a drawing having the same editing scale as the current screen display scale is selected as the first choice. When selecting chart frames, the chart frames with the same scale are preferred because the chart frames with the same scale have higher comparability and accuracy. The scale is a way of representing the detail degree of the map content, and the map sheets with the same scale can ensure that the distances on the map are consistent with the actual distances, so that the map comparison and analysis are more accurate.
Step a5, selecting a first picture in the enlarged picture set as a current picture, and entering a step a6;
step a6, judging whether the longitude and latitude range of the bounding box of the current picture intersects with the longitude and latitude range of the current residual view port, if not, entering a step a7, if yes, selecting the current picture as a target picture, calculating a residual area with the intersecting part removed as the current residual view port, continuously judging whether the current residual view port is empty, if yes, entering a step a7, and if not, returning all the selected target pictures as the minimum set of the chart pictures to be cached;
Step a7, judging whether all the pictures in the amplified picture set are traversed, if yes, entering a step a8, otherwise, selecting the next picture in the amplified picture set as the current picture, and returning to the step a6;
Step a 5-step a7 are checking the pictures in the enlarged picture set according to the picture set checking flow. If the minimum set of the chart to be cached cannot be obtained from the matching chart set, the method turns to the enlarged chart set. In the enlarged picture set, traversing the enlarged picture set checking flow according to the sequence from the small editing scale to the large editing scale, namely checking the picture with priority close to the current screen display scale. The map with the scale closer to the map frame is selected, so that the accuracy and the detail degree of the map content can be ensured to be matched with the map frame, and information distortion or deficiency caused by overlarge or undersize of the scale is avoided.
For example, if E, F in the set of matching pictures is checked, the screen viewport is not full, i.e., the remaining viewports are not empty. The map of C, D in the 1:8000 group is then checked first, followed by the map of A, B in the 1:5000 group.
In the sequence selection of the enlarged image set and the reduced image set, when the actual range of the representation is the same, the larger the scale is, the larger the required image area is, and the smaller the scale is, the smaller the required image area is. The goal of the minimum set of chart frames is to want as few chart frames as possible, so the enlarged sets of chart frames are preferred.
Step a8, selecting a first picture in the reduced picture set as a current picture, and entering a step a9;
Step a9, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a10, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a10, and if not, returning all the selected target drawings as the minimum set of the sea chart drawing to be cached;
and a step a10 of judging whether all the pictures in the reduced picture set are traversed, if so, indicating that the minimum set of the picture with the sea picture completely matched with the area to be cached does not exist, ending the process, and if not, selecting the next picture in the reduced picture set as the current picture, and returning to the step a9.
Step a8 to step a10 are to inspect the pictures in the reduced large picture set according to the picture set inspection flow. If the minimum set of the chart pictures still cannot be obtained after the matching chart picture set and the enlarged chart picture set are used, the method changes to the reduced chart picture set. In the reduced image set, traversing the reduced image set checking flow according to the order of the editing scale from large to small, namely checking the image with priority close to the current screen display scale. The map with the scale closer to the map frame is selected, so that the accuracy and the detail degree of the map content can be ensured to be matched with the map frame, and information distortion or deficiency caused by overlarge or undersize of the scale is avoided.
For example, if all the magnified graphic assemblies C, D, A, B have been examined, the screen viewport is not full, i.e., the remaining viewports are not empty. The map of the 1:15000 group is then checked first G, H and then the map of the 1:15000 group is checked later I, J.
In this embodiment, in the step a3, the step a6, and the step a9, it is determined whether the latitude and longitude range of the bounding box of the current image intersects with the latitude and longitude range of the current remaining viewport, and the method specifically includes:
step a31, defining the latitude and longitude range of the current residual viewport, and converting the latitude and longitude range into a polygonal object;
The remaining view ports initialized are the same as the screen view ports, since no clipping operations have yet been performed. Therefore, the polygonal object of the screen view port can be directly assigned to the polygonal objects of the remaining view ports. The screen view port is a rectangular area, which is determined by the longitude and latitude coordinates of four vertices (or two diagonal vertices), and is converted into a rectangular (also called polygon) object, and the object represents the screen view port.
The left view port is then cut into a polygonal area, which is then converted into a polygonal object by determining the latitude and longitude coordinates of the points.
In the step a32, the longitude and latitude range of the bounding box of the picture is defined and converted into a polygonal object, wherein the bounding box is an algorithm for solving the optimal bounding space of a discrete point set, and the basic idea is to approximately replace a complex geometric object by a geometric body (called a bounding box) which is slightly large in volume and simple in characteristic.
Step a33, creating a clip object by using a clip library (clip library or other similar clip library), and configured to perform an intersecting operation;
Step a34, taking the polygonal object of the current residual view port as a clipping object (clip), taking the polygonal object of the bounding box of the picture as a clipped object (subject), and adding the clipped object into the clip object;
step a35, executing an intersecting operation, and obtaining a polygon set, wherein the polygon set represents an intersecting surface of a cutting object and a cut object;
Step a36, checking whether the polygon set returned by the intersecting operation is empty, if so, the longitude and latitude range of the bounding box of the picture is not intersected with the longitude and latitude range of the current residual view port, and if not, the longitude and latitude range of the bounding box of the picture is intersected with the longitude and latitude range of the current residual view port.
In this embodiment, the step a3, the step a6, and the step a9 of calculating the remaining area with the intersection removed as the current remaining viewport specifically includes:
Taking the polygons of the rest view ports as cut objects, taking the polygon set as cut objects, and executing difference set operation by using a cutting library;
The result of the difference set operation will be a new set of polygons representing the portion of the remaining viewports not covered by the bounding box of the drawing sheet;
the polygons of the remaining viewports are updated to this new set of polygons.
In this embodiment, in the step 4, the chart of the minimum set of chart of the chart to be cached is loaded and cut into tiles according to different scales and stored in the memory, which specifically includes:
Dividing an unbuffered target image in a minimum set of rendered sea chart images/a minimum set of sea chart images to be buffered into a plurality of groups of tiles according to a geographic area and different scales, and loading the tiles, wherein the different scales comprise current editing scales r ', r '/r1 and r ' ×r2 of the target image, each group of tiles comprises a plurality of tiles, each tile covers an area on the target image and comprises map data of the area under the corresponding scale, and the size and shape of the tiles can be defined according to actual requirements, and the common tile size is 256x256 pixels;
Step b2, recording the use state information (such as the latest use time, the use frequency and the like) of each tile, and updating the use state information of a certain tile when the user uses the tile;
Step b3, adopting an LRU (least recently used) cache elimination algorithm to clean the unusual tiles;
step b4, setting a periodic cleaning mechanism, periodically checking and cleaning unusual tiles, and triggering based on conditions such as time intervals (such as each hour and each day) or buffer utilization rate;
And b5, setting a buffer space threshold, and starting an LRU buffer elimination algorithm to clean the unusual tiles when the storage space of the memory is larger than the buffer space threshold. And setting reasonable buffer space size limitation to avoid insufficient memory or storage space caused by overlarge buffer.
In this embodiment, in the step 3, the latitude and longitude range of the current screen view port under the current screen display scale is calculated according to the center point position of the current screen view port and the current screen display scale, and in the step 4, the latitude and longitude range of the prediction area under different scales is calculated according to the center point position of the current screen view port and the current screen display scale, specifically as follows:
calculating longitude and latitude ranges of the screen viewport/prediction region under a specific scale:
calculating latitude and longitude range in screen range
1. Setting parameters
Center point longitude, lon_C
Center point latitude lat_C
Sea chart scale S
Screen viewport/prediction region resolution: width pixels x height pixels
DPI (dots per inch): DPI
2. Calculating screen size (in cm)
Calculate screen width and height (in inches):
Screen view port/prediction area width (meter)
Screen viewport/predicted region height (meters):
3. Calculating the actual distance according to the scale
Actual distance of screen viewport/prediction region center to left and right edges:
Actual distance of screen viewport/prediction region center to upper and lower edges:
4. Calculating longitude and latitude variation
The circumference of the earth is about 40,075 km (equator), so:
the actual distance per latitude is about 111.32 km on the equator;
The actual distance per degree of latitude is approximately 111.32 km.
Latitude variation:
Longitude change amount:
calculating the longitude and latitude range of the screen viewport/prediction region:
latitude range { lat_C+Δlat, lat_C- Δlat }
Longitude range { lon_c+Δlon, lon_c- Δlon }, and
After the chart is enlarged, reduced or moved, the chart display range is changed, a chart needing to be used is selected by using a chart selection algorithm, if the chart tile data are already in the cache, the cache is directly used for efficiently rendering the chart, and if the chart tile data are not in the cache, the chart is rendered after loading the chart tile data. Meanwhile, the background predicts the chart picture needing to be preloaded under the current screen range by using an intelligent prediction algorithm, and manages cache data by using an LRU (least recently used) or other cache elimination algorithms, so that the cache hit rate is improved. Thereby improving the rendering performance of the chart.
As shown in fig. 3, the embodiment of the invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and capable of running on the processor, wherein the processor implements the above-mentioned map selection rendering method for implementing electronic chart stepless scaling when executing the program.
As shown in fig. 4, an embodiment of the present invention further provides a computer readable storage medium having a computer program stored thereon, which when executed by a processor implements a method for rendering a selected map that implements electronic sea map stepless scaling as described above.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (processor) to execute all or part of the steps of the methods of the embodiments of the present invention. The storage medium includes a U disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, an optical disk, or other various media capable of storing program codes.
The foregoing description is only a partial embodiment of the present invention, and is not intended to limit the scope of the present invention, and all equivalent devices or equivalent processes using the descriptions and the drawings of the present invention or directly or indirectly applied to other related technical fields are included in the scope of the present invention.
Claims (10)
1. A selective chart rendering method for realizing electronic chart stepless scaling is characterized by comprising the following steps:
Step 1, determining a chart editing scale range according to a current screen display scale, a maximum reduction multiple and a maximum magnification multiple;
Step 2, selecting the chart with the editing scale within the scope of the chart editing scale from all chart charts, and dividing the chart into a reduced chart set, a matched chart set and an enlarged chart set;
Step 3, executing a rendering thread, namely calculating the longitude and latitude range of the current screen view port under the current screen display scale according to the central point position of the current screen view port and the current screen display scale, sequentially calculating a rendering sea chart minimum set matched with the longitude and latitude range of the current screen view port from the matched chart set, the enlarged chart set and the reduced chart set according to a chart set checking flow, inquiring and judging from a memory whether the rendering sea chart minimum set is cached or not, if so, selecting a tile corresponding to a chart with the closest scale from the memory for rendering, otherwise, loading the chart of the rendering sea chart minimum set, cutting the chart into tiles according to different scales, storing the tiles in the memory, and selecting a tile corresponding to the chart with the closest scale from the memory for rendering;
And 4, executing a caching thread, namely calculating the longitude and latitude ranges of the prediction area under different scales according to the central point position of the current screen view port and the current screen display scale, adding the longitude and latitude ranges under different scales into the area to be cached, sequentially calculating a minimum set of the sea chart to be cached, which is matched with the area to be cached, from the matched chart set, the enlarged chart set and the reduced chart set according to the chart set checking flow, loading the chart in the minimum set of the sea chart to be cached, cutting the chart into tiles according to different scales, and storing the tiles in a memory, wherein the steps 3 and 4 are executed simultaneously without sequence.
2. The method for rendering a selective chart for realizing electronic chart stepless scaling according to claim 1, wherein the step 1 specifically comprises:
Step 11, defining an allowable maximum reduction multiple r1, an allowable maximum magnification multiple r2 and a current screen display scale r;
And step 12, determining a chart editing scale range as [ r/r1, r x r2] based on the allowed maximum reduction multiple r1, the allowed maximum magnification multiple r2 and the current screen display scale r.
3. The method for rendering a selective chart for implementing electronic chart stepless scaling according to claim 2, wherein said step 2 specifically comprises:
step 21, traversing all chart pictures, and screening out chart pictures with editing scales within the scope of the chart editing scales;
And 22, dividing the pictures with the editing scale smaller than the current screen display scale r into reduced picture sets, dividing the pictures with the editing scale equal to the current screen display scale r into matched picture sets, and dividing the pictures with the editing scale larger than the current screen display scale r into enlarged picture sets.
And step 23, taking the pictures with the same editing scale in all the pictures in the reduced picture set as the same group, arranging each group according to the sequence from large to small, taking all the pictures in the matched picture set as the same group, and taking the pictures with the same editing scale in all the pictures in the enlarged picture set as the same group, wherein each group is arranged according to the sequence from small to large.
4. The method for realizing stepless scaling of electronic chart according to claim 3, wherein in the step 4, the longitude and latitude ranges of the predicted area under different scales are calculated according to the center point position of the current screen view port and the current screen display scale, the longitude and latitude ranges under different scales are added into the area to be cached, and the method specifically comprises the following steps:
step 41, monitoring the center point of the current screen view port and the current screen display scale r in real time;
Step 42, fixing the position of the central point of the current screen view port, and expanding the boundary of the current screen view port outwards to form a prediction area;
Step 43, calculating longitude and latitude ranges of the prediction area under different scales according to plane coordinate information, longitude and latitude information and a current screen display scale r of a center point of a current screen view port:
1) Calculating a plurality of scales obtained by equidistant interpolation processing of the prediction area in the ranges of the scales of r, r/r1, r x r2 and longitude and latitude ranges of the prediction area in the ranges of the scales of (r, r x r 2) and a plurality of scales obtained by equidistant interpolation processing in the ranges of the scales of (r/r 1, r) when the inertial operation does not exist;
2) If the shrinkage inertia exists, the editing scale range under the prediction area is [ r/r1/n1, r2], wherein n1 represents the expansion shrinkage multiple, and the value of n1 is set by a user; calculating a plurality of scales obtained by equidistant interpolation processing of a prediction area in the ranges of scales r, r/r1, r x r2, r/r1/n1 and r/r1, (r/r 1, r) and a plurality of scales obtained by equidistant interpolation processing in the ranges of (r, r x r 2);
3) If the amplification inertia exists, the editing scale range under the prediction area is [ r/r1, r x r 2x n2], wherein n2 represents the expansion amplification factor, and the value of n2 is set by a user; calculating a plurality of scales obtained by equidistant interpolation processing of a prediction area in the scale ranges of r, r/r1 and r2, (r/r 1 and r), a plurality of scales obtained by equidistant interpolation processing in the scale ranges of (r, r 2) and longitude and latitude ranges under the plurality of scales obtained by equidistant interpolation processing in the scale ranges of (r 2 and r 2) n 2;
And 44, marking the prediction areas with the calculated multiple groups of longitude and latitude ranges as areas to be cached.
5. The method for rendering a selective chart for implementing electronic chart stepless scaling according to claim 4, wherein said step 42 specifically comprises:
Step 421, recording the operation of each time of zooming in or out by the user, including the time stamp of the occurrence of the operation, the operation type and the scale after the operation;
step 422, setting inertia judgment threshold values, including time threshold values, operation times threshold values and direction consistency threshold values;
Step 423, if the user continuously performs multiple zooming-in or zooming-out operations within a time threshold and the operation times exceed a set operation times threshold, judging that the operation is inertia operation, fixing the central point position of the current screen view port, expanding the boundary of the current screen view port outwards within the same certain setting range to form a prediction area, and if under the zooming-in inertia, adjusting the editing scale range under the prediction area to be [ r/r1, r x r2 x n2], wherein n2 represents the expansion magnification factor, and the value of n2 is set by the user, and if under the zooming-out inertia, adjusting the editing scale range under the prediction area to be [ r/r1/n1, r x r2], wherein n1 represents the expansion magnification factor, and the value of n1 is set by the user;
And 424, if the user continuously performs the translation operation in the same direction for a plurality of times within the time threshold, and the operation times exceed the set direction consistency threshold, judging that the operation is the inertial operation, fixing the central point position of the current screen view port to be unchanged, expanding the boundary of the current screen view port outwards within the same set range, and expanding a set range outwards along the translation direction to form a prediction area.
6. The method for realizing stepless scaling of electronic chart according to claim 5, wherein in the step 3, a rendered chart minimum set matching with the longitude and latitude range of the current screen view port is calculated from the matching chart set, the enlarged chart set and the reduced chart set in turn according to a chart set checking flow, and in the step 4, a cached chart minimum set matching with the area to be cached is calculated from the matching chart set, the enlarged chart set and the reduced chart set in turn according to a chart set checking flow, specifically comprising:
step a1, initializing a residual view port, wherein the initialized residual view port is the same as a current screen view port/a to-be-cached area;
step a2, selecting a first picture in the matched picture set as a current picture, and entering a step a3;
Step a3, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a4, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a4, and if not, returning all the selected target drawings as a minimum set of rendered sea chart drawings/a minimum set of sea chart drawings to be cached;
step a4, judging whether all the pictures in the matched picture set are traversed, if yes, entering a step a5, otherwise, selecting the next picture in the matched picture set as the current picture, and returning to the step a3;
step a5, selecting a first picture in the enlarged picture set as a current picture, and entering a step a6;
Step a6, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a7, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a7, and if not, returning all the selected target drawings as a minimum set of rendered sea chart drawings/a minimum set of sea chart drawings to be cached;
Step a7, judging whether all the pictures in the amplified picture set are traversed, if yes, entering a step a8, otherwise, selecting the next picture in the amplified picture set as the current picture, and returning to the step a6;
Step a8, selecting a first picture in the reduced picture set as a current picture, and entering a step a9;
Step a9, judging whether the longitude and latitude range of the bounding box of the current drawing is intersected with the longitude and latitude range of the current residual view port, if not, entering a step a10, if so, selecting the current drawing as a target drawing, calculating a residual area with the intersected part removed as the current residual view port, continuously judging whether the current residual view port is empty, if so, entering a step a10, and if not, returning all the selected target drawings as a minimum set of rendered sea chart drawings/a minimum set of sea chart drawings to be cached;
and a step a10 of judging whether all the pictures in the reduced picture set are traversed, if so, indicating that the minimum set of the picture with the sea picture completely matched with the view port/the area to be cached of the current screen does not exist, ending the flow, and if not, selecting the next picture in the reduced picture set as the current picture, and returning to the step a9.
7. The method for realizing stepless scaling of electronic chart according to claim 6, wherein the determining whether the latitude and longitude range of the bounding box of the current chart intersects with the latitude and longitude range of the current remaining viewport in step a3, step a6 and step a9 specifically comprises:
step a31, defining the latitude and longitude range of the current residual viewport, and converting the latitude and longitude range into a polygonal object;
Step a32, defining the longitude and latitude range of a bounding box of the picture and converting the longitude and latitude range into a polygonal object;
step a33, creating a clip object by using a clipping library, and configuring to execute an intersecting operation;
step a34, taking the polygonal object of the current residual view port as a clipping object, taking the polygonal object of the bounding box of the picture as a clipped object, and adding the clipped object into the clip object;
step a35, executing an intersecting operation, and obtaining a polygon set, wherein the polygon set represents an intersecting surface of a cutting object and a cut object;
Step a36, checking whether the polygon set returned by the intersecting operation is empty, if so, the longitude and latitude range of the bounding box of the picture is not intersected with the longitude and latitude range of the current residual view port, and if not, the longitude and latitude range of the bounding box of the picture is intersected with the longitude and latitude range of the current residual view port.
8. The method for realizing electronic chart stepless scaling according to claim 1, wherein in the step 3, the chart of the minimum set of rendered chart is loaded and cut into tiles according to different scales and stored in the memory, and in the step 4, the chart of the minimum set of chart to be cached is loaded and cut into tiles according to different scales and stored in the memory, specifically comprising:
dividing an unbuffered target image in the minimum set of rendered sea image images/the minimum set of sea image images to be buffered into a plurality of groups of tiles according to a geographic area and different scales, and loading the tiles, wherein the different scales comprise current editing scales r ', r '/r1 and r ' ×r2 of the target image, each group of tiles comprises a plurality of tiles, each tile covers an area on the target image, and map data of the area under the corresponding scale are contained;
Step b2, recording the use state information of each tile, and updating the use state information of a certain tile when a user uses the tile;
Step b3, adopting an LRU cache elimination algorithm to clean the unusual tiles;
step b4, setting a periodic cleaning mechanism, and periodically checking and cleaning unusual tiles;
and b5, setting a buffer space threshold, and starting an LRU buffer elimination algorithm to clean the unusual tiles when the storage space of the memory is larger than the buffer space threshold.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements a method of rendering a selection map for achieving a stepless scaling of an electronic sea map as claimed in any one of claims 1 to 8 when executing the program.
10. A computer readable storage medium having stored thereon a computer program, which when executed by a processor implements a method of selective graph rendering for achieving a stepless scaling of electronic sea graphs according to any of claims 1 to 8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411606128.2A CN119559277A (en) | 2024-11-12 | 2024-11-12 | A method, device and medium for selecting and rendering electronic charts for stepless zooming |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202411606128.2A CN119559277A (en) | 2024-11-12 | 2024-11-12 | A method, device and medium for selecting and rendering electronic charts for stepless zooming |
Publications (1)
Publication Number | Publication Date |
---|---|
CN119559277A true CN119559277A (en) | 2025-03-04 |
Family
ID=94739156
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202411606128.2A Pending CN119559277A (en) | 2024-11-12 | 2024-11-12 | A method, device and medium for selecting and rendering electronic charts for stepless zooming |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN119559277A (en) |
-
2024
- 2024-11-12 CN CN202411606128.2A patent/CN119559277A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20130271479A1 (en) | Efficient pre-computing of simplified vector data for rendering at multiple zoom levels | |
US7436405B2 (en) | Terrain rendering using nested regular grids | |
KR100594073B1 (en) | Digital Image Scaling Method for Embedded System | |
CN110704770B (en) | Display method and device for expansion tile map based on WebGIS environment | |
Hwa et al. | Adaptive 4-8 texture hierarchies | |
CN110602477B (en) | Display method, display device, electronic equipment and storage medium | |
CN101615191A (en) | Storage and Real-time Visualization Method of Massive Point Cloud Data | |
US20140280676A1 (en) | System and method for interactive spatio-temporal streaming data | |
CN106599025B (en) | Vector data slicing method and system based on data exchange format | |
CN110580273B (en) | Map GIS data processing and storing method and device and readable storage medium | |
Buchholz et al. | View-dependent rendering of multiresolution texture-atlases | |
CN110992246A (en) | Pyramid layered slicing method for image | |
EP1756521A2 (en) | Method for encoding and serving geospatial or other vector data as images | |
CN111026891A (en) | Map bottom map integration method | |
Yusov et al. | High-performance terrain rendering using hardware tessellation | |
CN119559277A (en) | A method, device and medium for selecting and rendering electronic charts for stepless zooming | |
CN113495935B (en) | A terrain slicing method and system based on irregular triangulated mesh generation | |
Masood et al. | A novel method for adaptive terrain rendering using memory-efficient tessellation codes for virtual globes | |
JP2000148126A (en) | Image display device and method | |
CN118964409B (en) | Method to improve the display speed of high-resolution coastline database on mobile computing platform | |
Kang et al. | An efficient simplification and real-time rendering algorithm for large-scale terrain | |
CN118245691B (en) | Dynamic loading method for massive map data | |
WO2024109070A1 (en) | Tile map processing method and apparatus, electronic device and storage medium | |
CN112070910B (en) | Data processing method and device | |
CN119327107A (en) | Screen display method and device, computing device, and computer-readable storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |