Method and device for loading spatial data for webgis terminal and client

By introducing a data resource proxy tool and a cache database into the WebGIS client, the problem of low tile data loading efficiency in the WebGIS system was solved, achieving efficient spatial data loading and rendering, and enhancing data availability in offline environments.

CN120179940BActive Publication Date: 2025-11-18ZHONGKE XINGTU YIMA (WUXI) TECHNOLOGY CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510253654.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-05
Publication Date
2025-11-18
Estimated Expiration
2045-03-05

AI Technical Summary

Technical Problem

When loading large-scale 3D scene data, existing WebGIS systems suffer from tile data requests that severely impact network data requests, resulting in low data loading efficiency, especially under poor network conditions, and even causing the client to freeze.

Method used

By introducing a data resource proxy tool into the client browser, using a cached database (such as IndexedDB) to store spatial data, and processing it according to map data matching rules, the number of network requests is reduced and data loading efficiency is improved.

Benefits of technology

By enabling efficient retrieval through the API of the cached database, the loading and rendering efficiency of map data is greatly improved, network latency is reduced, and data availability in offline environments is enhanced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120179940B_ABST
    Figure CN120179940B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of visual data loading, and particularly discloses a loading method and device for spatial data of a WebGIS terminal and a client, which comprises the following steps: generating a map data request instruction according to the scene loading demand of spatial data of the WebGIS terminal; calling a data resource agent tool and sending the map data request instruction to the data resource agent tool; the data resource agent tool is used for taking over the data request between the client and a server, processing the map data request instruction according to a map data matching rule to obtain a map data request result, and the map data matching rule at least comprises data geographical range matching and data precision matching; receiving the map data request result and returning the map data request result to the WebGIS terminal to realize scene loading of spatial data. The loading method for spatial data of the WebGIS terminal greatly improves the loading and rendering efficiency of map data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of visualization data loading technology, and in particular to a method for loading spatial data in WebGIS, a device for loading spatial data in WebGIS, and a client. Background Technology

[0002] With the rapid development and widespread application of GIS (Geographic Information System) technology, the types of data used in WebGIS visualization are constantly becoming richer. Spatial data has transitioned from traditional 4D data to new types of surveying and mapping data such as oblique 3D models and 3D point clouds. Multiple data types exist within the same area, such as image data, terrain data, vector data, oblique 3D models, and point cloud data. The accelerated development of current 3D reality technology has led to an ever-increasing volume of 3D scene data loaded onto the web.

[0003] Currently, WebGIS systems require tiling spatial data. A large-scale 3D scene needs to be layered, divided into blocks, and LOD (Level of Detail) constructed. Therefore, when a 3D client map engine loads a 3D scene, it requests map tile data. Loading a single 3D map scene often involves tens of thousands, or even more, tiles. Such a large number of network requests severely restricts the efficiency of spatial data loading. In poor network conditions, it can even cause the client map interface to continuously wait for data requests, resulting in a system freeze.

[0004] Therefore, how to optimize the loading efficiency of tile data in visualization scenarios to achieve efficient scheduling and rendering of massive spatial data in WebGIS is a technical problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] This invention provides a method, device, and client for loading spatial data in WebGIS, which solves the problem of the inability to optimize the loading efficiency of tile data in visualization scenarios in related technologies.

[0006] As a first aspect of the present invention, a method for loading spatial data in a WebGIS client is provided, comprising:

[0007] Generate map data request instructions based on the scene loading requirements of spatial data from the WebGIS client;

[0008] The data resource proxy tool is invoked, and the map data request instruction is sent to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server, and process the map data request instruction according to the map data matching rules to obtain the map data request result. The map data matching rules include at least data geographic range matching and data accuracy matching.

[0009] The system receives the map data request result and returns it to the WebGIS client to load the spatial data scene.

[0010] Further, the map data request instruction is processed according to map data matching rules to obtain a map data request result, including:

[0011] Obtain agent configuration information;

[0012] When a map data request instruction is received, determine whether the resource proxy channel is open;

[0013] If the resource proxy channel is not open, the map data request instruction is sent to the server to obtain the map data request result;

[0014] If the resource proxy channel is enabled, the map data request result is obtained according to the map data matching rules.

[0015] Further, obtaining the map data request result according to map data matching rules includes:

[0016] Determine whether the map data needs to be cached based on the map matching rules for the current map data request command;

[0017] If map data needs to be cached, the current cached data on the client is requested according to the map data request instruction to obtain the map data request result;

[0018] If caching of map data is not required, a map data request instruction is sent to the server to obtain the map data request result.

[0019] Further, according to the map data request instruction, the client's current cached data is requested to obtain the map data request result, including:

[0020] Calculate map key values ​​based on the map data resource parameters in the map data request instruction;

[0021] The client's cache database is queried based on the map key value to determine whether map data corresponding to the map key value exists in the cache database;

[0022] If the cache database contains map data corresponding to the map key value, then read the map data corresponding to the map key value from the cache database;

[0023] If the cache database does not contain map data corresponding to the map key value, a map data request instruction is sent to the server to update the cache database.

[0024] Furthermore, it also includes actions performed after the step of reading the map data from the cached database:

[0025] Determine whether the map data corresponding to the map key value in the cache database has expired;

[0026] If it has not expired, the map data corresponding to the map key value will be determined as the map data request result;

[0027] If it expires, a map data request instruction is sent to the server to update the cache database.

[0028] Furthermore, based on map matching rules, it is determined whether the current map data request instruction needs to cache map data, including:

[0029] Based on the current map data request instruction, determine the current map data request instruction and generate map data resource request information;

[0030] Determine whether the map data resource domain name exists in the domain name list based on the map data resource request information;

[0031] If the map data resource domain name exists in the domain name list, then determine whether the map data resource type is in the data type list;

[0032] If the map data resource type is in the data type list, then the geographic range of the map data is calculated based on the map data resource request information, and it is determined whether the geographic range of the map data intersects with the cache range.

[0033] If the geographic range of the map data intersects with the cache range, then determine whether the current tile level in the map data resource request is in the cache level;

[0034] If the current tile level is in the cache level, then it is determined that the map data needs to be cached.

[0035] Furthermore, the method for loading spatial data for the WebGIS client also includes performing the following steps before invoking the data resource proxy tool:

[0036] Determine the coordinates of the center point of the current viewpoint based on the scene loading requirements of the spatial data in the WebGIS client;

[0037] The target tile data is queried based on the preset cached geographical range parameters, and the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewpoint is calculated.

[0038] The priority sorting of tile data is determined based on the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewpoint;

[0039] The set of map tile data that needs to be cached under the current viewpoint is determined based on the priority sorting of the tile data;

[0040] A map data preload request instruction is generated based on the map tile data set, wherein the data resource agent tool is able to preload the map tile data set to the client based on the map data preload request instruction.

[0041] Furthermore, the method for loading spatial data for the WebGIS client also includes performing the following steps before invoking the data resource proxy tool:

[0042] The map data is retrieved based on the map range in the preset caching rules to determine the target tile data;

[0043] The target tile data is processed according to map matching rules to determine offline map data;

[0044] An offline map data request instruction is generated based on the offline map data, wherein the data resource proxy tool can preload the offline map data to the client according to the offline map data request instruction.

[0045] As another aspect of the present invention, a spatial data loading device for a WebGIS client is provided, for implementing the spatial data loading method for a WebGIS client described above, wherein the device includes:

[0046] The request instruction generation module is used to generate map data request instructions based on the scene loading requirements of spatial data on the WebGIS client.

[0047] The resource proxy invocation module is used to invoke the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server and process the map data request instruction according to the map data matching rules to obtain the map data request result. The map data matching rules include at least data geographic range matching and data accuracy matching.

[0048] The data return module is used to receive the map data request result and return the map data request result to the WebGIS terminal to realize the scene loading of spatial data.

[0049] As another embodiment of the present invention, a client is provided, comprising: a WebGIS client and the aforementioned spatial data loading device for the WebGIS client, wherein the spatial data loading device for the WebGIS client is communicatively connected to the WebGIS client, the spatial data loading device for the WebGIS client can generate map data request instructions according to the scene loading requirements of the spatial data of the WebGIS client, can call a data resource proxy tool to process the map data request instructions to obtain map data request results, and return the map data request results to the WebGIS client to realize scene loading of spatial data.

[0050] This invention provides a method for loading spatial data in a WebGIS client. Based on the scene loading requirements of spatial data in the WebGIS client, a map data request command is generated. A data resource proxy tool is invoked to process the map data request command, obtaining a map data request result. This result is then returned to the WebGIS client to achieve scene loading of the spatial data. This method for loading spatial data in a WebGIS client stores the loaded spatial data in the client browser's cache database using a data resource proxy tool. During data scheduling, data is read from the cache database, reducing the number of network requests. The cache database's API enables efficient retrieval of spatial data, thereby significantly improving the loading and rendering efficiency of map data. Attached Figure Description

[0051] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the following detailed description to explain the invention, but do not constitute a limitation thereof.

[0052] Figure 1 A flowchart of a method for loading spatial data for a WebGIS client provided by the present invention.

[0053] Figure 2 This is a flowchart of the process for processing map data request commands provided by the present invention.

[0054] Figure 3 This invention provides a flowchart for obtaining map data request results based on map data matching rules.

[0055] Figure 4 A flowchart illustrating the specific implementation of the data proxy mechanism provided by this invention.

[0056] Figure 5 The flowchart illustrates the implementation of the data rule matching process provided by this invention.

[0057] Figure 6 This invention provides a flowchart of the dynamic caching implementation performed before the step of invoking the data resource proxy tool.

[0058] Figure 7 A flowchart illustrating the dynamic caching process for map perspectives provided by this invention.

[0059] Figure 8 The flowchart for the offline application provided by this invention.

[0060] Figure 9 This is a structural block diagram of the spatial data loading device for WebGIS provided by the present invention.

[0061] Figure 10 The structural block diagram of the client provided by the present invention. Detailed Implementation

[0062] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0063] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0064] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0065] This embodiment provides a method for loading spatial data in a WebGIS client. Figure 1 This is a flowchart of a method for loading spatial data in a WebGIS client according to an embodiment of the present invention, such as... Figure 1 As shown, it includes:

[0066] S100. Generate map data request instructions based on the scene loading requirements of spatial data from the WebGIS client;

[0067] In this embodiment of the invention, a map data request instruction is generated specifically based on the scene loading requirements of spatial data on the WebGIS client. That is, scene loading of spatial data on the WebGIS client requires requesting some map data, and this map data request can be generated by generating a map data request instruction. The returned map data is then obtained based on this map data request instruction. This map data request instruction can specify information such as the scene type of the spatial data and the center point of the map viewpoint.

[0068] S200. Invoke the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server, and process the map data request instruction according to the map data matching rules to obtain the map data request result. The map data matching rules include at least data geographic range matching and data accuracy matching.

[0069] In this embodiment of the invention, the data resource proxy tool can be understood as a data proxy mechanism designed between the client data request and the server. The data resource proxy takes over all data requests, processes them uniformly according to the configured data proxy rules and update strategy mechanism, and finally returns the data to the map engine for rendering.

[0070] S300: Receive the map data request result and return the map data request result to the WebGIS terminal to realize the scene loading of spatial data.

[0071] In this embodiment of the invention, the map data request result returned by the data resource proxy tool is received, and the map data request result is returned to the WebGIS terminal to realize the scene loading of spatial data.

[0072] Therefore, the spatial data loading method for WebGIS provided by this invention generates a map data request command based on the scene loading requirements of spatial data on the WebGIS client, calls a data resource proxy tool to process the map data request command to obtain a map data request result, and returns the map data request result to the WebGIS client to realize scene loading of spatial data. This spatial data loading method for WebGIS uses a data resource proxy tool to store the loaded spatial data in the client browser's cache database. During data scheduling, data is read from the cache database, reducing the number of network requests. Efficient retrieval of spatial data is achieved through the cache database's API, thereby greatly improving the loading and rendering efficiency of map data.

[0073] In this embodiment of the invention, the map data request instruction is processed according to map data matching rules to obtain the map data request result, such as... Figure 2 As shown, it includes:

[0074] S210, Obtain agent configuration information;

[0075] In this embodiment of the invention, the data resource proxy tool is specifically implemented using the global resource proxy ProxyManager class. After initializing the global resource proxy ProxyManager class, the proxy configuration information of the global resource proxy ProxyManager class is obtained.

[0076] S220. When a map data request instruction is received, determine whether the resource proxy channel is open;

[0077] In this embodiment of the invention, after calling the data resource proxy tool, it is also necessary to confirm whether the data resource proxy tool has been enabled. That is, the resource proxy channel can only be opened after it is enabled, and then map data request commands can be sent based on the resource proxy channel.

[0078] S230. If the resource proxy channel is not open, send the map data request instruction to the server to obtain the map data request result;

[0079] It should be understood that if a data resource proxy tool is invoked, but is not enabled, a map data request command still needs to be sent to the server to obtain the map data request result.

[0080] S240. If the resource proxy channel is enabled, the map data request result is obtained according to the map data matching rules.

[0081] In this embodiment of the invention, the map data request result is obtained according to map data matching rules, such as... Figure 3As shown, it includes:

[0082] S241. Determine whether the current map data request instruction needs to cache the map data based on the map matching rules;

[0083] It should be understood that the map data request command can determine whether the requested map data needs to be cached. If it does not need to be cached, the map data request command can still be sent directly to the server when the resource proxy channel is enabled. If the requested map data needs to be cached, the server's map data can be cached to the current client, and the map data request result can be obtained by reading the cached map data later.

[0084] S242. If it is necessary to cache the map data, then request the current cached data of the client according to the map data request instruction to obtain the map data request result;

[0085] In this embodiment of the invention, when map data needs to be cached, the map data is specifically cached on the current client, and map data can be requested from the cache of the current client.

[0086] Specifically, according to the map data request instruction, the client's current cached data is requested to obtain the map data request result, including:

[0087] 1) Calculate map key values ​​based on the map data resource parameters in the map data request instruction;

[0088] 2) Query the client's cache database based on the map key value to determine whether map data corresponding to the map key value exists in the cache database;

[0089] 3) If map data corresponding to the map key value exists in the cache database, then read the map data corresponding to the map key value from the cache database;

[0090] 4) If the cache database does not contain map data corresponding to the map key value, then send the map data request instruction to the server to update the cache database.

[0091] S243. If caching of map data is not required, send the map data request instruction to the server to obtain the map data request result.

[0092] In this embodiment of the invention, the specific implementation process of the data proxy mechanism is as follows: Figure 4As shown, this invention uses a global resource proxy ProxyManager class to manage data resources uniformly. First, the system's global proxy ProxyManager class is initialized to obtain proxy configuration information. When a data request enters the proxy, the requested data resource parameters are matched according to proxy rules such as domain name and file type to determine whether resource proxying needs to be enabled. If proxying is not enabled, the result is returned according to the default data request method; otherwise, the proxy processing flow is entered. In the ProxyManager class, a unique key value is generated based on the requested map data block resource parameters. Then, the IndexedDB is read based on the key value to determine if the data exists in the database. If the data does not exist, the request is sent to the backend to request the data resource. After the request returns data, the IndexedDB cache is updated, and the data is simultaneously returned to the map engine for rendering.

[0093] In this embodiment of the invention, the method further includes actions performed after the step of reading the map data from the cached database:

[0094] Determine whether the map data corresponding to the map key value in the cache database has expired;

[0095] If it has not expired, the map data corresponding to the map key value will be determined as the map data request result;

[0096] If it expires, a map data request instruction is sent to the server to update the cache database.

[0097] It should be understood that, such as Figure 4 As shown, if the data exists in the cache database, the system checks whether the data has expired based on the cache update strategy configured in the ProxyManager class. If the data has not expired, it is returned. Otherwise, the request is sent to the backend, which updates the IndexedDB database after returning the data and then returns the data.

[0098] In this embodiment of the invention, when map data caching is required during the proxy mechanism process, it can be implemented using map matching rules. Specifically, determining whether the current map data request instruction needs to cache map data based on map matching rules includes:

[0099] 1) Based on the current map data request instruction, determine the current map data request instruction and generate map data resource request information;

[0100] 2) Determine whether the map data resource domain name exists in the domain name list based on the map data resource request information;

[0101] 3) If the map data resource domain name exists in the domain name list, then determine whether the map data resource type is in the data type list;

[0102] 4) If the map data resource type is in the data type list, calculate the geographic range of the map data based on the map data resource request information, and determine whether the geographic range of the map data intersects with the cache range;

[0103] 5) If the geographic range of the map data intersects with the cache range, then determine whether the current tile level in the map data resource request is in the cache level;

[0104] 6) If the current tile level is in the cache level, then it is determined that the map data needs to be cached.

[0105] It should be understood that in WebGIS maps, raster maps require tiling. The map is partitioned according to a quadtree based on the map origin (top left, bottom left, etc.). When tiling a specific area, tiling begins from the top left (northwest corner) and covers this fixed range. The first-level tile typically uses one image. Subsequent levels use a quadtree data structure; one tile at level n becomes four tiles at level n+1. Each tile is numbered using "level number + row number + column number." Tiles can be requested using the level number / column number / row number. The geographic range of the data can be calculated using the tile's level number and row / column number, and the tile coordinates within that range can be calculated from the geographic range. This establishes a one-to-one correspondence between tile data resource IDs and geographic ranges. Therefore, a matching mechanism for geographic range and data precision is incorporated into the proxy matching rules, such as... Figure 5 As shown. The data rule matching process is as follows:

[0106] 1) First, make a data resource request, passing in the resource ID;

[0107] 2) Domain matching. Determine if the provided resource ID is in the domain list;

[0108] 3) Data type matching: Determine if the resource data type is in the data type list;

[0109] 4) Geographic range matching: Obtain the layer and row / column number of the tile data based on the resource ID, calculate the geographic range of the data based on the layer and row / column number, and determine whether the geographic range of the current tile data intersects with the defined range;

[0110] 5) Data precision matching: Determine whether the current tile's layer number is within the specified maximum and minimum layer number range;

[0111] 6) Return the results.

[0112] In this embodiment of the invention, in order to improve loading efficiency, for network users, data can be preloaded according to the visualization area.

[0113] Specifically, such as Figure 6 As shown, the method for loading spatial data for WebGIS also includes steps performed before invoking the data resource proxy tool:

[0114] S10. Determine the coordinates of the center point of the current viewpoint based on the scene loading requirements of the spatial data on the WebGIS client;

[0115] S20. Query the target tile data according to the preset cached geographical range parameters, and calculate the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewpoint;

[0116] S30. Determine the priority sorting of tile data based on the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewpoint;

[0117] S40. Determine the set of map tile data that needs to be cached under the current view according to the priority sorting of the tile data;

[0118] S50. Generate a map data preload request instruction based on the map tile data set, wherein the data resource agent tool can preload the map tile data set to the client based on the map data preload request instruction.

[0119] In this embodiment of the invention, combined with Figure 7 The flowchart shown illustrates the dynamic caching process for the map viewpoint. After map initialization, the map rendering message loop begins. When the map is zoomed in, zoomed out, panned, or rotated, a viewpoint change event is triggered. Upon detecting this change, the system first obtains the coordinates of the current viewpoint's center point. Based on the user-configured cache geographic range parameters, it retrieves tile data that meets the criteria. Then, it calculates the distance between the center point coordinates of each tile and the center point coordinates of the current viewpoint, prioritizing the tiles according to their distance. This yields the set of map tile data that needs to be cached for the current viewpoint. Finally, the system requests and caches the necessary map data. Through this process, map data within a certain area around the viewpoint center can be automatically calculated and pre-loaded based on the user's viewpoint location. When the user browses and pans, data can be directly read from the cached data, enabling efficient map browsing.

[0120] In this embodiment of the invention, offline applications can also be implemented using data loaded into the client cache.

[0121] Specifically, the method for loading spatial data for WebGIS also includes steps performed before invoking the data resource proxy tool:

[0122] (1) Retrieve map data according to the map range in the preset caching rules to determine the target tile data;

[0123] (2) The target tile data is processed according to the map matching rules to determine the offline map data;

[0124] (3) Generate an offline map data request instruction based on the offline map data, wherein the data resource proxy tool can preload the offline map data to the client based on the offline map data request instruction.

[0125] In this embodiment of the invention, the specific offline application process is as follows: Figure 8 As shown, the process begins with system initialization. A map cache ID is generated based on the system configuration information. Then, the system-defined cache rules are loaded. Map data within the specified range is retrieved according to the cache rules, and tile data matching the criteria is found. Data is then filtered according to the set matching rules, and finally, the data is requested and processed for database entry. Through this process, map data within a user-specified range can be uniformly stored offline. This enables localized storage and offline browsing of massive amounts of spatial data, enhancing the availability of spatial data in offline environments.

[0126] The following describes in detail the specific implementation process of the spatial data loading method for WebGIS in this embodiment of the invention, taking the Web3DGIS map engine as an example.

[0127] Cesium is a WebGL-based map engine written in JavaScript. It's an open-source JavaScript product for creating 3D globes and maps. This map engine provides a JavaScript-based development kit, allowing users to quickly build a plugin-free virtual globe web application. It offers high-quality guarantees in performance, accuracy, rendering quality, multi-platform compatibility, and ease of use, and provides excellent touch support, supporting most browsers and mobile devices.

[0128] IndexedDB is a low-level API used to store large amounts of structured data (including files / large binary objects) on the client side. This API uses indexes to achieve high-performance searching of the data. IndexedDB is a transactional database system, similar to a SQL-based RDBMS. It has the following application scenarios:

[0129] 1) Convenient access. IndexedDB is a JavaScript-based object-oriented database. IndexedDB can store and retrieve objects indexed by keys; it can store any object supported by the structured cloning algorithm.

[0130] 2) Offline Applications. Using IndexedDB to store user data and application state allows users to continue operating even without a network connection, with data automatically syncing when the network connection is restored. Examples include offline note-taking applications and offline task managers.

[0131] 3) High-frequency data updates. IndexedDB supports high-frequency data write and read operations, making it suitable for storing and updating real-time data. Examples include message storage on social networks and historical message storage in online chat applications. IndexedDB is a low-level API provided in the browser for storing large amounts of structured data, including files / binary large objects (BLOBs). It is persistent and asynchronous, suitable for storing and querying large amounts of data.

[0132] 4) Client-side data caching. After retrieving data from the server, it is cached in IndexedDB. Subsequent accesses can retrieve data directly from the local database, reducing network latency. Examples include product data caching in news applications, blog platforms, and e-commerce websites.

[0133] 5) User Personalization Settings Storage. Web applications need to save user settings and preferences. Using IndexedDB to store user personalization configurations (such as theme colors, layout choices, language preferences, etc.) allows these settings to be restored when the user logs back in or changes devices. Examples include dashboards, personalized news feeds, and online editors.

[0134] 6) Large file storage. This addresses the need to store and access large amounts of files or binary data on the browser side. IndexedDB can store large files such as images, videos, and audio files, allowing users to directly access and manipulate these files without downloading them to their local hard drive. Examples include online video editors, image processing tools, and audio editing tools.

[0135] This invention uses Ceisum as the web-based map rendering engine and IndexedDB as the web-based spatial data caching database. The Cesium map engine supports OGC standard map service data, including WMS, WMTS, TMS, 3DTiles model services, and I3S map services. The Cesium framework encapsulates a resource management class, Cesium.Resource, through which all spatial data resource requests are processed. Therefore, the cache management class ProxyManager is integrated into the Cesium.Resource class, allowing Cesium to obtain all request parameters when requesting resource data and process the requests uniformly through ProxyManager. A cache management mechanism is designed within the ProxyManager class, using IndexedDB as the cache database for persistent storage management of various types of spatial data.

[0136] In this embodiment of the invention, a tilted three-dimensional model of a certain region is used as the spatial data for testing. The data is shown in Table 1.

[0137] Table 1 Test Data

[0138]

[0139] In the same environment, tests were conducted on the data before and after enabling caching, focusing on four aspects: loading time, response time, storage usage, and memory usage. The test results are shown in Table 2.

[0140] Table 2 Experimental Results

[0141]

[0142] Experiments show that enabling caching significantly reduces the response time, loading time, and memory usage for loading data from the same perspective compared to before enabling caching. Therefore, it can be concluded that the client-side caching mechanism designed in this invention can greatly reduce data request response time and memory usage, thereby effectively improving the loading efficiency of massive amounts of spatial data.

[0143] In summary, the spatial data loading method for WebGIS provided in this invention is based on Web client caching technology. Leveraging the advantages of IndexedDB database, such as asynchronous data access, large-scale data storage support, and efficient query retrieval, it designs a client-side caching management mechanism for massive spatial data. This mechanism unifies the storage and management of system-loaded data through client caching, effectively reducing network requests and significantly improving the loading and rendering efficiency of spatial data. Furthermore, the client-side caching technology of this invention can pre-cache spatial data within a specified area, enabling localized storage and offline browsing of massive spatial data in offline environments, thus enhancing the availability of spatial data in offline environments. The dynamic caching mechanism based on map perspective can dynamically calculate and automatically cache map data according to the viewpoint location, enabling pre-loading of map data and enhancing the user experience. The client-side caching technology of this invention supports large-scale data storage capabilities, enabling GB-level client-side spatial data storage. It also provides a flexible API for easy management of cached data, greatly increasing the system's availability, scalability, and flexibility.

[0144] As another embodiment of the present invention, a spatial data loading device 100 for a WebGIS client is provided, which implements the spatial data loading method for a WebGIS client described above, wherein, as Figure 9 As shown, it includes:

[0145] The request instruction generation module 110 is used to generate map data request instructions based on the scene loading requirements of spatial data on the WebGIS client.

[0146] The resource proxy calling module 120 is used to call the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server and process the map data request instruction according to the map data matching rules to obtain the map data request result. The map data matching rules include at least data geographic range matching and data accuracy matching.

[0147] The data return module 130 is used to receive the map data request result and return the map data request result to the WebGIS terminal to realize the scene loading of spatial data.

[0148] The spatial data loading device for WebGIS provided by this invention generates a map data request command based on the scene loading requirements of spatial data on the WebGIS client. It then calls a data resource proxy tool to process the map data request command, obtains the map data request result, and returns the result to the WebGIS client to achieve scene loading of the spatial data. This spatial data loading device for WebGIS stores the loaded spatial data in the client browser's cache database through the data resource proxy tool. During data scheduling, data is read from the cache database, reducing the number of network requests. Efficient retrieval of spatial data is achieved through the cache database's API, thereby greatly improving the loading and rendering efficiency of map data.

[0149] The specific working principle of the spatial data loading device for WebGIS provided by this invention can be found in the description of the spatial data loading method for WebGIS above, and will not be repeated here.

[0150] As another embodiment of the present invention, a client 10 is provided, wherein, as Figure 10 As shown, it includes: a WebGIS client 200 and a spatial data loading device 100 for the WebGIS client as described above. The spatial data loading device 100 for the WebGIS client is communicatively connected to the WebGIS client 200. The spatial data loading device 100 for the WebGIS client can generate map data request instructions according to the scene loading requirements of the spatial data on the WebGIS client, can call a data resource proxy tool to process the map data request instructions to obtain map data request results, and return the map data request results to the WebGIS client to realize scene loading of spatial data.

[0151] The client provided by this invention generates a map data request command based on the scene loading requirements of spatial data on the WebGIS client. It then calls a data resource proxy tool to process the map data request command, obtains the map data request result, and returns the result to the WebGIS client to achieve scene loading of spatial data. This client, through the data resource proxy tool, stores the loaded spatial data in the client browser's cache database. During data scheduling, data is read from the cache database, reducing the number of network requests. Efficient retrieval of spatial data is achieved through the cache database's API, thereby greatly improving the loading and rendering efficiency of map data.

[0152] The specific working principle of the client provided by this invention can be found in the description of the spatial data loading method for WebGIS, which will not be repeated here.

[0153] As another embodiment of the present invention, a spatial data loading system for a WebGIS client is provided, specifically including a server and the aforementioned client, wherein the server and the client are communicatively connected. This spatial data loading system for a WebGIS client generates a map data request instruction based on the scene loading requirements of the spatial data on the WebGIS client, calls a data resource proxy tool to process the map data request instruction to obtain a map data request result, and returns the map data request result to the WebGIS client to realize scene loading of the spatial data. This spatial data loading system for a WebGIS client stores the loaded spatial data in the client browser's cache database through the data resource proxy tool. During data scheduling, data is read from the cache database, reducing the number of network requests. Efficient retrieval of spatial data is achieved through the cache database's API, thereby greatly improving the loading and rendering efficiency of map data.

[0154] For details on the working principle of the spatial data loading system for WebGIS, please refer to the description of the spatial data loading method for WebGIS mentioned above; it will not be repeated here.

[0155] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A method for loading spatial data in a WebGIS application, characterized in that, include: Generate map data request instructions based on the scene loading requirements of spatial data from the WebGIS client; The data resource proxy tool is invoked, and the map data request instruction is sent to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server, and process the map data request instruction according to the map data matching rules to obtain the map data request result. The map data matching rules include at least data geographic range matching and data accuracy matching. Receive the map data request result and return the map data request result to the WebGIS client to realize the scene loading of spatial data; Specifically, to enable offline applications using data loaded into the client cache, the method for loading spatial data for the WebGIS client also includes performing the following steps before invoking the data resource proxy tool: The map data is retrieved based on the map range in the preset caching rules to determine the target tile data; The target tile data is filtered according to map matching rules to determine offline map data; An offline map data request instruction is generated based on the offline map data, wherein the data resource proxy tool can preload the offline map data to the client based on the offline map data request instruction; For network-connected users, the method for loading spatial data for WebGIS clients also includes preloading data according to visualized areas, performed before the step of calling the data resource proxy tool: Determine the coordinates of the center point of the current viewpoint based on the scene loading requirements of the spatial data in the WebGIS client; The target tile data is queried based on the preset cached geographical range parameters, and the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewpoint is calculated. The priority sorting of tile data is determined based on the distance between the center point coordinates of the target tile data and the center point coordinates of the current viewpoint; The set of map tile data that needs to be cached under the current viewpoint is determined based on the priority sorting of the tile data; A map data preload request instruction is generated based on the map tile data set, wherein the data resource agent tool is able to preload the map tile data set to the client based on the map data preload request instruction.

2. The method for loading spatial data for a WebGIS client according to claim 1, characterized in that, The map data request instruction is processed according to map data matching rules to obtain map data request results, including: Obtain agent configuration information; When a map data request instruction is received, determine whether the resource proxy channel is open; If the resource proxy channel is not open, the map data request instruction is sent to the server to obtain the map data request result; If the resource proxy channel is enabled, the map data request result is obtained according to the map data matching rules.

3. The method for loading spatial data for a WebGIS client according to claim 2, characterized in that, The map data request result is obtained according to the map data matching rules, including: Determine whether the map data needs to be cached based on the map matching rules for the current map data request command; If map data needs to be cached, the current cached data on the client is requested according to the map data request instruction to obtain the map data request result; If caching of map data is not required, a map data request instruction is sent to the server to obtain the map data request result.

4. The method for loading spatial data for a WebGIS client according to claim 2, characterized in that, The map data request command requests the client's current cached data to obtain the map data request result, including: Calculate map key values ​​based on the map data resource parameters in the map data request instruction; The client's cache database is queried based on the map key value to determine whether map data corresponding to the map key value exists in the cache database; If the cache database contains map data corresponding to the map key value, then read the map data corresponding to the map key value from the cache database; If the cache database does not contain map data corresponding to the map key value, a map data request instruction is sent to the server to update the cache database.

5. The method for loading spatial data for a WebGIS client according to claim 4, characterized in that, This also includes actions performed after the step of reading the map data from the cached database: Determine whether the map data corresponding to the map key value in the cache database has expired; If it has not expired, the map data corresponding to the map key value will be determined as the map data request result; If it expires, a map data request instruction is sent to the server to update the cache database.

6. The method for loading spatial data for a WebGIS client according to claim 3, characterized in that, Based on map matching rules, determine whether the current map data request instruction needs to cache map data, including: Based on the current map data request instruction, determine the current map data request instruction and generate map data resource request information; Determine whether the map data resource domain name exists in the domain name list based on the map data resource request information; If the map data resource domain name exists in the domain name list, then determine whether the map data resource type is in the data type list; If the map data resource type is in the data type list, then the geographic range of the map data is calculated based on the map data resource request information, and it is determined whether the geographic range of the map data intersects with the cache range. If the geographic range of the map data intersects with the cache range, then determine whether the current tile level in the map data resource request is in the cache level; If the current tile level is in the cache level, then it is determined that the map data needs to be cached.

7. A device for loading spatial data for a WebGIS client, used to implement the method for loading spatial data for a WebGIS client as described in any one of claims 1 to 6, characterized in that, include: The request instruction generation module is used to generate map data request instructions based on the scene loading requirements of spatial data on the WebGIS client. The resource proxy invocation module is used to invoke the data resource proxy tool and send the map data request instruction to the data resource proxy tool. The data resource proxy tool is used to take over the data request between the client and the server and process the map data request instruction according to the map data matching rules to obtain the map data request result. The map data matching rules include at least data geographic range matching and data accuracy matching. The data return module is used to receive the map data request result and return the map data request result to the WebGIS terminal to realize the scene loading of spatial data.

8. A client application, characterized in that, include: The WebGIS client and the spatial data loading device for the WebGIS client as described in claim 7, wherein the spatial data loading device for the WebGIS client is communicatively connected to the WebGIS client, the spatial data loading device for the WebGIS client can generate map data request instructions according to the scene loading requirements of the spatial data on the WebGIS client, can call a data resource proxy tool to process the map data request instructions to obtain map data request results, and return the map data request results to the WebGIS client to realize scene loading of spatial data.

Citation Information

Patent Citations

  • EnersunWebCache based method for dynamically generating cached power grid map tiles

    CN105608191A