Method and system for optimizing and efficiently rendering longitude and latitude coordinates
Through Douglas-Peucker algorithm and data caching technology, the problem of low rendering efficiency of raw latitude and longitude coordinate data is solved, efficient rendering and precision recovery are achieved, and suitable for GIS applications such as map navigation and location services.
Patent Information
- Application Number
- CN202510353778.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-25
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the original latitude and longitude coordinate data is inefficient when rendering front-end, traditional compression methods ignore geographical features, resulting in the loss of jagged teeth or key points during scaling, and high-precision data rendering leads to a bottleneck in browser performance.
The Douglas-Peucker algorithm is used to compress the original latitude and longitude coordinate data, generate a compressed data point set, and load the corresponding data point set according to the map zoom level. Combined with data cache technology, it ensures that the original data is displayed at a high zoom level.
It significantly improves the front-end rendering efficiency, reduces the number of data points, and restores original accuracy and details when enlarging the map to meet user needs.
Smart Images

Figure CN120339530A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic information systems, and specifically to a method and system for optimizing longitude and latitude coordinates and efficient rendering. Background Art
[0002] In a geographic information system (GIS), longitude and latitude coordinate data is the basic information for describing the location of geographic entities. With the development of technology, especially the popularization of mobile Internet and intelligent terminals, GIS applications have penetrated into all aspects of daily life, such as map navigation, location-based services, geographic analysis, etc. However, the original longitude and latitude coordinate data often contains a large number of points, which will cause a large computational burden during front-end rendering, taking a long time and affecting the user experience. In the prior art, the following problems exist in map front-end rendering: (1) The original longitude and latitude coordinate data (such as GPS tracks, administrative division boundaries) leads to low transmission and rendering efficiency. (2) Traditional compression methods (such as uniform sampling) ignore geographical features, and are prone to jaggies or key point loss during zooming. (3) Direct rendering of high-precision data causes browser performance bottlenecks. Summary of the Invention
[0003] The technical task of the present invention is to address the above deficiencies and provide a method and system for optimizing longitude and latitude coordinates and efficient rendering, which can improve the rendering efficiency of data in the front end, and at the same time ensure that when the map is zoomed to a certain extent, the original longitude and latitude coordinate data can be displayed to meet the user's demand for map details.
[0004] The technical solution adopted by the present invention to solve its technical problems is as follows:
[0005] A method for optimizing longitude and latitude coordinates and efficient rendering, which realizes the optimization of longitude and latitude coordinates and performs efficient rendering based on the Douglas-Peucker algorithm. The implementation of this method includes the following steps:
[0006] 1) Data collection: Collect the original longitude and latitude data of the map area to generate an original data point set;
[0007] 2) Apply the Douglas-Peucker algorithm to optimize the original longitude and latitude coordinate data: Use the Douglas-Peucker algorithm to compress the original data point set to generate a compressed data point set; wherein, the threshold of the Douglas-Peucker algorithm is preset according to the actual application scenario;
[0008] 3) Data rendering: During front-end rendering, load and render the corresponding data point set according to the current map zoom level; when the map zoom level is low, render the compressed data point set; when the map zoom level is high, render the original data point set.
[0009] The Douglas-Peucker algorithm is a classic curve simplification algorithm that iteratively deletes points with less impact on the curve shape, thus preserving the main features of the curve. This algorithm was first successfully used in cartographic generalization, which can effectively reduce the number of data points while maintaining the overall shape of the curve. Therefore, applying the Douglas-Peucker algorithm to the compression of latitude and longitude coordinate data can significantly reduce the data volume and increase the map rendering speed. However, the Douglas-Peucker algorithm will result in a large loss of map accuracy. For this reason, this method also designs an efficient rendering technique. By monitoring the zoom ratio of the map, when it exceeds a certain threshold, the detailed latitude and longitude coordinate information under the current view is loaded. This method compresses the original latitude and longitude coordinate data to reduce the number of data points, thereby improving the front-end rendering efficiency. At the same time, when the map is zoomed to a certain extent, the original latitude and longitude coordinate data can be displayed to meet the user's need for map details.
[0010] Furthermore, apply the Douglas-Peucker algorithm to optimize the original latitude and longitude coordinate data. The algorithm optimization steps are as follows:
[0011] First, set the optimization threshold ε, and then select the starting point P1 and the ending point P n of the polyline as the reference line; calculate the distance from each intermediate point (P2, P3, P n-1 ) to the reference line.
[0012] Find the point P max with the maximum distance, and the distance is d max . If d max ≤ε, then delete all intermediate points and only retain P1 and P n .
[0013] If d max >ε, then retain P max , and use P1 P max, and P max P n as the new reference line, and recursively process the two sub-segments;
[0014] When the deviation of all sub-segments is less than or equal to ε, the recursion ends.
[0015] The threshold ε of the Douglas - Peucker algorithm can be adjusted according to actual requirements. The larger the threshold, the fewer the data points after compression, and the higher the rendering efficiency, but some map details may be lost; the smaller the threshold, the more data points after compression, the more map details are retained, but the rendering efficiency will decrease. Therefore, it is necessary to reasonably set the threshold to achieve the optimal rendering effect on the premise of ensuring map accuracy. In addition, the compressed longitude and latitude coordinate data needs to be stored in a new field of the database, and when needed on the front - end, an interface is called to send it to the page for rendering. Since the number of data points decreases, the rendering efficiency is significantly improved. At the same time, in order to support the zoom function of the map, it is necessary to record the corresponding relationship between the data before and after compression so that the original longitude and latitude coordinate data can be restored and displayed when the map is zoomed to a certain extent.
[0016] Furthermore, the threshold of the Douglas - Peucker algorithm is set to 0.001 degrees.
[0017] Furthermore, the method also includes a data caching step: storing the original data point set and the compressed data point set in a data caching module for quick loading during subsequent access. Caching the compressed longitude and latitude coordinate data and the rendering result locally or on the server - side so that they can be quickly obtained and rendered when needed next time, further improving the rendering efficiency.
[0018] Furthermore, step 1) is specifically implemented as follows:
[0019] Obtain the longitude and latitude coordinate data of the original patches. The data sources include GPS devices, API interfaces of map service providers, or other geographical data; store the longitude and latitude information of each patch in the database, and each patch has a unique primary key code.
[0020] Furthermore, during front - end rendering, select to display the compressed data or the original data according to the current map zoom level; a threshold of the zoom level can be set. When the map zoom level is lower than this threshold, display the compressed data to improve the rendering efficiency; when the map zoom level is higher than this threshold, read the patch codes of all centers within this field of view, and reload these patches within the field of view.
[0021] Furthermore, during front - end rendering, use JavaScript and the map API to implement the map rendering function.
[0022] The present invention also claims to protect a longitude and latitude coordinate optimization and efficient rendering system, including:
[0023] A data acquisition module for collecting the original longitude and latitude data of the map area and generating an original data point set;
[0024] A data compression module that uses the Douglas - Peucker algorithm to compress the original data point set to generate a compressed data point set; wherein, the threshold of the Douglas - Peucker algorithm is preset according to the actual application scenario;
[0025] A front - end rendering module for loading and rendering the corresponding data point set according to the current map zoom level; when the map zoom level is low, render the compressed data point set; when the map zoom level is high, render the original data point set;
[0026] A data caching module for storing the original data point set and the compressed data point set;
[0027] This system can implement the above - mentioned method.
[0028] The present invention also claims protection for a device for optimizing longitude and latitude coordinates and efficient rendering, including: at least one memory and at least one processor;
[0029] The at least one memory is used for storing machine - readable programs;
[0030] The at least one processor is used for calling the machine - readable program to implement the above - mentioned method.
[0031] The present invention also claims protection for a computer - readable medium, on which computer instructions are stored, and when the computer instructions are executed by a processor, the above - mentioned method can be implemented.
[0032] Compared with the prior art, the method and system for optimizing longitude and latitude coordinates and efficient rendering of the present invention have the following beneficial effects:
[0033] By applying the Douglas - Peucker algorithm to compress the longitude and latitude coordinate data, the present invention significantly reduces the number of data points and improves the front - end rendering efficiency. When the map is enlarged to a certain extent, the original longitude and latitude coordinate data can be restored for display, ensuring the accuracy and details of the map. By setting reasonable thresholds and caching technologies, the goal of improving the rendering efficiency while ensuring the map accuracy is achieved. The present invention is applicable to various GIS application scenarios, such as map navigation, location - based services, geographical analysis, etc., and has a wide range of application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 is a schematic diagram of the architecture of the method for optimizing longitude and latitude coordinates and efficient rendering provided by an embodiment of the present invention;
[0035] Figure 2 is an example diagram of the original patch shape provided by an embodiment of the present invention;
[0036] Figure 3 It is an example diagram of the optimized patch shape provided by an embodiment of the present invention with ε = 0.001;
[0037] Figure 4 It is an example diagram of the optimized patch shape provided by an embodiment of the present invention with ε = 0.0005;
[0038] Figure 5 It is a diagram showing the comparison of data before and after optimization provided by an embodiment of the present invention. Detailed implementation manners
[0039] The present invention will be further described below in conjunction with specific embodiments.
[0040] An embodiment of the present invention provides a method for optimizing longitude and latitude coordinates and efficient rendering. Based on the Douglas-Peucker algorithm, the longitude and latitude coordinates are optimized and efficiently rendered. The implementation of this method includes the following steps:
[0041] 1. Collect the original longitude and latitude data of the map area to generate an original data point set;
[0042] 2. Use the Douglas-Peucker algorithm to compress the original data point set to generate a compressed data point set; wherein, the threshold of the Douglas-Peucker algorithm is preset according to the actual application scenario;
[0043] 3. When rendering on the front end, load and render the corresponding data point set according to the current map zoom level; when the map zoom level is low, render the compressed data point set; when the map zoom level is high, render the original data point set.
[0044] 4. Store the original data point set and the compressed data point set in the data cache module for quick loading during subsequent access. Cache the compressed longitude and latitude coordinate data and the rendering result locally or on the server side, so that they can be quickly obtained and rendered when needed next time, further improving the rendering efficiency.
[0045] The specific implementation is as follows:
[0046] Step 1. Data collection.
[0047] Obtain the longitude and latitude coordinate data of the original patches. These data can be sourced from GPS devices, API interfaces of map service providers, or other geographical data collection methods. Store the longitude and latitude information of each patch in the database, and each patch has a unique primary key code.
[0048] Step 2. Data optimization. Apply the Douglas-Peucker algorithm to optimize the original longitude and latitude coordinate data. The specific optimization steps of the algorithm are as follows:
[0049] (1) First, set the optimization threshold ε, and then select the starting point P1 and the ending point P of the polyline n as the reference line; calculate the distance from each intermediate point (P2, P3, P n-1 ) to the reference line.
[0050] (2) Find the point P with the maximum distance max , and the distance is d max . If d max ≤ε, then delete all intermediate points and only retain P1 and P n ;
[0051] If d max >ε, then retain P max , and use P1P max, and P max P n as the new reference line, and recursively process the two sub - segments.
[0052] (3) If the deviation of all sub - segments is less than or equal to ε, the recursion ends.
[0053] The threshold ε of the Douglas - Peucker algorithm can be adjusted according to actual needs. The larger the threshold, the fewer the compressed data points and the higher the rendering efficiency, but some map details may be lost; the smaller the threshold, the more the compressed data points and the more map details are retained, but the rendering efficiency will decrease. Therefore, it is necessary to reasonably set the threshold to achieve the optimal rendering effect on the premise of ensuring map accuracy. In addition, the compressed longitude and latitude coordinate data needs to be stored in a new field of the database. When needed on the front - end, call the interface to send it to the page for rendering. Since the number of data points decreases, the rendering efficiency is significantly improved. At the same time, to support the map zoom function, it is necessary to record the corresponding relationship between the data before and after compression so that the original longitude and latitude coordinate data can be restored and displayed when the map is zoomed to a certain extent.
[0054] In this embodiment, the threshold of the Douglas - Peucker algorithm is set to 0.001 degrees.
[0055] Step Three: Data rendering.
[0056] When rendering on the front - end, select whether to display the compressed data or the original data according to the current map zoom level. Specifically, a threshold for the zoom level can be set. When the map zoom level is lower than this threshold, display the compressed data to improve the rendering efficiency; when the map zoom level is higher than this threshold, read all the patch codes of the centers within this field of view and reload these patches within the field of view.
[0057] When rendering on the front end, use JavaScript and map APIs to implement the map rendering function.
[0058] Step Four: Data caching.
[0059] To further improve the rendering efficiency, this method adopts caching technology. Specifically, the compressed latitude and longitude coordinate data and the rendering results can be cached locally or on the server side so that they can be quickly retrieved and rendered when needed next time. At the same time, to support the update and rendering of real-time data, a reasonable cache update strategy can be designed according to needs.
[0060] The Douglas-Peucker algorithm is a classic curve simplification algorithm that iteratively deletes points that have less influence on the curve shape, thus retaining the main features of the curve. This algorithm was first successfully used in cartographic generalization, which can effectively reduce the number of data points while maintaining the overall shape of the curve. Therefore, applying the Douglas-Peucker algorithm to the compression of latitude and longitude coordinate data can greatly reduce the data volume and increase the map rendering speed. However, the Douglas-Peucker algorithm will cause a large loss of map accuracy. For this reason, this method also designs an efficient rendering technology. By monitoring the zoom ratio of the map, when it exceeds a certain threshold, the detailed latitude and longitude coordinate information under the current view is loaded. This method compresses the original latitude and longitude coordinate data to reduce the number of data points to improve the front-end rendering efficiency; at the same time, when the map is zoomed to a certain extent, the original latitude and longitude coordinate data can be displayed to meet the user's need for map details.
[0061] This method is mainly applied to the compression and rendering optimization of map data. Taking the latitude and longitude information of the map patches of the wheat planting plots of Maotai Group as an example, the implementation steps of this method are described in detail below.
[0062] Step One: Original data collection. The original latitude and longitude data of the map patches of the wheat planting plots of Maotai Group in this example are collected by high-precision GPS devices, and the data format is a set of latitude and longitude coordinate points. The original data contains 1,945,391 points, the memory occupancy reaches 10.2MB, and the loading time is as long as 8.4 seconds, which causes a great burden on the front-end rendering. Store all the map patch information in the database and set a location identifier Id for each map patch.
[0063] Step Two: Compression by the Douglas-Peucker algorithm.
[0064] To optimize the data, the Douglas - Peucker algorithm is used to compress the original latitude and longitude coordinates. The Douglas - Peucker algorithm is a classic curve simplification algorithm that screens the points on the curve through recursion, retains the feature points, and thus significantly reduces the number of data points while ensuring the shape characteristics of the curve.
[0065] In this embodiment, the threshold of the Douglas - Peucker algorithm is preset to 0.001 (considering the particularity of the latitude and longitude data, the selection of this threshold needs to be adjusted according to the actual application scenario). The specific implementation steps of the algorithm are as follows:
[0066] 1. Connect a straight line between the two end points of the curve, and this straight line serves as the initial reference line.
[0067] 2. Calculate the perpendicular distance from each point on the curve to this straight line, find the point with the maximum distance, and denote it as d max 。
[0068] 3. Compare d max with the preset threshold. If d max is less than the threshold, it is considered that the curve is already simple enough, the algorithm ends, and the current simplified curve is returned; if d max is greater than or equal to the threshold, the point with the maximum distance is added to the simplified curve, and the curve is divided into two parts with this point as the boundary. The above steps are recursively executed for these two parts of the curve until all parts of d max are less than the threshold. The latitude and longitude data of the map patches of the wheat planting plots of the Moutai Group is reduced from the original 1,945,391 points to 14,629 points.
[0069] Step Three: Store the compressed data.
[0070] According to the unique identifier Id of the map patch, the compressed data is stored in the corresponding database. And the calling interface code is written.
[0071] Step Four: Front - end rendering.
[0072] During front - end rendering, first load the compressed latitude and longitude data for preliminary rendering. When the map is zoomed in to a certain preset level (such as level 16), trigger the data loading logic to load and render the original latitude and longitude data before compression to ensure the detail performance of the map at a high zoom level.
[0073] To implement this function, the front - end code needs to be designed as follows:
[0074] 1. When the map is initialized, load the compressed latitude and longitude data and perform rendering.
[0075] 2. Listen for map zoom level change events. When the zoom level reaches the preset level, trigger the data loading logic.
[0076] 3. In the data loading logic, first obtain the patch IDs of the center points of all patches within the current view, and then determine whether the original data has been loaded for the current ID. If not, initiate an asynchronous request to obtain the original data from the server and update the map rendering.
[0077] 4. To avoid frequent data loading, a certain caching mechanism can be set, such as storing the original data in localStorage for quick loading during subsequent access.
[0078] An embodiment of the present invention also provides a longitude and latitude coordinate optimization and efficient rendering system, which can implement the longitude and latitude coordinate optimization and efficient rendering method described in the above embodiment.
[0079] The system includes:
[0080] 1. A data acquisition module for acquiring the original longitude and latitude data of the map area and generating an original data point set. Specifically, it includes:
[0081] Obtain the longitude and latitude coordinate data of the original patches. These data can be sourced from GPS devices, API interfaces of map service providers, or other geographical data acquisition methods. Store the longitude and latitude information of each patch in the database, and each patch has a unique primary key code.
[0082] 2. A data compression module that uses the Douglas - Peucker algorithm to compress the original data point set to generate a compressed data point set; wherein, the threshold of the Douglas - Peucker algorithm is preset according to the actual application scenario.
[0083] The specific optimization steps of using the Douglas - Peucker algorithm to compress the original data point set are as follows:
[0084] (1) First, set the optimization threshold ε, and then select the starting point P1 and the ending point P n of the polyline as the reference line; calculate the distance from each intermediate point (P2, P3... P n-1 ) to the reference line.
[0085] (2) Find the point P max with the maximum distance, and the distance is d max . If d max <= ε, then delete all intermediate points and only retain P1 and P n ;
[0086] If d max > ε, then retain Pmax and use P1 P max, and P max P n as the new baseline, and recursively process the two sub - segments.
[0087] (3) If the deviation of all sub - segments is less than or equal to ε, the recursion ends.
[0088] The threshold ε of the Douglas - Peucker algorithm can be adjusted according to actual needs. The larger the threshold, the fewer the compressed data points, and the higher the rendering efficiency, but some map details may be lost; the smaller the threshold, the more the compressed data points, the more map details are retained, but the rendering efficiency will decrease. Therefore, it is necessary to reasonably set the threshold to achieve the optimal rendering effect on the premise of ensuring map accuracy. In this embodiment, the threshold of the Douglas - Peucker algorithm is set to 0.001 degrees.
[0089] In addition, the compressed longitude and latitude coordinate data needs to be stored in a new field of the database. When needed on the front - end, an interface is called to send it to the page for rendering. Since the number of data points decreases, the rendering efficiency is significantly improved. At the same time, in order to support the map zoom function, the corresponding relationship between the compressed and uncompressed data needs to be recorded so that the original longitude and latitude coordinate data can be restored and displayed when the map is zoomed to a certain extent.
[0090] 3. The front - end rendering module is used to load and render the corresponding data point set according to the current map zoom level; when the map zoom level is low, render the compressed data point set; when the map zoom level is high, render the original data point set.
[0091] Select whether to display the compressed data or the original data according to the current map zoom level. Specifically, a threshold of the zoom level can be set. When the map zoom level is lower than this threshold, the compressed data is displayed to improve the rendering efficiency; when the map zoom level is higher than this threshold, all the patch codes within the field of view of the center are read, and these patches within the field of view are re - loaded.
[0092] When rendering on the front - end, use JavaScript and the map API to implement the map rendering function.
[0093] 4. The data cache module is used to store the original data point set and the compressed data point set.
[0094] The compressed longitude and latitude coordinate data and the rendering results can be cached locally or on the server - side so that they can be quickly obtained and rendered when needed next time, further improving the rendering efficiency.
[0095] The process of this system to achieve the optimization of longitude and latitude coordinates and efficient rendering is as follows:
[0096] Step 1: The data acquisition module acquires the original longitude and latitude data of the map area to generate an original data point set.
[0097] Step 2: The data compression module uses the Douglas - Peucker algorithm to compress the original data point set to generate a compressed data point set; wherein, the threshold of the Douglas - Peucker algorithm is preset according to the actual application scenario.
[0098] Step 3: When the front - end rendering module performs front - end rendering, it loads and renders the corresponding data point set according to the current map zoom level; when the map zoom level is low, it renders the compressed data point set; when the map zoom level is high, it renders the original data point set.
[0099] Step 4: The data cache module stores the original data point set and the compressed data point set into the data cache module for quick loading during subsequent access. Cache the compressed longitude and latitude coordinate data and the rendering result locally or on the server side, so that they can be quickly obtained and rendered when needed next time, further improving the rendering efficiency.
[0100] An embodiment of the present invention also provides a longitude and latitude coordinate optimization and efficient rendering device, including: at least one memory and at least one processor;
[0101] The at least one memory is used to store machine - readable programs;
[0102] The at least one processor is used to call the machine - readable program to implement the longitude and latitude coordinate optimization and efficient rendering method described in the above embodiment.
[0103] An embodiment of the present invention also provides a computer - readable medium, on which computer instructions are stored. When the computer instructions are executed by a processor, the processor executes the longitude and latitude coordinate optimization and efficient rendering method described in the above embodiment. Specifically, a system or device equipped with a storage medium can be provided. On this storage medium, software program codes for implementing the functions of any one of the above embodiments are stored, and the computer (or CPU or MPU) of the system or device reads and executes the program codes stored in the storage medium.
[0104] In this case, the program code read from the storage medium itself can implement the functions of any one of the above embodiments. Therefore, the program code and the storage medium storing the program code constitute a part of the present invention.
[0105] Examples of storage media for providing program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Optionally, the program code can be downloaded from a server computer via a communication network.
[0106] In addition, it should be clear that not only can the actual operations be completed in part or in whole by executing the program code read by the computer, but also by instructing the operating system or the like operating on the computer based on the program code, thereby realizing the functions of any one of the above embodiments.
[0107] In addition, it can be understood that the program code read from the storage medium is written into the memory provided in the expansion board inserted into the computer or into the memory provided in the expansion unit connected to the computer, and then the CPU or the like installed on the expansion board or the expansion unit is instructed based on the program code to execute part or all of the actual operations, thereby realizing the functions of any one of the above embodiments.
[0108] The present invention has been described in detail above with reference to the drawings and preferred embodiments. However, the present invention is not limited to these disclosed embodiments. Based on the above-mentioned multiple embodiments, those skilled in the art can know that more embodiments of the present invention can be obtained by combining the code review means in the above different embodiments, and these embodiments are also within the protection scope of the present invention.
Claims
1. A method for optimizing longitude and latitude coordinates and efficient rendering, characterized in that Implementing longitude and latitude coordinate optimization based on the Douglas-Peucker algorithm and performing efficient rendering. The implementation of this method includes the following steps: 1) Collect the original longitude and latitude data of the map area to generate an original data point set; 2) Use the Douglas-Peucker algorithm to compress the original data point set to generate a compressed data point set; among them, the threshold of the Douglas-Peucker algorithm is preset according to the actual application scenario; 3) During front-end rendering, load and render the corresponding data point set according to the current map zoom level; when the map zoom level is low, render the compressed data point set; when the map zoom level is high, render the original data point set.
2. The method for optimizing longitude and latitude coordinates and efficient rendering according to claim 1, wherein Apply the Douglas-Peucker algorithm to optimize the original longitude and latitude coordinate data. The algorithm optimization steps are as follows: First, set the optimization threshold ε, and then select the starting point P1 and the ending point P of the broken line n as the reference line; for all intermediate points (P2, P3P n-1 ), calculate the distance from each point to the reference line; Find the point P with the maximum distance max , with the distance being d max , if d max <= ε, then delete all intermediate points and only retain P1 and P n ; If d max > ε, then retain P max , and use P1 P max, and P max P n as new baselines, and recursively process the two sub-segments; If the deviation of all sub-segments is less than or equal to ε, the recursion ends.
3. A method for optimizing longitude and latitude coordinates and efficient rendering according to claim 1 or 2, characterized in that, The threshold of the Douglas-Peucker algorithm is set to 0.001 degrees.
4. A method for optimizing longitude and latitude coordinates and efficient rendering according to claim 1, characterized in that It also includes a data caching step: storing the original data point set and the compressed data point set into a data caching module for quick loading during subsequent access.
5. A method for optimizing longitude and latitude coordinates and efficient rendering according to claim 1, characterized in that The specific implementation of step 1) is as follows: Obtain the longitude and latitude coordinate data of the original patches. The data sources include GPS devices, API interfaces of map service providers, or other geographical data; store the longitude and latitude information of each patch into the database, and each patch has a unique primary key code.
6. A method for optimizing longitude and latitude coordinates and efficient rendering according to claim 1 or 5, characterized in that, During front-end rendering, select to display the compressed data or the original data according to the current map zoom level; a threshold of the zoom level can be set. When the map zoom level is lower than this threshold, display the compressed data to improve rendering efficiency; when the map zoom level is higher than this threshold, read the patch codes of all centers within this field of view and reload these patches within the field of view.
7. A method for optimizing longitude and latitude coordinates and efficient rendering according to claim 1, characterized in that During front-end rendering, use JavaScript and the map API to implement the map rendering function.
8. A longitude and latitude coordinate optimization and efficient rendering system, characterized in that, Including: A data acquisition module for collecting the original longitude and latitude data of the map area to generate an original data point set; A data compression module that uses the Douglas-Peucker algorithm to compress the original data point set to generate a compressed data point set; among them, the threshold of the Douglas-Peucker algorithm is preset according to the actual application scenario; A front-end rendering module for loading and rendering the corresponding data point set according to the current map zoom level; when the map zoom level is relatively low, render the compressed data point set; when the map zoom level is relatively high, render the original data point set; A data caching module for storing the original data point set and the compressed data point set; This system can implement the method described in any one of claims 1 to 7.
9. A device for optimizing longitude and latitude coordinates and efficient rendering, characterized in that, Including: At least one memory and at least one processor; The at least one memory is used to store machine-readable programs; The at least one processor is used to call the machine-readable program to implement the method described in any one of claims 1 to 7.
10. A computer-readable medium, characterized in that, Computer instructions are stored on the computer-readable medium, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 7 can be implemented.
Citation Information
Cited By
Method, device, equipment and medium for simulating multi-layer dynamic interaction and vector element control of 3D map
CN121411853A