A lightweight method for 3D geographic data in WebGIS
By extracting and storing the two-dimensional plane and spatial line features of WebGIS three-dimensional geographic data, combined with the client cache rendering data, the problem of poor display effect after lightweight is solved, and a fast viewing and lightweight three-dimensional geographic data display is achieved.
Patent Information
- Application Number
- CN202411776487.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-05
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2044-12-05
AI Technical Summary
In the prior art, the display effect of WebGIS three-dimensional geographic data is poor after lightweighting, mainly due to the loss of geometric information and the simplified model rendering.
By extracting the two-dimensional plane features and spatial line features of three-dimensional geographic data, it is stored on the server side, and the spatial rendering data is mapped into the client cache, and the client retrieves the rendering data from the cache according to the selected area for rendering.
It realizes that the client quickly viewed three-dimensional geographic data, and at the same time, the data is lightweight on the server side, without affecting the client's three-dimensional geographic information display.
Smart Images

Figure CN119251426B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of building information model data processing, and particularly to a method for lightweighting WebGIS three-dimensional geographic data. Background Art
[0002] WebGIS is a product of the combination of Web technology and GIS technology, and is a new technology that uses Web technology to expand and improve geographic information systems. WebGIS applies the client / server concept to perform GIS analysis tasks. It divides tasks into two parts: the server side and the client side. The client can request data, analysis tools, or modules from the server. The server either executes the client's request and sends the result back to the client through the network, or sends the data and analysis tools to the client for the client to use. The information in GIS is mainly spatial data that needs to be presented in the form of graphics and images. The client performs query and analysis on the spatial data through interactive operations. WebGIS enables the client to operate GIS maps and data on the Internet, use the Web to find the spatial data they need, and perform various operations.
[0003] WebGIS three-dimensional geographic data generally includes geographic data, spatial data, and attribute data. Among them, geographic data is the core content of WebGIS, including the spatial location, shape, and attribute information of various geographic features. These data usually exist in the form of vector data and raster data. Spatial data is the basic data in geographic information systems, including the spatial location and shape information of various geographic features. Attribute data is non-spatial information related to geographic features, such as the rendering information of three-dimensional buildings in the corresponding geographic information, the detailed display information corresponding to the actual three-dimensional buildings, etc. Therefore, the massive amount of WebGIS three-dimensional data has made the lightweighting of WebGIS data a research hotspot in recent years.
[0004] In the prior art, the lightweighting of WebGIS three-dimensional geographic data generally simplifies the three-dimensional geometric model, uses model format conversion, or simplifies the rendering therein. The above technologies can all achieve the lightweighting processing of WebGIS three-dimensional geographic data, but the lightweighted WebGIS three-dimensional geographic data has a relatively poor display effect due to the loss of geometric information and the simplification of model rendering. Summary of the Invention
[0005] To solve the above technical problems, this application proposes the following technical solutions:
[0006] In a first aspect, an embodiment of this application provides a method for lightweighting WebGIS three-dimensional geographic data, including:
[0007] Obtain two-dimensional plane feature data from three-dimensional geographic data and extract the plane line features corresponding to the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data;
[0008] Store the plane line features and spatial line features on the server side and map and store the spatial rendering data in the three-dimensional geographic data in the client cache;
[0009] When accessing the GIS server through the client to view the three-dimensional geographic data, retrieve the rendering data corresponding to the currently selected area in the plane line features from the client cache and render the three-dimensional geographic data of the plane line selected area.
[0010] In a possible implementation manner, the obtaining two-dimensional plane feature data from three-dimensional geographic data and extracting the plane line features corresponding to the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data includes:
[0011] Use the loadtxt function in the numpy library to load three-dimensional geographic data from the three-dimensional model of GIS;
[0012] Use the PCA module in the sklearn library to perform dimensionality reduction processing on the three-dimensional geographic data to obtain two-dimensional plane data and generate a two-dimensional plane model;
[0013] Obtain the plane line features of the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data according to the two-dimensional plane model and the three-dimensional model respectively.
[0014] In a possible implementation manner, storing the plane line features and spatial line features on the server side and mapping and storing the spatial rendering data in the three-dimensional geographic data in the client cache includes:
[0015] Split the plane line features according to the unit individuals in the GIS three-dimensional model to obtain multiple sub-plane line features;
[0016] Split the spatial line features according to the sub-plane line features to obtain multiple sub-spatial line features;
[0017] Establish a mapping relationship between the sub-plane line features and the sub-spatial line features to obtain multiple three-dimensional module line groups;
[0018] Determine the spatial rendering data of each three-dimensional module line group in the GIS three-dimensional model;
[0019] Map and store the spatial rendering data of each three-dimensional module line group in the client cache accessing the GIS server.
[0020] In a possible implementation, when accessing the GIS server through the client to view 3D geographical data, rendering the 3D geographical data of the selected area of the planar line by retrieving the corresponding rendering data from the client cache according to the area in the planar line features currently selected by the client includes:
[0021] When the client accesses the GIS server, the GIS server transmits the planar line features in the 2D planar model to the client side;
[0022] When any sub-planar line feature in the planar line features is selected on the client side, request the corresponding sub-space line feature from the GIS server side according to the mapping relationship;
[0023] Read the corresponding spatial rendering data from the client side cache according to the 3D module line group composed of the obtained sub-planar line features and the requested sub-space line features to restore all the features in the original 3D geographical data.
[0024] In a possible implementation, after obtaining the 3D module line group composed of the sub-planar line features and the sub-space line features, reading the corresponding spatial rendering data from the client side cache to restore all the features in the original 3D geographical data includes:
[0025] Determine the color, gloss, and transparency parameters of the spatial rendering data corresponding to the 3D module line group;
[0026] First, retrieve the texture features in the spatial rendering data to perform texture rendering on the surface of the 3D module line group so that each face of the 3D module line group restores the original pattern or details;
[0027] Then determine the color scheme of different faces of the 3D module line group, and render the color features in the spatial rendering data onto the textured 3D module line group;
[0028] Finally, adjust the rendering according to the light, shadow, and reflection data in the spatial rendering data to obtain all the features of the 3D module line group in the original 3D geographical data.
[0029] In a possible implementation, after the client side completes an access or operation, update the spatial rendering data in the client side cache.
[0030] In a possible implementation, after the client side completes an access or operation, updating the spatial rendering data in the client side cache includes:
[0031] After the first spatial rendering data in the client - side cache is retrieved, delete the first spatial rendering data, where the first spatial rendering data is any spatial rendering data;
[0032] Expand the first cache space, and store the pointer address of the first cache space as replacement data at the original position of the first spatial rendering data. Different spatial rendering data generate new cache spaces after being retrieved, and the pointer address of each new cache space is unique;
[0033] After the client - side view is completed, directly store the original 3D geographic data corresponding to the first spatial rendering data into the new cache space.
[0034] In a possible implementation, the step of expanding the first cache space and storing the pointer address of the first cache space as replacement data at the original position of the first spatial rendering data includes:
[0035] After deleting the first spatial rendering data, keep the storage space of the first spatial rendering data in the client - side cache unchanged;
[0036] After the first cache space is determined, determine the length of the pointer address of the first cache space;
[0037] Release the storage space of the first spatial rendering data in the client - side cache until the remaining space length meets the length of the pointer address of the first cache space;
[0038] Store the pointer address of the first cache space into the remaining released space.
[0039] In the embodiments of the present application, after pre - processing and splitting the 3D geographic data, the line 3D data on the GIS server side and the spatial rendering data cached on the client side can enable the client to quickly view the 3D geographic data, and while realizing the lightweight of the GIS server - side data, it does not affect the display of the 3D geographic information on the client. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flowchart of a method for lightweighting WebGIS 3D geographic data provided by an embodiment of the present application;
[0041] Figure 2 It is a mapping diagram of the line features of 3D geographic data and spatial rendering data provided by an embodiment of the present application;
[0042] Figure 3 It is a schematic diagram of client - side cache data update provided by an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0043] The present solution will be described below in conjunction with the accompanying drawings and specific embodiments.
[0044] Refer to Figure 1 , the WebGIS three-dimensional geographic data lightweight method provided in this embodiment includes:
[0045] S101, obtaining two-dimensional plane feature data from the three-dimensional geographic data and extracting the plane line features corresponding to the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data.
[0046] A large number of three-dimensional geographic models are stored in the GIS server, and these three-dimensional geographic models are used to describe the actual morphology of geographic objects. These models convert geographic objects into continuous surfaces or geographic objects and attach various attributes for further analysis and research. The three-dimensional geographic model is generally a combination of several vector models in the map space, and generally uses lines, polygons, points, and surfaces to represent the contour shapes of geography. For the colors, object features, etc. of the geographic model, color rendering is used to implement them.
[0047] In this embodiment, based on the GIS three-dimensional model in the existing GIS server, first use the loadtxt function in the numpy library to load the three-dimensional geographic data from the GIS three-dimensional model, and use the PCA module in the sklearn library to perform dimensionality reduction processing on the three-dimensional geographic data to obtain two-dimensional plane data and generate a two-dimensional plane model; respectively obtain the plane line features of the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data according to the two-dimensional plane model and the three-dimensional model.
[0048] In this embodiment, the obtained plane line features are the basic division of the unit individuals in the three-dimensional geographic data at the two-dimensional level. For example, a building or a road is a basic plane line unit. After obtaining the plane line features, the spatial line features can be obtained by using the contour lines of the original three-dimensional model and the obtained plane line features in a differential subtraction manner.
[0049] S102, storing the plane line features and spatial line features on the server side and mapping and storing the spatial rendering data in the three-dimensional geographic data into the client cache.
[0050] After splitting the three-dimensional geographic data into plane line features, spatial line features, and spatial rendering data, in order to realize the lightweight of the data on the GIS server side, only the plane line features and spatial line features are retained on the GIS server side, and the spatial rendering data is stored in the client cache of the accessed client in the form of a cache. In this way, when the client views the data on the GIS server side, the line feature data can be quickly requested and obtained from the server side, and the spatial rendering data can be obtained locally.
[0051] In this embodiment, in order to enable the client to obtain the GIS data to be viewed more quickly, when the client accesses the GIS server to view and use the GIS data on the WEB page, the data is transmitted to the client in a mode of separate units. That is, a complete planar information is first displayed on the client WEB page. When the client randomly clicks on a certain building, only the corresponding spatial line features are transmitted from the server side. This not only does not affect the client's access to data, but also reduces the data transmission efficiency of the GIS server side.
[0052] Based on the above considerations, in this embodiment, the planar line features are split into multiple sub-planar line features according to the unit individuals in the GIS three-dimensional model, and the spatial line features are split into multiple sub-spatial line features according to the sub-planar line features. A mapping relationship is established between the sub-planar line features and the sub-spatial line features to obtain multiple three-dimensional module line groups, the spatial rendering data of each three-dimensional module line group in the GIS three-dimensional model is determined, and the spatial rendering data of each three-dimensional module line group is mapped and stored in the client-side cache for accessing the GIS server.
[0053] A schematic distance, such as Figure 2 As shown, there are three buildings A, B, and C in the original GIS data. In the way of this embodiment, the planar line features are first split into three sub-planar line features A1, B1, and C1, and the corresponding sub-spatial line features of A1, B1, and C1 are A2, B2, and C2 respectively. A mapping relationship is established, and (A1, A2), (B1, B2), and (C1, C2) form three three-dimensional module line groups, and the spatial rendering data in the client cache also exists independently. a corresponds to (A1, A2), b corresponds to (B1, B2), and c corresponds to (C1, C2).
[0054] S103. When the client accesses the GIS server to view the three-dimensional geographic data, according to the area in the planar line features currently selected by the client, the rendering data corresponding to the currently selected area of the planar line is retrieved from the client cache to render the three-dimensional geographic data of the currently selected area of the planar line.
[0055] When the client accesses the GIS server, the GIS server transmits the planar line features in the two-dimensional planar model to the client side; when the client side determines any sub-planar line feature in the planar line features, the corresponding sub-spatial line feature is requested from the GIS server side according to the mapping relationship. According to the three-dimensional module line group composed of the obtained sub-planar line features and the requested sub-spatial line features, the corresponding spatial rendering data is read from the client-side cache to restore all the features in the original three-dimensional geographic data.
[0056] Taking the example in S102, when the client clicks on A1 on the WEB page, it will trigger a request for subspace line features A2 from the GIS server and retrieve spatial rendering data a from the client cache. In this way, building A displayed in the original GIS three-dimensional geographical data will be presented in front of the client.
[0057] In this embodiment, when continuing to view other geographical information after viewing building A in the three-dimensional geographical data, the subspace line features and spatial rendering data of building A can be released. However, considering that the client may repeatedly access the same geographical information in the future, repeatedly requesting subspace line features from the GIS server will waste the resources of the GIS server. Therefore, in this embodiment, after the client side completes an access or operation, the spatial rendering data in the client side cache is updated.
[0058] Specifically, after the first spatial rendering data in the client side cache is retrieved, the first spatial rendering data is deleted, and the first spatial rendering data is any spatial rendering data. Expand the first cache space, and store the pointer address of the first cache space as replacement data at the original position of the first spatial rendering data. Different spatial rendering data generates new cache spaces after being retrieved, and the pointer address of each new cache space is unique; after the client side finishes viewing, directly store the original three-dimensional geographical data corresponding to the first spatial rendering data into the new cache space.
[0059] As Figure 3 shown, the storage interval of the original first spatial rendering data on the client cache side is the s1 segment. When the first spatial rendering data is retrieved for the first time, the first spatial rendering data is deleted, but the storage space of the s1 segment is retained. After the first cache space is determined, determine the length k1 of the pointer address of the first cache space, and then release the storage space s1 segment of the first spatial rendering data in the client side cache until the remaining space length meets the length k1 of the pointer address of the first cache space; store the pointer address k1 of the first cache space into the remaining space after release.
[0060] After adopting the above method, when the client accesses the same three-dimensional geographical information, there is no need to repeatedly request data from the GIS server. Only need to read the pointer address of the original three-dimensional geographical data from the client side cache and directly read it quickly from the corresponding new cache space.
[0061] It should be noted that the number of clients in this embodiment is not limited to one and can be multiple. After the client establishes communication with the GIS server, according to the access request of the client, the spatial rendering data corresponding to the three-dimensional geographical information is randomly pre-sent to the client cache in advance. Subsequently, the server side only needs to transmit the corresponding line feature data according to the specific viewing requirements of the user, realizing the lightweight transmission of GIS three-dimensional geographical data. When the client disconnects communication with the GIS server, all the geographical data in the client cache is immediately released.
[0062] In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects and indicates that three relationships can exist. For example, A and / or B can represent the cases of A existing alone, A and B existing simultaneously, and B existing alone. Wherein A and B can be singular or plural. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. "At least one of the following" and its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, and c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.
[0063] As described above, the foregoing are only specific embodiments of the present application. Any person skilled in the art within the technical scope disclosed in the present application can easily think of changes or substitutions, which should all be covered within the protection scope of the present application. The protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A lightweight method for WebGIS 3D geographic data, characterized in that, Including: Obtain two-dimensional plane feature data from three-dimensional geographic data, and extract the plane line features corresponding to the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data; Store the plane line features and spatial line features on the server side, and map and store the spatial rendering data in the three-dimensional geographic data into the client cache; When accessing the GIS server through the client to view the three-dimensional geographic data, according to the area in the plane line features currently selected by the client, retrieve the rendering data corresponding to the currently selected area of the plane line from the client cache, and render the three-dimensional geographic data of the selected area of the plane line; When a client-side access or operation is completed, update the spatial rendering data in the client-side cache, including: when the first spatial rendering data in the client-side cache is retrieved, delete the first spatial rendering data, and the first spatial rendering data is any spatial rendering data; Expand the first cache space, and store the pointer address of the first cache space as replacement data at the original position of the first spatial rendering data. After different spatial rendering data are retrieved, new cache spaces are generated respectively, and the pointer address of each new cache space points to a unique location; After the client-side viewing is completed, directly store the original three-dimensional geographic data corresponding to the first spatial rendering data into the new cache space.
2. The WebGIS three-dimensional geographic data lightweight method according to claim 1, wherein The step of obtaining two-dimensional plane feature data from three-dimensional geographic data and extracting the plane line features corresponding to the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data includes: Use the loadtxt function in the numpy library to load three-dimensional geographic data from the three-dimensional model of the GIS; Use the PCA module in the sklearn library to perform dimensionality reduction processing on the three-dimensional geographic data to obtain two-dimensional plane data and generate a two-dimensional plane model; Obtain the plane line features of the two-dimensional plane feature data and the spatial line features of the three-dimensional geographic data according to the two-dimensional plane model and the three-dimensional model respectively.
3. The WebGIS three-dimensional geographic data lightweight method according to claim 2, wherein The step of storing the plane line features and spatial line features on the server side and mapping and storing the spatial rendering data in the three-dimensional geographic data into the client cache includes: Split the plane line features according to the unit individuals in the GIS three-dimensional model to obtain multiple sub-plane line features; Split the spatial line features according to the sub-plane line features to obtain multiple sub-spatial line features; Establish a mapping relationship between the sub-plane line features and the sub-spatial line features to obtain multiple three-dimensional module line groups; Determine the spatial rendering data of each three-dimensional module line group in the GIS three-dimensional model; Map and store the spatial rendering data of each three-dimensional module line group into the client cache that accesses the GIS server.
4. The WebGIS three-dimensional geographic data lightweight method according to claim 3, wherein The step of when accessing the GIS server through the client to view the three-dimensional geographic data, retrieving the rendering data corresponding to the currently selected area of the plane line from the client cache according to the area in the plane line features currently selected by the client, and rendering the three-dimensional geographic data of the selected area of the plane line includes: When the client accesses the GIS server, the GIS server transfers the planar line features in the two-dimensional plane model to the client side; When the client side selects any sub-planar line feature in the planar line features, it requests the corresponding sub-space line feature from the GIS server side according to the mapping relationship; According to the three-dimensional module line group composed of the obtained sub-planar line features and the sub-space line features requested, the corresponding spatial rendering data is read from the client side cache to restore all the features in the original three-dimensional geographic data.
5. The WebGIS three-dimensional geographic data lightweight method according to claim 4, wherein After obtaining the three-dimensional module line group composed of the sub-planar line features and the sub-space line features, reading the corresponding spatial rendering data from the client side cache to restore all the features in the original three-dimensional geographic data includes: Determining the color, gloss, and transparency parameters corresponding to the three-dimensional module line group in the spatial rendering data; First, retrieve the texture features in the spatial rendering data to perform texture rendering on the surface of the three-dimensional module line group so that each face of the three-dimensional module line group restores the original pattern or details; Then determine the color scheme of different faces of the three-dimensional module line group, and render the color features in the spatial rendering data onto the textured three-dimensional module line group; Finally, adjust the rendering according to the light, shadow, and reflection data in the spatial rendering data to obtain all the features of the three-dimensional module line group in the original three-dimensional geographic data.
6. The WebGIS three-dimensional geographic data lightweight method according to claim 1, characterized in that The expanding the first cache space and storing the pointer address of the first cache space as replacement data at the original position of the first spatial rendering data includes: After deleting the first spatial rendering data, keep the storage space of the first spatial rendering data in the client side cache unchanged; After the first cache space is determined, determine the length of the pointer address of the first cache space; Release the storage space of the first spatial rendering data in the client side cache until the remaining space length meets the length of the pointer address of the first cache space; Store the pointer address of the first cache space in the remaining space after release.
Citation Information
Patent Citations
Building model generation method and device, electronic equipment and storage medium
CN118334253A
KR1025308150000B1