Method and device for drawing GIS map during display position translation and readable medium

By employing a four-thread mechanism and an optimized caching mechanism, the problems of slow data loading, white border display, and inconsistent edge transitions during GIS map panning were resolved, resulting in fast and seamless GIS map display.

CN120807697APending Publication Date: 2025-10-17XIAMEN KINGTOP INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510841138.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-10-17

AI Technical Summary

Technical Problem

Existing technologies for GIS map panning suffer from problems such as excessively long data loading times, white borders, uneven edge transitions, and reduced rendering speed during multiple rapid pannings.

Method used

A four-thread mechanism is adopted, namely the first, second, third and fourth threads. Through preloading and caching mechanisms, image caching is optimized to ensure seamless display during multiple fast panning processes and reduce white borders and edge connection issues.

Benefits of technology

It enables the display of multiple rapid map pans while maintaining refresh rate, shortens drawing time, and solves the problems of white borders and edge connection during panning, ensuring the consistency of panning speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807697A_ABST
    Figure CN120807697A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for drawing a GIS map during display position translation and a readable medium. The method comprises the steps that a vector image set of the map and the display coordinate range of the nth round are obtained; when the first image cache of the nth round is not empty and the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, selecting a source image corresponding to the display coordinate range of the nth round from the first image cache of the nth round as a display area image of the nth round, and displaying the display area image of the nth round; when the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round; and if not, selecting the candidate display area image corresponding to the display coordinate range of the nth round from the second image cache of the nth round as the display area image of the nth round and displaying, thereby solving the problems of white edge and connection drawing of map edges during translation.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of map drawing, in particular to a method and device for drawing GIS map during position translation and a readable medium. BACKGROUND

[0002] With the popularity of smart devices and mobile applications, users' demand for map services is growing. Not only do they need maps to provide accurate geographic location information, but they also expect maps to be quickly drawn and visually flawless, especially in the edge area of the map. Visual defects such as white edges can affect users' experience and even lead to incorrect interpretation and decision-making. Therefore, providing a fast-drawing map display effect without white edges and high definition has become an important task for GIS system developers and designers.

[0003] To solve the above problems, developers need to innovate in map rendering and display technology. This involves the application of multi-threading technology and background pre-loading and drawing to ensure fast loading and seamless connection of map data. At the same time, image caching mechanisms need to be optimized to reduce display problems caused by incomplete or delayed data loading.

[0004] In solving the user experience problem of image drawing, the commonly used technique is to use double-buffer display technology, which simply means drawing in advance in memory before the next image is viewed, and copying the corresponding image in memory to the current display device when the next image mentioned earlier needs to be loaded. This method can also be used for common panning tools, which generate the content to be viewed in memory in advance, copy the generated image in memory to the front-end screen when panning starts, and then generate the content to be viewed in advance after panning is completed, and so on.

[0005] In practical applications, most of them use a 3x3 range, similar to a nine-square grid, with the current map display window range in the middle. However, various problems may arise during actual implementation:

[0006] 1. Displaying in a 3x3 range will result in a data range that is 9 times the original, and the drawing picture will also take twice as long;

[0007] 2. Multiple panning in a short period of time, i.e., the panning interval time is less than the image drawing time, will also result in more time-consuming refresh time;

[0008] 3. In the case of big data, GIS data reading, object drawing and label drawing take a long time. For example, in QGIS, in the actual measurement, 10G data is taken as an example, which contains 150 layers, the number of objects displayed on the interface is more than 500, and the label is drawn, QGIS needs about 6 seconds. If generated in a 3x3 range, the time consumption will be about 10 seconds. In this case, in actual application, if the translation range exceeds the cache range, the time consumption of each map drawing is too long.

[0009] 4. If only a small distance (e.g. 1 / 6 of the map display coordinate range) is translated each time and operated multiple times in a short time. At this time, if double buffering is used, the next image will be replaced by a new range before it is generated. In this case, using double buffering display, the current image has been deleted, but the image for display has not been generated, and it is always in the process of regenerating the image according to the new range, resulting in a significant decrease in the drawing speed of the map.

[0010] 5. The drawing of the white border part during translation will have the problem of not connecting with the original edge drawing, such as Figure 1 and Figure 2 the annotation display of a certain place, Figure 2 which is the newly drawn part after translation, and its content does not contain a certain place, so the annotation is not displayed, and the edge connection (at the red dot) is problematic. SUMMARY

[0011] The purpose of the present application is to propose a GIS map drawing method, device and readable medium for display position translation.

[0012] In a first aspect, the present application provides a GIS map drawing method for display position translation, comprising the following steps:

[0013] obtaining a set of vector images of a map, and in response to determining that a map translation operation instruction is received, obtaining a display coordinate range of the nth round;

[0014] defining a first image cache of the nth round and a second image cache of the nth round, the first image cache of the nth round storing source images of display area images of the nth round, and the second image cache of the nth round storing candidate display area images determined according to the map translation operation instruction on the basis of the first image cache of the nth round;

[0015] In response to determining that the first image cache of the nth round is not empty and the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, a source image corresponding to the display coordinate range of the nth round is selected from the first image cache of the nth round as the display area image of the nth round and is displayed according to the setting.

[0016] In response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, a candidate display area image corresponding to the display coordinate range of the nth round is selected from the second image cache of the nth round as the display area image of the nth round and is displayed according to the setting.

[0017] As a preferred, further comprising:

[0018] In response to determining that the first image cache is empty or the current display coordinate range is not within the coordinate range corresponding to the first image cache, it is determined whether the second image cache is empty.

[0019] As a preferred, further comprising:

[0020] In response to determining that the second image cache of the nth round is empty or the display coordinate range of the nth round is not within the coordinate range corresponding to the second image cache of the nth round, a pre-display area image of the nth round is generated according to the display coordinate range of the nth round and is displayed according to the setting.

[0021] As a preferred, further comprising: providing a first thread and a second thread, wherein the first thread is a resident thread, and the first thread is used to determine whether to start and close the second thread according to the display coordinate range of the nth round, the coordinate range corresponding to the first image cache of the nth round, and the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread;

[0022] The execution process of the first thread is as follows:

[0023] It is determined whether the first image cache of the nth round is empty;

[0024] In response to determining that the first image cache of the nth round is not empty, it is determined whether the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round;

[0025] In response to determining that the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, the first thread is repeatedly executed;

[0026] in response to determining that the first image cache of the nth round is empty or the display coordinate range of the nth round is not within the coordinate range corresponding to the first image cache of the nth round, it is determined whether the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread is empty;

[0027] in response to determining that the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is not empty, it is determined whether the coordinate range corresponding to the center image of the nine-square range in the first image cache of the nth round is within the coordinate range corresponding to the first image cache of the nth round being generated in the second thread, if yes, the first thread is repeatedly executed, otherwise, the second thread is ended, and the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread is calculated;

[0028] in response to determining that the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is empty, the coordinate range corresponding to the first image cache of the nth round is generated according to the display coordinate range of the nth round, if the display coordinate range of the nth round is (x1, y1, x2, y2), the coordinate range corresponding to the first image cache of the nth round is (2*x1-x2, 2*x2-x1, 2*y1-y2, 2*y2-x1), and the second thread is started;

[0029] The execution process of the second thread is as follows:

[0030] According to the coordinate range corresponding to the first image cache of the nth round being generated, the corresponding vector image is obtained from the vector image set and cached in the first image cache of the nth round, and the coordinate range corresponding to the first image cache of the nth round being generated is set to empty.

[0031] As a preferred, it further comprises:

[0032] in response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, the second image cache of the nth round is assigned to the first image cache of the nth round, the coordinate range corresponding to the second image cache of the nth round is assigned to the coordinate range corresponding to the first image cache of the nth round, and it is determined whether the second thread is running, if yes, the second thread is closed, and the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is set to empty.

[0033] As a preferred, it further comprises: providing a third thread and a fourth thread, wherein the third thread is a resident thread;

[0034] The execution process of the third thread is as follows:

[0035] in response to determining that the coordinate range corresponding to the center image of the nine-square range in the first image cache generated according to the display coordinate range of the n-1th round exists an overlapping range with the display coordinate range of the nth round, obtaining the coordinate range corresponding to the center image of the nine-square range in the second image cache of the nth round and the coordinate range corresponding to the second image cache of the nth round according to the overlapping range of the coordinate range corresponding to the center image of the nine-square range in the first image cache and the display coordinate range of the nth round;

[0036] in response to determining that the coordinate range corresponding to the center image of the nine-square range in the first image cache generated according to the display coordinate range of the n-1th round does not exist an overlapping range with the display coordinate range of the nth round, assigning the display coordinate range of the nth round as the coordinate range corresponding to the center image of the nine-square range in the second image cache of the nth round, and the coordinate range corresponding to the second image cache of the nth round is the nine-square range with the display coordinate range of the nth round as the center image of the nine-square range;

[0037] in response to determining that the coordinate range corresponding to the second image cache of the nth round being generated in the fourth thread is empty, assigning the coordinate range corresponding to the second image cache of the nth round being generated in the fourth thread as the coordinate range corresponding to the second image cache of the nth round, and starting the fourth thread to generate an image according to the coordinate range corresponding to the second image cache of the nth round being generated in the fourth thread and store the image in the second image cache;

[0038] in response to determining that the coordinate range corresponding to the second image cache of the nth round being generated in the fourth thread is not empty, determining whether the coordinate range corresponding to the center image of the nine-square range in the second image cache of the nth round is within the coordinate range corresponding to the second image cache of the nth round being generated in the fourth thread, if yes, looping the third thread, otherwise, ending the fourth thread and calculating the coordinate range corresponding to the second image cache of the n+1th round being generated in the fourth thread;

[0039] the execution process of the fourth thread is as follows:

[0040] obtaining the corresponding vector image in the vector image set according to the coordinate range corresponding to the second image cache of the nth round being generated and caching the vector image in the second image cache of the nth round, and setting the coordinate range corresponding to the second image cache of the nth round being generated as empty.

[0041] as preferred, further comprising: saving the display area image of the nth round in the third image cache of the nth round, and in response to determining that the refresh instruction is received, obtaining the image from the third image cache of the nth round and displaying according to the setting.

[0042] In a second aspect, the present application provides a device for drawing a GIS map during position translation, comprising:

[0043] a data acquisition module configured to acquire a vector image set of the map, and acquire a display coordinate range of the nth round in response to determining that a map translation operation instruction is received;

[0044] a definition module configured to define a first image cache of the nth round and a second image cache of the nth round, the first image cache of the nth round storing source images of display area images of the nth round, and the second image cache of the nth round storing candidate display area images determined according to the map translation operation instruction on the basis of the first image cache of the nth round;

[0045] a first display module configured to, in response to determining that the first image cache of the nth round is not empty and the display coordinate range of the nth round is within a coordinate range corresponding to the first image cache of the nth round, select a source image corresponding to the display coordinate range of the nth round from the first image cache of the nth round as a display area image of the nth round and display the display area image according to a setting;

[0046] a second display module configured to, in response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within a coordinate range corresponding to the second image cache of the nth round, select a candidate display area image corresponding to the display coordinate range of the nth round from the second image cache of the nth round as a display area image of the nth round and display the display area image according to a setting.

[0047] In a third aspect, the present application provides an electronic device, comprising one or more processors; a storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the implementation manners of the first aspect.

[0048] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, when the computer program is executed by a processor, the method described in any of the implementation manners of the first aspect is implemented.

[0049] In a fifth aspect, the present application provides a computer program product, comprising a computer program, when the computer program is executed by a processor, the method described in any of the implementation manners of the first aspect is implemented.

[0050] Compared with the prior art, the present application has the following beneficial effects:

[0051] (1) The drawing method of the GIS map during display position translation provided by the present application provides a first image cache of the nth round storing the source image of the display area image of the nth round and a second image cache of the nth round storing the candidate display area image determined according to the map translation operation instruction on the basis of the first image cache of the nth round, and the drawing method realizes the display of the multiple fast translations of the map within a certain range while maintaining the original refreshing speed.

[0052] (2) The drawing method of the GIS map during display position translation provided by the present application can effectively shorten the drawing time and realize the fast refreshing of the map.

[0053] (3) The drawing method of the GIS map during display position translation provided by the present application solves the problems of the white edge of the map during translation and the connection drawing, and ensures that the speeds of the two are basically consistent in the case of multiple fast translations. BRIEF DESCRIPTION OF DRAWINGS

[0054] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0055] Figure 1 GIS map before translation using prior art;

[0056] Figure 2 GIS map after translation using prior art;

[0057] Figure 3 Flowchart of the drawing method of the GIS map during display position translation of the embodiment of the present application;

[0058] Figure 4 Flowchart of the drawing method of the GIS map during display position translation of the embodiment of the present application;

[0059] Figure 5 Flowchart of the first thread of the drawing method of the GIS map during display position translation of the embodiment of the present application;

[0060] Figure 6 Flowchart of the third thread of the drawing method of the GIS map during display position translation of the embodiment of the present application;

[0061] Figure 7 The first n round of the drawing method of the GIS map during display position translation of the embodiment of the present application corresponds to the coordinate range of the first n-1 round of image1

[0062] Figure 8 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case two is shown in the figure 2;

[0063] Figure 9 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case three is shown in the figure 3;

[0064] Figure 10 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case four is shown in the figure 4;

[0065] Figure 11 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case five is shown in the figure 5;

[0066] Figure 12 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case six is shown in the figure 6;

[0067] Figure 13 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case seven is shown in the figure 7;

[0068] Figure 14 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case eight is shown in the figure 8;

[0069] Figure 15 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case nine is shown in the figure 9;

[0070] Figure 16 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case nine is shown in the figure 9;

[0071] Figure 17 For the display position of the embodiment of the application, the display coordinate range of the n th round of the drawing method of the GIS map when the position is translated corresponds to the coordinate range of the image1 of the n-1 th round, and the overlap case nine is shown in the figure 9; DETAILED DESCRIPTION

[0072] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work fall within the scope of the present application.

[0073] Figure 3 A method for drawing a GIS map during position translation is provided by the embodiments of the present application, which comprises the following steps:

[0074] S1, obtaining a vector image set of a map, and in response to determining that a map translation operation instruction is received, obtaining a display coordinate range of the nth round.

[0075] Specifically, the vector data is first loaded into the GIS system to obtain the vector image set. After the vector data is loaded into the GIS system, the user can perform a map translation operation, thus generating a corresponding map translation operation instruction and obtaining a display coordinate range of the nth round.

[0076] S2, defining a first image cache of the nth round and a second image cache of the nth round, the first image cache of the nth round storing a source image of a display area image of the nth round, and the second image cache of the nth round storing a candidate display area image determined according to the map translation operation instruction on the basis of the first image cache of the nth round.

[0077] Specifically, the display coordinate range of the nth round is the map coordinate range of the display area image to be displayed by the GIS system in the nth round, denoted as showrect, and referred to as the display coordinate range of the nth round. The display area image in the nth round is cached in imagecur. The display coordinate range of the (n-1)th round is denoted as oldrect. The first image cache is image1, the coordinate range of the center image is showrect1, image1 is generated according to showrect1 in a nine-square grid, showrect1 is the center of the nine-square grid, and the eight images around showrect1 are stored in the first image cache together. The coordinate range corresponding to image1 is rect1. The first image cache in the nth round stores the source image of the display area image in the nth round. The display area image in the nth round can only be a part of the image stored in the first image cache in the nth round. The second image cache is image2, the coordinate range of the center image is showrect2, image2 is generated according to showrect2 in a nine-square grid, showrect12 is the center of the nine-square grid, and the eight images around showrect12 are stored in the second image cache together. The coordinate range corresponding to image2 is rect2. Image2 stores the image of the range that may be displayed by the GIS system in advance according to the map panning operation, such as left panning of the map. Since the coordinate range corresponding to image2 is on the left of the coordinate range corresponding to image1, when the GIS system displays the coordinate range to the left, that is, moves from the range of image1 to the range of image2, the GIS system obtains the image information from image2, and image1 is not needed. The information thereafter is also obtained from image1, so image2 is assigned to image1. Rectref1 refers to the coordinate range of the image being generated in the second thread, and rect1 refers to the coordinate range of the generated image. For example, when the map moves to obtain image information from image1, the image information is obtained according to the comparison between rect1 and the current display coordinate range showrect. When image1 does not exist, rect1 is empty. Rectref1 refers to the corresponding image being generated in the second thread. When the second thread is not running or stops, rectref1 is empty. When the generation is completed, rectref1 is assigned to rect1, and rectref1 is set to empty. Similarly, rectref2 refers to the coordinate range of the image being generated in the fourth thread, and rect2 refers to the coordinate range of the generated image. For example, when the map moves to obtain image information from image2, the image information is obtained according to the comparison between rect2 and the current display coordinate range showrect.When image2 does not exist, rect2 is empty; rectref2 is the corresponding fourth thread in the generation, if the fourth thread is not running or stopping, rectref2 is empty, when the generation is completed, rectref2 is assigned to rect2, and rectref2 is set to empty. Wherein, the corresponding positions of image1 and image2 of each round can be the same or different. Preferably, the corresponding positions of each round are the same, then the corresponding image1 and image2 need to be emptied after each round. Similarly, rect1, rectref1, rect2 and rectref2 also need to be emptied.

[0078] The first thread is used to determine whether to start and close the second thread according to showrect, rect1 and rectref1, and to calculate a new rectref1 for the second thread to obtain range data and generate image1.

[0079] The second thread is used to obtain the information of the corresponding range from the vector image set according to the input rectref1 and generate an image, update the value of image1 as the newly generated image after the generation is completed, and set rectref1 to empty.

[0080] The third thread is used to determine whether to start and close the fourth thread 4 according to showrect, rect2, oldrect and rectref2, and to calculate a new rectref2 for the fourth thread to obtain range data and generate image2.

[0081] The fourth thread is used to obtain the information of the corresponding range from the vector image set according to the input rectref2 and generate an image, update the value of image2 as the newly generated image after the generation is completed, and set rectref2 to empty.

[0082] The first thread and the second thread are mainly applied when the initial loading of the vector data for display or the panning range exceeds the coordinate range corresponding to image1 and image2.

[0083] The third thread and the fourth thread are based on the current map panning operation to determine the possible panning direction and obtain the image cached in image2 according to the pre-determined range.

[0084] S3, in response to determining that the first image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, selecting the source image corresponding to the display coordinate range of the nth round from the first image cache of the nth round as the display area image of the nth round and displaying it according to the settings.

[0085] S4, in response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, selecting a candidate display area image corresponding to the display coordinate range of the nth round from the second image cache of the nth round as the display area image of the nth round and displaying according to the settings.

[0086] In specific embodiments, further comprising:

[0087] In response to determining that the first image cache is empty, or the current display coordinate range is not within the coordinate range corresponding to the first image cache, determining whether the second image cache is empty.

[0088] In specific embodiments, further comprising:

[0089] In response to determining that the second image cache of the nth round is empty, or the display coordinate range of the nth round is not within the coordinate range corresponding to the second image cache of the nth round, generating a front display area image of the nth round according to the display coordinate range of the nth round and displaying according to the settings.

[0090] In specific embodiments, further comprising:

[0091] In response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, assigning the second image cache of the nth round to the first image cache of the nth round, assigning the coordinate range corresponding to the second image cache of the nth round to the coordinate range corresponding to the first image cache of the nth round, and determining whether the second thread is running, if so, closing the second thread, and setting the coordinate range corresponding to the first image cache of the nth round being generated in the second thread to empty.

[0092] In specific embodiments, further comprising: saving the display area image of the nth round in the third image cache of the nth round, in response to determining that a refresh instruction is received, obtaining the image from the third image cache of the nth round and displaying according to the settings.

[0093] Specifically, referring to Figure 4 , when a position translation occurs, the drawing process of the GIS map is as follows:

[0094] S101: determining whether the image1 of the nth round is empty:

[0095] 1) not empty, then judge whether the showrect of the nth round is in the coordinate range of rectl of the nth round, i.e. whether the map coordinate range of the display area image to be displayed of the nth round is in the coordinate range of image1 of the nth round;

[0096] a. yes, then the information of the corresponding range of the vector image is obtained from image1 of the nth round and transmitted into the GIS system for display;

[0097] b. no, step S102 is performed.

[0098] 2) empty, i.e. the information of the vector image cached in image1 of the nth round is empty, then step S102 is performed.

[0099] S102: judge whether image2 of the nth round is empty:

[0100] 1) not empty, then judge whether the showrect of the nth round is in the coordinate range of rect2 of the nth round, i.e. whether the map coordinate range of the display area image to be displayed of the nth round is in the coordinate range of image2 of the nth round.

[0101] a. yes, then the information of the corresponding range of the vector image is obtained from image2 of the nth round and transmitted into the GIS system for display, meanwhile rect2 of the nth round and image2 of the nth round are assigned to rect1 of the nth round and image1 of the nth round, rect2 of the nth round and image2 of the nth round are emptied. Meanwhile, it is judged whether the second thread is running, if running, the second thread is closed and rectref1 of the nth round is set to empty.

[0102] b. no, step S103 is performed.

[0103] 2) empty, i.e. the information of the vector image cached in image2 of the nth round is empty, then step S103 is performed.

[0104] Step S103: generate an image according to the map coordinate range of the display area image to be displayed of the nth round, the GIS system obtains relevant feature objects according to showrect and draws according to the setting. The information of the generated image is transmitted into the GIS system for display. That is, the drawing method of the original GIS system is maintained, the drawing range and setting also adopt the functions of the original GIS system, so as to ensure that the original drawing speed is not affected.

[0105] Step S104: the GIS system displays the received image information on the screen according to the setting, realizing the browsing display of data.

[0106] Step S105: The GIS system saves the displayed image of the nth round of display area to a layer.

[0107] Step S106: When refreshing, the GIS system acquires the image information from imagecur and displays, without reacquiring data and drawing, the image.

[0108] In a specific embodiment, further comprising: providing a first thread and a second thread, wherein the first thread is a resident thread, and the first thread is configured to determine whether to start and close the second thread according to the display coordinate range of the nth round, the coordinate range corresponding to the first image cache of the nth round, and the coordinate range corresponding to the first image cache of the nth round being generated in the second thread.

[0109] The execution process of the first thread is as follows:

[0110] determining whether the first image cache of the nth round is empty;

[0111] in response to determining that the first image cache of the nth round is not empty, determining whether the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round;

[0112] in response to determining that the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, repeatedly executing the first thread;

[0113] in response to determining that the first image cache of the nth round is empty, or the display coordinate range of the nth round is not within the coordinate range corresponding to the first image cache of the nth round, determining whether the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is empty;

[0114] in response to determining that the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is not empty, determining whether the coordinate range corresponding to the center image of the nine-square range in the first image cache of the nth round is within the coordinate range corresponding to the first image cache of the nth round being generated in the second thread, if so, repeatedly executing the first thread, otherwise, ending the second thread, and calculating the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread;

[0115] in response to determining that the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is empty, generating the coordinate range corresponding to the first image cache of the nth round according to the display coordinate range of the nth round, if the display coordinate range of the nth round is (x1, y1, x2, y2), the coordinate range corresponding to the first image cache of the nth round is (2*x1-x2, 2*x2-x1, 2*y1-y2, 2*y2-x1), and starting the second thread;

[0116] The execution process of the second thread is as follows:

[0117] According to the coordinate range corresponding to the first image cache of the nth round being generated, the corresponding vector image is obtained from the vector image set and cached in the first image cache of the nth round. The coordinate range corresponding to the first image cache of the nth round being generated is set to empty.

[0118] Specifically, referring to Figure 5 , the execution process of the first thread is as follows:

[0119] S111: Determine whether the image1 of the nth round is empty, i.e., whether the image cached in the image1 of the nth round has been generated:

[0120] A. No, determine whether the showrect of the nth round is in the coordinate range of rect1, i.e., whether the map coordinate range of the display area image to be displayed of the nth round is in the coordinate range of the image1 of the nth round:

[0121] a. Yes, indicating that the display area image to be displayed of the nth round is in the image1 of the nth round, and no need to regenerate, continue the first thread loop;

[0122] b. No, indicating that the display area image to be displayed of the nth round is not in the image1 of the nth round, and needs to be reacquired, entering step S112;

[0123] B. Yes, i.e., the information of the vector image cached in the image1 of the nth round is empty, and needs to be reacquired entering step S112;

[0124] S112: Determine whether the rectref1 of the nth round is empty, thereby determining whether the second thread is generating the image1:

[0125] A. No: indicating that the second thread is running, entering step S113;

[0126] B. Yes: indicating that the second thread is not running, entering step S115;

[0127] S113: Determine whether the coordinate range of the showrect1 of the nth round is in the coordinate range of the rectref1 of the nth round:

[0128] A. No: indicating that the range to be displayed of the nth round has exceeded the coordinate range of the image being generated in the second thread, and the second thread needs to be stopped, and the picture is generated according to the coordinate range of the rectref1 of the nth+1 round, entering step S114;

[0129] B. is: the image1 of the n th round generated by the second thread contains the coordinate range of the showrect1 of the n th round, no need to regenerate, continue the first thread;

[0130] Step S114: end the second thread, because the current display coordinate range of the n th round has exceeded the coordinate range of the image1 of the n th round being generated, no need to continue to generate, so end the second thread, and regenerate the cache picture according to the coordinate range of the showrect1 of the n th round.

[0131] Step S115: generate the nine-square range rect1 according to the coordinate range of the showrect of the n th round, and assign rectref1 = rect1. Assuming that the range of the showrect of the n th round is (x1, y1, x2, y2), the range of the rect1 of the n th round is (2*x1-x2, 2*x2-x1, 2*y1-y2, 2*y2-x1).

[0132] Step S116: start the second thread to obtain and generate an image from the vector image set according to the coordinate range of the rectref1 of the n th round.

[0133] Step S117: save the information of the generated image to the image1 of the n th round, and set the rectref1 of the n th round to be empty.

[0134] In a specific embodiment, further comprising: providing a third thread and a fourth thread, wherein the third thread is a resident thread;

[0135] The execution process of the third thread is as follows:

[0136] In response to determining that the coordinate range corresponding to the center image of the nine-square range in the first image cache generated according to the display coordinate range of the n-1 th round has an overlapping range with the display coordinate range of the n th round, obtaining the coordinate range corresponding to the center image of the nine-square range in the second image cache of the n th round and the coordinate range corresponding to the second image cache of the n th round according to the overlapping range of the coordinate range corresponding to the center image of the nine-square range in the first image cache of the n-1 th round and the display coordinate range of the n th round;

[0137] In response to determining that the coordinate range corresponding to the center image of the nine-square range in the first image cache generated according to the display coordinate range of the n-1 th round has no overlapping range with the display coordinate range of the n th round, assigning the display coordinate range of the n th round to the coordinate range corresponding to the center image of the nine-square range in the second image cache of the n th round, and the coordinate range corresponding to the second image cache of the n th round is the nine-square range with the display coordinate range of the n th round as the center image of the nine-square range.

[0138] In response to determining that the coordinate range corresponding to the n-th second image cache being generated in the fourth thread is empty, the coordinate range corresponding to the n-th second image cache being generated in the fourth thread is assigned as the coordinate range corresponding to the n-th second image cache, and the fourth thread is started to generate an image according to the coordinate range corresponding to the n-th second image cache being generated in the fourth thread and store the image in the second image cache;

[0139] In response to determining that the coordinate range corresponding to the n-th second image cache being generated in the fourth thread is not empty, it is determined whether the coordinate range corresponding to the center image of the nine-square range in the n-th second image cache is within the coordinate range corresponding to the n-th second image cache being generated in the fourth thread. If yes, the third thread is looped, otherwise, the fourth thread is ended, and the coordinate range corresponding to the n+1-th second image cache being generated in the fourth thread is calculated.

[0140] The execution process of the fourth thread is as follows:

[0141] According to the coordinate range corresponding to the n-th second image cache being generated, the corresponding vector image is obtained from the vector image set and cached in the n-th second image cache, and the coordinate range corresponding to the n-th second image cache being generated is set to empty.

[0142] Specifically, referring to Figure 6 , the third thread is used to generate the image stored in the second image cache, and the execution process is as follows:

[0143] S121: According to the position comparison between the n-1-th display coordinate range oldrect and the n-th display coordinate range showrect, the translation direction of the n-th is determined, and the n-th showrect2 and the corresponding nine-square range rect2 are obtained. As shown in Figure 7 , block 25 is the n-1-th display coordinate range oldrect, and the blue area is the nine-square range generated by the n-1-th display coordinate range oldrect, i.e. the n-1-th rect1. The n-th display coordinate range showrect is obtained after translation. The n-th display coordinate range showrect and the n-1-th rect1 are overlapped, and the n-th showrect2 and the corresponding nine-square range, i.e. the n-th rect2, are obtained according to the main overlapping part. The n-th rect2 and the n-th rect1 are partially overlapped to prevent the edge connection problem in Figure 1 and Figure 2 .

[0144] The acquisition rule of the nth round of showrect2 and the nth round of rect2 is as follows:

[0145] The position of the main overlapping part of the nth round of showrect and the (n-1)th round of rect1 is:

[0146] 1) Block 17, the nth round of showrect2 is set as block 9, and the image2 corresponding coordinate range rect2 is the block of 1, 2, 3, 8, 9, 10, 15, 16, 17, as shown in Figure 8 ;

[0147] 2) Block 18 (the overlapping area is a row, and the block in the middle of the row is selected as the main overlapping part), the nth round of showrect2 is set as block 11, and the image2 corresponding coordinate range rect2 is the block of 3, 4, 5, 10, 11, 12, 31, 32, 33, as shown in Figure 9 ;

[0148] 3) Block 19, the nth round of showrect2 is set as block 13, and the image2 corresponding coordinate range rect2 is the block of 5, 6, 7, 12, 13, 14, 19, 20, 21, as shown in Figure 10 ;

[0149] 4) Block 26, the nth round of showrect2 is set as block 27, and the image2 corresponding coordinate range rect2 is the block of 19, 20, 21, 26, 27, 28, 33, 34, 35, as shown in Figure 11 ;

[0150] 5) Block 33, the nth round of showrect2 is set as block 41, and the image2 corresponding coordinate range rect2 is the block of 33, 34, 35, 40, 41, 42, 47, 48, 49, as shown in Figure 12 ;

[0151] 6) Block 32, the nth round of showrect2 is set as block 39, and the image2 corresponding coordinate range rect2 is the block of 31, 32, 33, 38, 39, 40, 45, 46, 47, as shown in Figure 13 ;

[0152] 7) Block 31, the nth round of showrect2 is set as block 37, and the image2 corresponding coordinate range rect2 is the block of 29, 30, 31, 36, 37, 38, 43, 44, 45, as shown in Figure 14 ;

[0153] 8) If the value of showrect2 is 24, then set the value of showrect2 of the nth round to 23, and the corresponding coordinate range rect2 of the image2 of the nth round is the coordinate range of the blocks with the numbers 15, 16, 17, 22, 23, 24, 29, 30, and 31, as shown in Figure 15

[0154] 9) If there is no overlap, it means that the range to be displayed has exceeded the range of rectl of the (n-1)th round, and there is no edge connection problem. The value of showrect2 of the nth round is assigned to showrect, and the value of rect2 of the nth round is the nine-square grid centered on the image of showrect.

[0155] Step 122: Whether rectref2 of the nth round is empty, to determine whether the fourth thread is generating an image and storing it in image2 of the nth round:

[0156] 1) Yes, it means that the fourth thread is not running, and step 124 is entered;

[0157] 2) No, it means that the fourth thread is running, and whether the coordinate range of showrect2 of the nth round is in the coordinate range of rectref2 of the nth round is determined:

[0158] a. Yes, it means that the coordinate range of the image being generated by the fourth thread has included showrect2 of the nth round, and there is no need to regenerate, and the third thread continues to loop;

[0159] b. No, it means that the range to be displayed has exceeded the coordinate range of the image being generated by the fourth thread, and the fourth thread needs to be stopped, and an image is generated according to the coordinate range of showrect2 of the nth round, and step 123 is entered.

[0160] Step 123: End the fourth thread. Since the current display range has exceeded the image2 being generated, there is no need to continue to generate, and the fourth thread is ended, and the corresponding coordinate range of the second image cache of the (n+1)th round being generated in the fourth thread is used to regenerate the cache image.

[0161] Step 124: Assign rectref2 = rect2.

[0162] Step 125: Start the fourth thread to obtain and generate an image according to the coordinate range of rectref2 of the nth round and store it in image2.

[0163] ​To verify the efficiency of the drawing method of the GIS map during the display position translation proposed in the embodiments of the present application, the embodiments of the present application perform the following experiment. Based on the QGIS platform, the OpenStreetMap national data is used for display test. The EPSG: 4326 coordinate system is used in the experiment, and a label is set for each layer. The test is operated under a scale of 1: 30928. The refresh time of the original system translation and the drawing method of the GIS map during the display position translation proposed in the embodiments of the present application are compared. The drawing method of the GIS map during the display position translation proposed in the embodiments of the present application solves the problems of map edge white edges and connection drawing during translation, and ensures that the speeds of the two are basically consistent in the case of multiple rapid translations. The time consumption of the refresh operation of the two is shown in Table 1, and the time consumption of the two in the case of non-multiple rapid translation is shown in Table 2.

[0164] Table 1

[0165]

[0166] Table 2

[0167]

[0168] Further with reference to Figure 16 , as an implementation of the method shown in the above figures, the present application provides an embodiment of a drawing device of a GIS map during display position translation. The device embodiment corresponds to the method embodiment shown in Figure 3 , and the device can be specifically applied to various electronic devices.

[0169] The embodiments of the present application provide a drawing device of a GIS map during display position translation, which comprises:

[0170] A data acquisition module 1 configured to acquire a set of vector images of a map, and in response to determining that a map translation operation instruction is received, acquire a display coordinate range of the nth round;

[0171] A definition module 2 configured to define a first image cache of the nth round and a second image cache of the nth round, the first image cache of the nth round stores source images of the display area images of the nth round, and the second image cache of the nth round stores candidate display area images determined according to the map translation operation instruction on the basis of the first image cache of the nth round;

[0172] A first display module 3 configured to, in response to determining that the first image cache of the nth round is not empty and the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, select a source image corresponding to the display coordinate range of the nth round from the first image cache of the nth round as a display area image of the nth round and display it according to the settings.

[0173] The second display module 4 is configured to, in response to determining that the first image cache of the n th round is empty, the second image cache of the n th round is not empty, and the display coordinate range of the n th round is within the coordinate range corresponding to the second image cache of the n th round, select a candidate display area image corresponding to the display coordinate range of the n th round from the second image cache of the n th round as the display area image of the n th round and display according to the setting.

[0174] Figure 17 A hardware structure schematic diagram of an electronic device provided by the embodiment of the present application is shown in FIG. 17. Figure 17 As shown in the figure, the electronic device of the embodiment includes a processor 1701 and a memory 1702; the memory 1702 is used to store computer execution instructions; the processor 1701 is used to execute the computer execution instructions stored by the memory to realize each step executed by the electronic device in the above-mentioned embodiment. For details, please refer to the related description in the foregoing method embodiment.

[0175] Optionally, the memory 1702 can be independent or integrated with the processor 1701.

[0176] When the memory 1702 is independently set, the electronic device further includes a bus 1703 for connecting the memory 1702 and the processor 1701.

[0177] The embodiment of the present application further provides a computer storage medium, and the computer storage medium stores computer execution instructions; when the processor 1701 executes the computer execution instructions, the method as above is realized.

[0178] The embodiment of the present application further provides a computer program product, including a computer program; when the computer program is executed by the processor 1701, the method as above is realized.

[0179] In the embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. The division of the modules is only a logical function division. There can be another division manner in actual implementation, for example, a plurality of modules can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection can be indirect coupling or communication connection through some interfaces, devices or modules, and can be electrical, mechanical or in other forms.

[0180] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, i.e., may be located in one place, or may be distributed to multiple network units. Part or all of the modules can be selected to implement the embodiments according to actual needs.

[0181] In addition, each functional module in various embodiments of the application can be integrated in one processing unit, or each module can be physically present alone, or two or more modules can be integrated in one unit. The unit formed by the above modules can be realized in the form of hardware or in the form of hardware plus software functional units.

[0182] The integrated modules realized in the form of software functional modules can be stored in a computer readable storage medium. The software functional modules stored in a storage medium include a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor 1701 to execute part of the steps of the various embodiments of the application.

[0183] It should be understood that the processor 1701 can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), etc. The general-purpose processor can be a microprocessor or the processor 1701 can also be any conventional processor 1701, etc. The steps of the method disclosed in the application can be directly embodied as hardware processor 1701 execution, or executed by a combination of hardware and software modules in the processor 1701.

[0184] The memory 1702 can include a high-speed RAM memory, and can also include a non-volatile storage NVM, for example, at least one disk memory, and can also be a U disk, a mobile hard disk, a read-only memory, a magnetic disk or an optical disk, etc.

[0185] The bus 1703 can be an Industry Standard Architecture (ISA), Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus 1703 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus 1703 in the drawings of the present application does not limit to only one bus 1703 or one type of bus 1703.

[0186] The storage medium described above can be realized by any type of volatile or nonvolatile storage devices or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk. The storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0187] An exemplary storage medium is coupled to the processor 1701, so that the processor 1701 can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be an integral part of the processor 1701. The processor 1701 and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor 1701 and the storage medium can also exist as discrete components in an electronic device or a host device.

[0188] Those of ordinary skill in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction-related hardware. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the foregoing storage medium includes ROM, RAM, magnetic disk or optical disk and various storage media that can store program codes.

[0189] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for drawing a GIS map when displaying a position shift, characterized in that: The following steps are involved: Acquire a vector image set of a map, and in response to determining that a map translation operation instruction has been received, acquire a display coordinate range of the nth round; defining a first image cache of the nth round and a second image cache of the nth round, wherein the first image cache of the nth round stores source images of display area images of the nth round, and the second image cache of the nth round stores candidate display area images determined according to the map translation operation instruction based on the first image cache of the nth round; In response to determining that the first image cache of the nth round is not empty and the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, selecting a source image corresponding to the display coordinate range of the nth round from the first image cache of the nth round as the display area image of the nth round and displaying the source image according to the settings; In response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, a candidate display area image corresponding to the display coordinate range of the nth round is selected from the second image cache of the nth round as the display area image of the nth round and displayed according to the settings.

2. The method for drawing a GIS map when the display position shifts according to claim 1, characterized in that: Also includes: In response to determining that the first image buffer is empty, or the current display coordinate range is not within the coordinate range corresponding to the first image buffer, it is determined whether the second image buffer is empty.

3. The method for drawing a GIS map when the display position shifts according to claim 1, characterized in that: Also includes: In response to determining that the second image cache of the nth round is empty, or the display coordinate range of the nth round is not within the coordinate range corresponding to the second image cache of the nth round, the front display area image of the nth round is generated according to the display coordinate range of the nth round and displayed according to the settings.

4. The method for drawing a GIS map when the display position shifts according to claim 1, characterized in that: Also includes: A first thread and a second thread are provided, wherein the first thread is a resident thread, and the first thread is configured to determine whether to start or stop the second thread based on the display coordinate range of the nth round, the coordinate range corresponding to the first image cache of the nth round, and the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread; The execution process of the first thread is as follows: Determine whether the first image cache of the nth round is empty; In response to determining that the first image cache of the nth round is not empty, determining whether the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round; In response to determining that the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, repeatedly executing the first thread; In response to determining that the first image cache of the nth round is empty, or the display coordinate range of the nth round is not within the coordinate range corresponding to the first image cache of the nth round, determining whether the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread is empty; In response to determining that the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is not empty, determining whether the coordinate range corresponding to the center image of the nine-square grid range in the first image cache of the nth round is within the coordinate range corresponding to the first image cache of the nth round being generated in the second thread; if so, repeatedly executing the first thread; otherwise, terminating the second thread, and calculating the coordinate range corresponding to the first image cache of the (n+1)th round being generated in the second thread; In response to determining that the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is empty, generating a coordinate range corresponding to the first image cache of the nth round based on the display coordinate range of the nth round, if the display coordinate range of the nth round is (x1, y1, x2, y2), then the coordinate range corresponding to the first image cache of the nth round is (2*x1-x2, 2*x2-x1, 2*y1-y2, 2*y2-x1), and starting the second thread; The execution process of the second thread is as follows: According to the coordinate range corresponding to the first image cache of the nth round being generated, the corresponding vector image is obtained in the vector image set and cached in the first image cache of the nth round, and the coordinate range corresponding to the first image cache of the nth round being generated is set to empty.

5. The method for drawing a GIS map when the display position shifts according to claim 4, characterized in that: Also includes: In response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, the second image cache of the nth round is assigned to the first image cache of the nth round, the coordinate range corresponding to the second image cache of the nth round is assigned to the coordinate range corresponding to the first image cache of the nth round, and it is determined whether the second thread is running. If so, the second thread is closed, and the coordinate range corresponding to the first image cache of the nth round being generated in the second thread is set to empty.

6. The method for drawing a GIS map when the display position shifts according to claim 1, characterized in that: Also includes: Providing a third thread and a fourth thread, wherein the third thread is a resident thread; The execution process of the third thread is as follows: In response to determining that a coordinate range corresponding to a central image of a nine-square grid range in a first image cache generated based on a display coordinate range of an n-1th round overlaps with a display coordinate range of an nth round, obtaining a coordinate range corresponding to a central image of a nine-square grid range in a second image cache of an nth round and a coordinate range corresponding to the second image cache of an nth round based on an overlapping range between the coordinate range corresponding to the central image of the nine-square grid range in the first image cache of the n-1th round and the display coordinate range of the nth round; In response to determining that the coordinate range corresponding to the center image of the nine-square grid in the first image cache generated based on the display coordinate range of the (n-1)th round does not overlap with the display coordinate range of the nth round, assigning the display coordinate range of the nth round to the coordinate range corresponding to the center image of the nine-square grid in the second image cache of the nth round, and the coordinate range corresponding to the second image cache of the nth round is the nine-square grid range with the display coordinate range of the nth round as the center image of the nine-square grid range; In response to determining that the coordinate range corresponding to the n-th second image cache being generated in the fourth thread is empty, assigning the coordinate range corresponding to the n-th second image cache being generated in the fourth thread to the coordinate range corresponding to the n-th round of the second image cache, and starting the fourth thread to generate an image according to the coordinate range corresponding to the n-th second image cache being generated in the fourth thread and storing the image in the second image cache; In response to determining that the coordinate range corresponding to the n-th round of the second image cache being generated in the fourth thread is not empty, determining whether the coordinate range corresponding to the center image of the nine-square grid range in the n-th round of the second image cache is within the coordinate range corresponding to the n-th round of the second image cache being generated in the fourth thread; if so, looping the third thread; otherwise, terminating the fourth thread, and calculating the coordinate range corresponding to the (n+1)-th round of the second image cache being generated in the fourth thread; The execution process of the fourth thread is as follows: According to the coordinate range corresponding to the second image cache of the nth round being generated, the corresponding vector image is obtained in the vector image set and cached in the second image cache of the nth round, and the coordinate range corresponding to the second image cache of the nth round being generated is set to empty.

7. The method for drawing a GIS map when the display position shifts according to claim 1, characterized in that: Also includes: The display area image of the nth round is saved in the third image cache of the nth round. In response to determining that a refresh instruction is received, the image is obtained from the third image cache of the nth round and displayed according to the settings.

8. A device for drawing a GIS map when displaying a position shift, characterized in that: include: a data acquisition module configured to acquire a vector image set of a map, and in response to determining that a map translation operation instruction has been received, acquire a display coordinate range of an nth round; a definition module configured to define a first image cache of an nth round and a second image cache of an nth round, wherein the first image cache of the nth round stores source images of display area images of the nth round, and the second image cache of the nth round stores candidate display area images determined according to the map translation operation instruction based on the first image cache of the nth round; a first display module configured to, in response to determining that the first image cache of the nth round is not empty and the display coordinate range of the nth round is within the coordinate range corresponding to the first image cache of the nth round, select a source image corresponding to the display coordinate range of the nth round from the first image cache of the nth round as the display area image of the nth round and display the source image according to settings; The second display module is configured to, in response to determining that the first image cache of the nth round is empty, the second image cache of the nth round is not empty, and the display coordinate range of the nth round is within the coordinate range corresponding to the second image cache of the nth round, select a candidate display area image corresponding to the display coordinate range of the nth round from the second image cache of the nth round as the display area image of the nth round and display it according to the settings.

9. An electronic device comprising: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.