Grid layer service method and system for customizing online calculation and rendering

By building a raster layer service with customized online computing and rendering based on tile pyramids and cloud-optimized GeoTiff, the problem of inefficiency in band computing and data presentation in large-scale raster data online services is solved, and efficient and scalable real-time analysis capabilities are achieved.

CN119762697AInactive Publication Date: 2025-04-04ZHEJIANG UNIV
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411837126.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-04-04
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to efficiently customize band calculations and data presentation in large-scale online raster data services, especially in online map services, where inefficiency problems exist.

Method used

By leveraging the high concurrency performance advantages of tile pyramids and cloud-optimized GeoTiff, we build a raster layer service method for custom online computing and rendering. The specific steps include obtaining the original COG data, building the COG pyramid hierarchy structure, processing and storing the COG data, obtaining the pyramid tile number to be displayed according to the client window range and zoom level, and loading and displaying the final raster layer.

Benefits of technology

It realizes efficient band calculation and data presentation in large-scale remote sensing image services and online analysis, meets the needs of real-time analysis, is highly scalable, and improves service quality through decentralized service loading and interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119762697A_ABST
    Figure CN119762697A_ABST
Patent Text Reader

Abstract

The invention discloses a grid layer service method and system for customizing online calculation and rendering. Comprising the following steps: 1) calculating a maximum effective hierarchy according to the spatial resolution of original COG data, designing a hierarchical structure of a COG pyramid, and designing a row-column structure of tiles of each hierarchy in combination with a framing mode of the original COG data; 2) processing original COG data, and recording information such as a data range and the number of rows and columns of each level into an index file; 3) obtaining and displaying a pyramid tile number to be displayed, and analyzing the COG file to obtain a COG file path corresponding to the pyramid tile number to be displayed; and 4) loading the cross image step by step to generate a final grid layer. According to the method, the advantages of wide range and smooth loading of the tile pyramid map are reserved, the wave band information owned by the COG is introduced, self-defined online wave band calculation and visual rendering can be realized, the requirement of real-time analysis is met, and the method has high expandability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of online raster image computing and rendering, and in particular to a raster layer service method and system for customized online computing and rendering. Background Art

[0002] GeoTIFF is an open data standard and a special TIFF file. It uses a series of predefined TIFF tags to store geospatial information, such as geographic range, coordinate system, projection parameters, etc., so that the image is accompanied by geospatial information. With the explosive growth of remote sensing image volume, more and more data is migrated to cloud storage. However, due to the randomness of the internal order of ordinary GeoTIFF and the striped data organization method, it does not support partial reading by area of ​​interest. When accessing cloud data, it must be completely downloaded to the local computer before loading, which is inefficient and expensive because cloud storage usually charges by traffic. In order to solve these problems, cloud-optimized GeoTIFF was born as a new data standard. Its essence is still GeoTIFF, which is compatible with traditional GIS software, but by optimizing the data organization structure and standardizing metadata, COG can support partial reading of data, and is more suitable for cloud storage services such as object storage, realizing efficient workflow for remote sensing raster data on the cloud.

[0003] Online map services have high requirements for data reading performance and have certain difficulties in the visualization and interaction of large-scale remote sensing images. Compared with ordinary GeoTIFF image data, COG has better data reading performance in both small-scale areas of interest and large-scale previews due to its tiled data organization and multi-layer thumbnail data organization. At the same time, COG standardizes the location of metadata in the file, and provides data format support for efficient acquisition of remote sensing images stored in the cloud. A single COG file can be published as a map service. COG is essentially a small pyramid. The pyramid structure is the mainstream organization method for large-scale map services. Whether it is static tiles or dynamic mosaics, pyramids are needed to determine the zoom level and data range, and then request the corresponding data to be loaded. However, there is currently no application that organizes a large number of COG-formatted tiled remote sensing images to build a high-performance map service that supports online computing. Summary of the invention

[0004] The purpose of the present invention is to solve the problems existing in the prior art and provide a raster layer service method and system for customized online computing and rendering. The method of the present invention utilizes the high concurrency performance advantages of tile pyramid and cloud optimized GeoTiff to solve the problem of efficient customized band computing and data presentation in large-scale raster data online services, and has great application prospects in various large-scale remote sensing image services and online analysis work.

[0005] In order to achieve the above-mentioned invention object, the present invention specifically adopts the following technical solutions:

[0006] In a first aspect, the present invention provides a raster layer service method for customizing online computing and rendering, which comprises the following steps:

[0007] S1. Obtain an original COG data set consisting of original COG data, calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, form the bottom-level trapezoidal block structure from bottom to top with the bottom-level data of the original COG data and the thumbnails corresponding to each level, and form the rest of the trapezoidal block structures from their own bottom-level data and thumbnails from bottom to top. Multiple trapezoidal block structures are stacked to form a COG pyramid hierarchical structure, and the row and column structure of each level of the COG pyramid is designed in combination with the framing method of the original COG data;

[0008] S2. Process the original COG data according to the thumbnail hierarchy of the original COG data, generate the underlying data of the remaining trapezoidal block structures and the thumbnails of each level from the processed COG data, obtain the constructed COG pyramid, and store the processed COG data into a COG file, and save the COG file and its path, the data range of the original COG data set, and the row and column structure of the tiles of each level of the COG pyramid into the index file of the COG pyramid;

[0009] S3. Obtain the pyramid tile number to be displayed according to the window range of the client page and the current zoom level of the client page and display it on the client page, and parse the COG file to obtain the COG file path corresponding to the pyramid tile number to be displayed;

[0010] S4. Using the pyramid tile number to be displayed as the key in the index file, searching for the corresponding COG file path step by step, loading the processed COG data and sending it to the client page, and displaying the finally generated raster layer on the client page.

[0011] Based on the above scheme, each step can be implemented in the following preferred specific manner.

[0012] As a preferred embodiment of the first aspect, in step S1, the maximum effective level z of the COG pyramid is calculated. max The specific method is:

[0013]

[0014] Where m represents the spatial resolution of the original COG data, in meters per pixel.

[0015] As a preferred embodiment of the first aspect, in step S1, the specific process of designing the row and column structure of tiles at each level of the COG pyramid is as follows: when the original COG data is satellite remote sensing image data with a grid number and overlap, the row and column structure of the reference pyramid is used as the row and column structure of tiles at each level, and the reference pyramid is a standard pyramid with a resolution magnification of 2 times between adjacent levels; when the original COG data is remote sensing image derivative product data converted in the WGS84 geographic coordinate system and divided into longitude and latitude frames, the row and column structure of tiles at each level of the COG pyramid is preset, and the ratio of the number of rows and columns of the COG pyramid is kept consistent with the trapezoidal block structure of its bottom layer, and the resolution of the remaining trapezoidal block structures of the COG pyramid is the same as that of the original COG data.

[0016] As a preferred embodiment of the first aspect, in step S2, for the trapezoidal block structure at the bottom layer of the COG pyramid, a data processing strategy based on mapping matching is used to process the original COG data. The specific process is as follows: when the original COG data is satellite remote sensing image data, the grid numbers of the satellite remote sensing image data itself are traversed, and a tiled image set is formed by the satellite remote sensing image data on each grid number. Each pyramid tile is traversed at the bottom layer of the COG pyramid, and the overlapping part of each pyramid tile and each satellite remote sensing image data in the image set is used as an intersection degree judgment area. The ratio between each intersection degree judgment area and the area of ​​the bounding box of the corresponding satellite remote sensing image data is calculated and the ratio calculation result is used as the intersection degree index. If the intersection degree index is greater than the preset intersection degree threshold, the corresponding pyramid tile number and the satellite remote sensing image data path are saved in the form of a key-value pair; when the original COG data is remote sensing image derivative product data, the longitude and latitude range of the original COG data is divided into several longitude and latitude intervals, each longitude and latitude interval corresponds to a pyramid tile number, and the pyramid tile number and the original COG data are saved in the form of a key-value pair.

[0017] As a preferred embodiment of the first aspect above, in step S2, the intersection degree threshold is set to 0.8.

[0018] As a preferred embodiment of the first aspect, in step S2, for the remaining trapezoidal block structures of the COG pyramid, the specific process of processing the original COG data is: first, the bottom data of the bottom-most trapezoidal block structure is resampled, and the resampled bottom data is used as the bottom data of the trapezoidal block structure adjacent to the bottom-most trapezoidal block structure; then, the thumbnails of each level of the bottom-most trapezoidal block structure are resampled, and the resampled thumbnails of each level are used as thumbnails of each level of the trapezoidal block structure adjacent to the bottom-most trapezoidal block structure; the COG pyramid is processed in order from bottom to top; the bottom data and thumbnails of each level of the remaining trapezoidal block structures are generated by resampling the previous adjacent trapezoidal block structures; finally, a constructed COG pyramid is obtained, and the remote sensing image data path generated in the resampling process and the pyramid tile number used to generate the remote sensing image data are saved in the form of key-value pairs.

[0019] As a preferred embodiment of the first aspect, in step S3, the specific process of obtaining the pyramid tile number to be displayed is:

[0020] S31. Obtain the bounding box of the COG pyramid range, the number of pixel columns of the COG pyramid tile, and the maximum number of tiles in the longitude direction of each level of the COG pyramid to calculate the spatial resolution of each level of the COG pyramid;

[0021] When the current zoom level is the i-th layer of the COG pyramid, the spatial resolution of the i-th layer of the COG pyramid is calculated as follows:

[0022]

[0023] Where: extent[0], extent[1] represent the minimum longitude and minimum latitude of the bounding box of the COG pyramid range respectively; tile_size represents the number of pixel columns of the COG pyramid tile; z i_column Indicates the maximum number of tiles in the longitude direction of the i-th layer of the COG pyramid;

[0024] S32. Obtain the spatial resolution of the current window provided by the client, traverse each level of the COG pyramid, calculate the resolution difference between the spatial resolution of each level of the COG pyramid and the spatial resolution of the current window, and use the COG pyramid level with the smallest spatial resolution difference as the current zoom level;

[0025] S33. After determining the current zoom level, obtain the number of pyramid tile rows and columns corresponding to the current zoom level from the index file, and calculate the minimum pyramid tile number x of the bounding box of the window range in the longitude direction. min and the maximum pyramid tile number x maxand the minimum pyramid tile number y in the latitude direction min and the maximum pyramid tile number y max :

[0026] x min =Math.floor((bbox[0]-extent[0]) / x tile_range )

[0027] y min =Math.floor((bbox[1]-extent[1]) / y tile_range )

[0028] x max =Math.ceil((bbox[2]-extent[0]) / x tile_range )-1

[0029] y max =Math.ceil((bbox[3]-extent[1]) / y tile_range )-1

[0030] Where: bbox[0], bbox[1], bbox[2], bbox[3] represent the minimum longitude, minimum latitude, maximum longitude and maximum latitude of the bounding box of the window range respectively; x tile_range Indicates the span of each pyramid tile in the longitude direction; y tile_range Indicates the span of each pyramid tile in the latitude direction; Math.floor indicates rounding down; Math.ceil indicates rounding up;

[0031] S34. The minimum pyramid tile number and the maximum pyramid tile number in the longitude direction constitute the pyramid tile interval in the longitude direction, and the minimum pyramid tile number and the maximum pyramid tile number in the latitude direction constitute the pyramid tile interval in the latitude direction. All pyramid tiles are looped through in the longitude direction pyramid tile interval and the latitude direction pyramid tile interval and used as pyramid tiles to be displayed. Finally, the pyramid tile numbers to be displayed are returned in the form of an array and displayed on the client page.

[0032] In a second aspect, the present invention provides a raster layer service system for customized online computing and rendering, which includes:

[0033] A structure design module is used to obtain an original COG data set composed of original COG data, calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, form the bottom-level trapezoidal block structure from the bottom to the top of the bottom data of the original COG data and the thumbnails corresponding to each level, and form the rest of the trapezoidal block structures from their own bottom-level data and thumbnails from the bottom to the top. A plurality of trapezoidal block structures are stacked to form a COG pyramid hierarchical structure, and the row and column structure of each level of the COG pyramid is designed in combination with the framing method of the original COG data;

[0034] A storage module is used to process the original COG data according to the thumbnail hierarchy of the original COG data, generate the bottom layer data of the remaining trapezoidal block structures and the thumbnails of each level from the processed COG data, obtain the constructed COG pyramid, store the processed COG data into a COG file, and save the COG file and its path, the data range of the original COG data set, and the row and column structure of the tiles of each level of the COG pyramid into the index file of the COG pyramid;

[0035] A display module, used for obtaining the pyramid tile number to be displayed according to the window range of the client page and the current zoom level of the client page and displaying it on the client page, and parsing the COG file to obtain the COG file path corresponding to the pyramid tile number to be displayed;

[0036] The result generation module is used to use the pyramid tile number to be displayed as the key in the index file, search for the corresponding COG file path level by level, load the processed COG data and send it to the client page, and display the final generated raster layer on the client page.

[0037] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the raster layer service method for customized online computing and rendering as described in any of the schemes of the first aspect above is implemented.

[0038] In a fourth aspect, the present invention provides a computer electronic device comprising a memory and a processor;

[0039] The memory is used to store computer programs;

[0040] The processor is used to implement the raster layer service method for customized online computing and rendering as described in any solution of the first aspect when executing the computer program.

[0041] Compared with the prior art, the present invention has the following beneficial effects:

[0042] 1) The present invention uses the pyramid structure to compile large-scale COG format framed remote sensing image data, and then builds an online map service. It not only retains the advantages of wide range and smooth loading of tile pyramid maps, but also introduces the band information owned by COG, can realize customized online band calculation and visual rendering, meet the needs of real-time analysis, and has high scalability.

[0043] 2) In order to solve the problem of high computing pressure of centralized services, the present invention proposes a map service organization architecture based on index files. The design uses an index file in JSON format to record the metadata information of the COG pyramid map service, which has high scalability. Based on this, only the object storage service and client adaptation for hosting data are needed to build a map service without maintaining additional GIS services, realizing decentralized service loading and interaction, improving service quality and promoting data sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flow chart of the steps of the method of the present invention;

[0045] Figure 2 Schematic diagram of a COG pyramid model according to an embodiment of the present invention;

[0046] Figure 3 A flowchart for constructing a COG pyramid according to an embodiment of the present invention;

[0047] Figure 4 is a system block diagram of the present invention;

[0048] Figure 5 This is an RGB rendering effect diagram of the local details of the Sentinel-2 image map service in an embodiment of the present invention;

[0049] Figure 6 This is a graph showing the calculation of local NDVI bands and color band rendering of the Sentinel-2 image map service in an embodiment of the present invention; DETAILED DESCRIPTION

[0050] In order to make the above-mentioned purpose, features and advantages of the present invention more obvious and easy to understand, the specific implementation mode of the present invention is described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below. The technical features in each embodiment of the present invention can be combined accordingly without conflicting with each other.

[0051] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for the purpose of distinguishing descriptions, and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features.

[0052] like Figure 1 As shown, in a preferred implementation of the present invention, the above-mentioned raster layer service method for customized online computing and rendering includes the following steps S1 to S4. The specific implementation process is described in detail below.

[0053] S1. Obtain an original COG dataset consisting of original COG data, calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, and form the bottom-level trapezoidal block structure from bottom to top by the bottom-level data of the original COG data and the thumbnails corresponding to each level. The remaining trapezoidal block structures are composed of their own bottom-level data and thumbnails in order from bottom to top. A plurality of trapezoidal block structures are stacked to form a COG pyramid hierarchical structure. The row and column structure of tiles at each level of the COG pyramid is designed in combination with the framing method of the original COG data.

[0054] It should be noted that in step S1 of the present invention, the original COG data specifically refers to the original cloud optimized remote sensing image (Cloud optimized GeoTiff, COG) data. For the COG pyramid, a tile can be uniquely determined by the triple (z, x, y), where z represents the zoom level. As the map is zoomed in, the number of corresponding tiles increases, and the content becomes more detailed. x represents the position of the tile in the horizontal direction (longitude) of the map, and the value increases from left to right; y represents the position of the tile in the vertical direction (latitude) of the map, and the value increases from top to bottom, and the range of both is usually 0 to 2. z , as z increases, x and y will also double. Since there are thumbnails of different resolutions in the COG pyramid, thumbnails can be used to replace some pyramid levels, thereby reducing the number of pyramid levels.

[0055] It should be noted that in step S1 of the present invention, according to the earth's circumference of 40076 kilometers and the spatial resolution of the original COG data m meters / pixel, the following equation is constructed to calculate the maximum effective level z of the COG pyramid: max :

[0056]

[0057] It should be noted that in step S1 of the present invention, a standard pyramid with a resolution magnification of 2 times between adjacent levels (i.e., the number of tiles in the x and y directions doubles for every increase in the z level) is used as a reference pyramid, so that the subsequent COG pyramid can achieve a similar smooth scaling effect. Then, the hierarchical structure of the COG pyramid is designed. Specifically, the trapezoidal block structure at the bottom of the COG pyramid is generated from the original COG data, which is equivalent to the reference pyramid (z max -n) to z max Layers, where n is the number of thumbnail layers in the original COG data, and the resolution ratio between thumbnail levels is 2. The upper layer of the COG pyramid is equivalent to the 0 to (z max -n-1) layers. The number of trapezoidal block structures in the upper layer of the COG pyramid is It means rounding up. Each trapezoidal block structure in the COG pyramid corresponds to the n+1 layer in the reference pyramid.

[0058] It should be noted that in step S1 of the present invention, the specific process of designing the row and column structure of each level of the COG pyramid tile is as follows: when the original COG data is a satellite remote sensing image data with a grid number and overlaps (such as Landsat8 remote sensing image, etc.), the row and column structure of the reference pyramid is used as the row and column structure of each level of the tile. Specifically, for the bottom trapezoidal block structure of the COG pyramid, the original COG data corresponding to the minimum level (z max -n) as the mapping matching object. In addition, if the original COG data and the row and column structures of each level of tiles are difficult to match, you can consider appropriately increasing the corresponding reference pyramid level, such as (z max -n+1). The upper layer of the COG pyramid also determines the number of rows and columns, and determines the resolution of tiles at each level of the resampled COG pyramid based on the tile size of the reference pyramid and the number of thumbnail layers of the original COG data. When the original COG data is a remote sensing image derivative product data converted to the WGS84 geographic coordinate system and divided into longitude and latitude frames (such as ESA's 2021 global land cover data, etc.), the row and column structure of tiles at each level of the COG pyramid is preset to keep the ratio of the number of rows and columns of the COG pyramid consistent with its bottom-level trapezoidal block structure, and the resolution of the remaining trapezoidal block structures of the COG pyramid is the same as the original COG data. For example, the bottom layer of the COG pyramid reuses the existing divided COG, such as setting it to 120×60. The upper layer adjusts the number of rows and columns while ensuring smooth scaling, and keeps the ratio of the number of rows and columns consistent with the bottom layer. The resolution of the resampled COG is the same as the original COG data.

[0059] S2. Process the original COG data according to the thumbnail hierarchy of the original COG data, generate the underlying data of the remaining trapezoidal block structures and the thumbnails of each level from the processed COG data, obtain the constructed COG pyramid, and store the processed COG data into a COG file, and save the COG file and its path, the data range of the original COG data set, and the row and column structure of tiles at each level of the COG pyramid into the index file of the COG pyramid.

[0060] It should be noted that, in step S2, the specific process of processing the original COG data is as follows:

[0061] 1) For the trapezoidal block structure at the bottom layer of the COG pyramid, a data processing strategy based on mapping matching is used for data processing: when the original COG data is satellite remote sensing image data, the grid number of the satellite remote sensing image data itself is traversed, and the satellite remote sensing image data on each grid number constitutes a tiled image set. At the bottom layer of the COG pyramid, each pyramid tile is traversed, and the overlapping part of each pyramid tile and each satellite remote sensing image data in the image set is used as the intersection degree judgment area. The ratio between each intersection degree judgment area and the area of ​​the corresponding satellite remote sensing image data bounding box is calculated and the ratio calculation result is used as the intersection degree index. If the intersection degree index is greater than the preset intersection degree threshold, the corresponding pyramid tile number and the satellite remote sensing image data path are saved in the form of key-value pairs; when the original COG data is remote sensing image derivative product data, the latitude and longitude range of the original COG data is divided into several longitude and latitude intervals, each longitude and latitude interval corresponds to a pyramid tile number, and the pyramid tile number and the original COG data are saved in the form of key-value pairs.

[0062] In this embodiment, the intersection index ranges from 0 to 1, so the intersection threshold is set to 0.8. The selection of the threshold here is only a preferred method, and other thresholds matching the data can also be selected by those skilled in the art according to actual needs, so there is no limitation.

[0063] 2) For the remaining trapezoidal block structures of the COG pyramid, first resample the bottom data of the bottom trapezoidal block structure, and use the resampled bottom data as the bottom data of the trapezoidal block structure adjacent to the bottom trapezoidal block structure, then resample the thumbnails of each level of the bottom trapezoidal block structure, and use the resampled thumbnails of each level as the thumbnails of each level of the trapezoidal block structure adjacent to the bottom trapezoidal block structure. The COG pyramid is processed from bottom to top, and the bottom data and thumbnails of each level of the remaining trapezoidal block structures are generated by resampling the previous adjacent trapezoidal block structure, and finally a constructed COG pyramid is obtained, as shown in FIG. Figure 2As shown, the remote sensing image data path generated during the resampling process and the pyramid tile number used to generate the remote sensing image data are saved in the form of key-value pairs.

[0064] In this embodiment, for the remaining trapezoidal block structures of the COG pyramid, the data in the bottom trapezoidal block structure needs to be resampled. Because of the close relationship between the upper and lower levels of the COG pyramid structure, when resampling, only k×k pieces of the original COG data of the lower layer need to be read, where k is the scaling factor between the pyramid levels.

[0065] S3. According to the window range of the client page and the current zoom level of the client page, the pyramid tile number to be displayed is obtained and displayed on the client page, and the COG file is parsed to obtain the COG file path corresponding to the pyramid tile number to be displayed.

[0066] It should be noted that, in step S3, the specific process of obtaining the pyramid tile number to be displayed is:

[0067] S31. Obtain the bounding box of the COG pyramid range, the number of pixel columns of the COG pyramid tile, and the maximum number of tiles in the longitude direction of each level of the COG pyramid to calculate the spatial resolution of each level of the COG pyramid;

[0068] When the current zoom level is the i-th layer of the COG pyramid, the spatial resolution of the i-th layer of the COG pyramid is calculated as follows:

[0069]

[0070] Where: extent[0], extent[1] represent the minimum longitude and minimum latitude of the bounding box of the COG pyramid range respectively; tile_size represents the number of pixel columns of the COG pyramid tile, which is usually 256 pixels in map services; z i_column Indicates the maximum number of tiles in the longitude direction of the i-th layer of the COG pyramid. The relationship between it and the current zoom level is generally z i_column =2 i .

[0071] S32. Obtain the spatial resolution of the current window provided by the client, traverse each level of the COG pyramid, calculate the resolution difference between the spatial resolution of each level of the COG pyramid and the spatial resolution of the current window, and use the COG pyramid level with the smallest spatial resolution difference as the current zoom level.

[0072] In this embodiment, the client can obtain the spatial resolution of the current window with the help of the software library of the client that implements the map service. The client application map service generally uses different libraries, but each library has the function of providing the current window range. Therefore, the present invention does not limit which specific library is used to implement the resolution calculation, so it will not be repeated.

[0073] S33. After determining the current zoom level, obtain the number of pyramid tile rows and columns corresponding to the current zoom level from the index file, and calculate the minimum pyramid tile number x of the bounding box of the window range in the longitude direction. min and the maximum pyramid tile number x max and the minimum pyramid tile number y in the latitude direction min and the maximum pyramid tile number y max :

[0074] x min =Math.floor((bbox[0]-extent[0]) / x tile_range )

[0075] y min =Math.floor((bbox[1]-extent[1]) / y tile_range )

[0076] x max =Math.ceil((bbox[2]-extent[0]) / x tile_range )-1

[0077] y max =Math.ceil((bbox[3]-extent[1]) / y tile_range )-1

[0078] Where: bbox[0], bbox[1], bbox[2], bbox[3] represent the minimum longitude, minimum latitude, maximum longitude and maximum latitude of the bounding box of the window range respectively; extent[0], extent[1] represent the minimum longitude and minimum latitude of the bounding box of the COG pyramid range respectively; x tile_range Indicates the span of each pyramid tile in the longitude direction; y tile_range Indicates the span of each pyramid tile in the latitude direction; Math.floor indicates rounding down; Math.ceil indicates rounding up.

[0079] S34. The minimum pyramid tile number and the maximum pyramid tile number in the longitude direction constitute the pyramid tile interval in the longitude direction, and the minimum pyramid tile number and the maximum pyramid tile number in the latitude direction constitute the pyramid tile interval in the latitude direction. All pyramid tiles are looped through in the longitude direction pyramid tile interval and the latitude direction pyramid tile interval and used as pyramid tiles to be displayed. Finally, the pyramid tile numbers to be displayed are returned in the form of an array and displayed on the client page.

[0080] S4. Using the pyramid tile number to be displayed as the key in the index file, searching for the corresponding COG file path step by step, loading the processed COG data and sending it to the client page, and displaying the finally generated raster layer on the client page.

[0081] It should be noted that, in this embodiment, the processed COG data is stored in the object storage software (such as MinIO), and the client sends two HTTP GET Range request data to the object storage software. After being processed by the client page, the remote sensing image of the current window range of the client is uniformly presented in the window. This process is a common practice in this field, so its implementation details will not be repeated.

[0082] In order to better demonstrate the specific implementation and technical effects of the present invention, the raster layer service method for customized online computing and rendering shown in steps S1 to S4 in the above preferred implementation is applied to a specific example.

[0083] Example

[0084] The specific implementation process of the raster layer service method for customized online computing and rendering used in this embodiment is as described above and will not be repeated here. Figure 3 As shown, the main steps in the process of building a COG pyramid are introduced below.

[0085] Step 1: Calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, and design the pyramid level structure and the tile row and column structure within each level in combination with the number of COG thumbnail layers and the image framing method.

[0086] Step 2: Create an index JSON file for the COG pyramid and record information such as the data range and the number of rows and columns at each level in the file.

[0087] Step 3: Process the original COG data by layer. For the bottom layer data, a data processing strategy based on mapping matching is adopted; for the upper layer data, the data needs to be resampled.

[0088] At the same time, in the actual code implementation process, for the original COG data as input, only its thumbnail needs to be read, not the entire image. With the help of open source raster data processing libraries such as Rasterio, the code is written to generate the downsampled COG data, and its path is written back to the above JSON index file to facilitate reading when sampling the upper layer data. The structure of the COG pyramid index JSON file is as follows:

[0089]

[0090] Step 4: Use the open source JavaScript library OpenLayers to develop online web map services. Use JavaScript code to read and parse the JSON file, and use the TileGrid class to create a custom pyramid structure. During the visualization process, the map will calculate the tile triples through an algorithm based on the window range and the spatial resolution of the current zoom level, and then obtain the corresponding COG path from the above index JSON file and load it to achieve autonomous scheduling of cross-images. At the same time, in order to deal with the same COG file path that may exist in the underlying mapping, repeated data requests can be avoided by adding a cache. Using the Expressions provided by OpenLayers, you can get the specified band through a simple type definition ['band', bandIndex] when reading COG, participate in expression operations, and implement custom rendering, such as the calculation of the commonly used remote sensing index NDVI (normalized vegetation index) and NDWI (normalized water index), and visualize the results according to the specified color band.

[0091] Figure 5 and Figure 6 They are the local RGB and NDVI band calculation and color band rendering effect diagrams of the Sentinel-2 remote sensing image map service. The dataset selected is the public Sentinel-2 COG image dataset, which is processed by Python language to form a COG pyramid and stored in the locally deployed object storage MinIO. In terms of map services, the client uses OpenLayers to implement RGB rendering, NDVI band calculation and color band rendering, and can obtain longitude and latitude and band reflectance values ​​in real time according to the mouse position.

[0092] It should also be noted that the raster layer service method for customized online computing and rendering in the above embodiment can essentially be executed by a computer program or module. Therefore, similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a raster layer service system for customized online computing and rendering corresponding to the raster layer service method for customized online computing and rendering provided in the above embodiment, such as Figure 4 As shown, it includes:

[0093] A structure design module is used to obtain an original COG data set composed of original COG data, calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, form the bottom-level trapezoidal block structure from the bottom to the top of the bottom data of the original COG data and the thumbnails corresponding to each level, and form the rest of the trapezoidal block structures from their own bottom-level data and thumbnails from the bottom to the top. A plurality of trapezoidal block structures are stacked to form a COG pyramid hierarchical structure, and the row and column structure of each level of the COG pyramid is designed in combination with the framing method of the original COG data;

[0094] A storage module is used to process the original COG data according to the thumbnail hierarchy of the original COG data, generate the bottom layer data of the remaining trapezoidal block structures and the thumbnails of each level from the processed COG data, obtain the constructed COG pyramid, store the processed COG data into a COG file, and save the COG file and its path, the data range of the original COG data set, and the row and column structure of the tiles of each level of the COG pyramid into the index file of the COG pyramid;

[0095] A display module, used for obtaining the pyramid tile number to be displayed according to the window range of the client page and the current zoom level of the client page and displaying it on the client page, and parsing the COG file to obtain the COG file path corresponding to the pyramid tile number to be displayed;

[0096] The result generation module is used to use the pyramid tile number to be displayed as the key in the index file, search for the corresponding COG file path level by level, load the processed COG data and send it to the client page, and display the final generated raster layer on the client page.

[0097] Similarly, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer electronic device corresponding to the raster layer service method for customized online computing and rendering provided in the above embodiment, which includes a memory and a processor;

[0098] The memory is used to store computer programs;

[0099] The processor is used to implement the raster layer service method for customized online computing and rendering in the above embodiment when executing the computer program.

[0100] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention.

[0101] Therefore, based on the same inventive concept, another preferred embodiment of the present invention also provides a computer-readable storage medium corresponding to the raster layer service method for customized online computing and rendering provided in the above embodiment, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the raster layer service method for customized online computing and rendering in the above embodiment can be implemented.

[0102] It is understandable that the above storage medium may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage. The storage medium may also be a U disk, a mobile hard disk, a magnetic disk or an optical disk, etc., which can store program codes.

[0103] It is understandable that the above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0104] It should also be noted that those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working process of the system described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here. In the various embodiments provided in this application, the division of steps or modules in the system and method is only a logical function division, and there may be other division methods in actual implementation, such as multiple modules or steps can be combined or integrated together, and a module or step can also be split.

[0105] The above-described embodiment is only a preferred solution of the present invention, but it is not intended to limit the present invention. A person skilled in the relevant technical field may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims

1. A raster layer service method for custom online computing and rendering, characterized in that: The following steps are involved: S1. Obtain an original COG data set consisting of original COG data, calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, form the bottom-level trapezoidal block structure from bottom to top with the bottom-level data of the original COG data and the thumbnails corresponding to each level, and form the rest of the trapezoidal block structures from their own bottom-level data and thumbnails from bottom to top. Multiple trapezoidal block structures are stacked to form a COG pyramid hierarchical structure, and the row and column structure of each level of the COG pyramid is designed in combination with the framing method of the original COG data; S2. Process the original COG data according to the thumbnail hierarchy of the original COG data, generate the underlying data of the remaining trapezoidal block structures and the thumbnails of each level from the processed COG data, obtain the constructed COG pyramid, and store the processed COG data into a COG file, and save the COG file and its path, the data range of the original COG data set, and the row and column structure of the tiles of each level of the COG pyramid into the index file of the COG pyramid; S3. Obtain the pyramid tile number to be displayed according to the window range of the client page and the current zoom level of the client page and display it on the client page, and parse the COG file to obtain the COG file path corresponding to the pyramid tile number to be displayed; S4. Using the pyramid tile number to be displayed as the key in the index file, searching for the corresponding COG file path step by step, loading the processed COG data and sending it to the client page, and displaying the finally generated raster layer on the client page.

2. The raster layer service method for customized online computing and rendering according to claim 1, characterized in that: In step S1, the maximum effective level z of the COG pyramid is calculated max The specific method is: Where m represents the spatial resolution of the original COG data, in meters per pixel.

3. The raster layer service method for customized online computing and rendering according to claim 1, characterized in that: In step S1, the specific process of designing the row and column structure of each level of the COG pyramid is as follows: when the original COG data is satellite remote sensing image data with a grid number and overlap, the row and column structure of the reference pyramid is used as the row and column structure of each level of the tiles, and the reference pyramid is a standard pyramid with a resolution magnification of 2 times between adjacent levels; when the original COG data is remote sensing image derivative product data converted in the WGS84 geographic coordinate system and divided according to longitude and latitude, the row and column structure of each level of the COG pyramid is preset, and the ratio of the number of rows and columns of the COG pyramid is kept consistent with the trapezoidal block structure of its bottom layer, and the resolution of the remaining trapezoidal block structures of the COG pyramid is the same as that of the original COG data.

4. The raster layer service method for customized online computing and rendering according to claim 3, characterized in that: In step S2, for the trapezoidal block structure at the bottom layer of the COG pyramid, the original COG data is processed by a data processing strategy based on mapping matching. The specific process is as follows: when the original COG data is satellite remote sensing image data, the grid number of the satellite remote sensing image data itself is traversed, and a tiled image set is formed by the satellite remote sensing image data on each grid number. Each pyramid tile is traversed at the bottom layer of the COG pyramid, and the overlapping part of each pyramid tile and each satellite remote sensing image data in the image set is used as an intersection degree judgment area. The ratio between each intersection degree judgment area and the area of ​​the corresponding satellite remote sensing image data bounding box is calculated and the ratio calculation result is used as an intersection degree index. If the intersection degree index is greater than a preset intersection degree threshold, the corresponding pyramid tile number and the satellite remote sensing image data path are saved in the form of a key-value pair; when the original COG data is remote sensing image derivative product data, the longitude and latitude range of the original COG data is divided into a number of longitude and latitude intervals, each longitude and latitude interval corresponds to a pyramid tile number, and the pyramid tile number and the original COG data are saved in the form of a key-value pair.

5. The raster layer service method for customized online computing and rendering according to claim 4, characterized in that: In step S2, the intersection degree threshold is set to 0.

8.

6. The raster layer service method for customized online computing and rendering according to claim 3, characterized in that: In step S2, for the remaining trapezoidal block structures of the COG pyramid, the specific process of processing the original COG data is: first, the bottom data of the bottom-most trapezoidal block structure is resampled, and the resampled bottom data is used as the bottom data of the trapezoidal block structure adjacent to the bottom-most trapezoidal block structure, and then the thumbnails of each level of the bottom-most trapezoidal block structure are resampled, and the resampled thumbnails of each level are used as thumbnails of each level of the trapezoidal block structure adjacent to the bottom-most trapezoidal block structure, and the COG pyramid is processed in order from bottom to top, and the bottom data and thumbnails of each level of the remaining trapezoidal block structures are generated by resampling the previous adjacent trapezoidal block structures, and finally a constructed COG pyramid is obtained, and the remote sensing image data path generated in the resampling process and the pyramid tile number used to generate the remote sensing image data are saved in the form of key-value pairs.

7. The raster layer service method for customized online computing and rendering according to claim 1, characterized in that: In step S3, the specific process of obtaining the pyramid tile number to be displayed is: S31. Obtain the bounding box of the COG pyramid range, the number of pixel columns of the COG pyramid tile, and the maximum number of tiles in the longitude direction of each level of the COG pyramid to calculate the spatial resolution of each level of the COG pyramid; When the current zoom level is the i-th layer of the COG pyramid, the spatial resolution of the i-th layer of the COG pyramid is calculated as follows: Where: extent[0], extent[1] represent the minimum longitude and minimum latitude of the bounding box of the COG pyramid range respectively; tile_size represents the number of pixel columns of the COG pyramid tile; z i_column Indicates the maximum number of tiles in the longitude direction of the i-th layer of the COG pyramid; S32. Obtain the spatial resolution of the current window provided by the client, traverse each level of the COG pyramid, calculate the resolution difference between the spatial resolution of each level of the COG pyramid and the spatial resolution of the current window, and use the COG pyramid level with the smallest spatial resolution difference as the current zoom level; S33. After determining the current zoom level, obtain the number of pyramid tile rows and columns corresponding to the current zoom level from the index file, and calculate the minimum pyramid tile number x of the bounding box of the window range in the longitude direction. min and the maximum pyramid tile number x max and the minimum pyramid tile number y in the latitude direction min and the maximum pyramid tile number y max : x min =Math.floor((bbox[0]-extent[0]) / x tile_range ) y min =Math.floor((bbox[1]-extent[1]) / y tile_range ) x max =Math.ceil((bbox[2]-extent[0]) / x tile_range )-1 y max =Math.ceil((bbox[3]-extent[1]) / y tile_range )-1 Where: bbox[0], bbox[1], bbox[2], bbox[3] represent the minimum longitude, minimum latitude, maximum longitude and maximum latitude of the bounding box of the window range respectively; x tile_range Indicates the span of each pyramid tile in the longitude direction; y tile_range Indicates the span of each pyramid tile in the latitude direction; Math.floor indicates rounding down; Math.ceil indicates rounding up; S34. The minimum pyramid tile number and the maximum pyramid tile number in the longitude direction constitute the pyramid tile interval in the longitude direction, and the minimum pyramid tile number and the maximum pyramid tile number in the latitude direction constitute the pyramid tile interval in the latitude direction. All pyramid tiles are looped through in the longitude direction pyramid tile interval and the latitude direction pyramid tile interval and used as pyramid tiles to be displayed. Finally, the pyramid tile numbers to be displayed are returned in the form of an array and displayed on the client page.

8. A raster layer service system for customized online computing and rendering, characterized in that: include: A structure design module is used to obtain an original COG data set composed of original COG data, calculate the maximum effective level of the COG pyramid according to the spatial resolution of the original COG data, form the bottom-level trapezoidal block structure from the bottom to the top of the bottom data of the original COG data and the thumbnails corresponding to each level, and form the rest of the trapezoidal block structures from their own bottom-level data and thumbnails from the bottom to the top. A plurality of trapezoidal block structures are stacked to form a COG pyramid hierarchical structure, and the row and column structure of each level of the COG pyramid is designed in combination with the framing method of the original COG data; A storage module is used to process the original COG data according to the thumbnail hierarchy of the original COG data, generate the bottom layer data of the remaining trapezoidal block structures and the thumbnails of each level from the processed COG data, obtain the constructed COG pyramid, store the processed COG data into a COG file, and save the COG file and its path, the data range of the original COG data set, and the row and column structure of the tiles of each level of the COG pyramid into the index file of the COG pyramid; A display module, used for acquiring the pyramid tile number to be displayed according to the window range of the client page and the current zoom level of the client page and displaying it on the client page, and parsing the COG file to obtain the COG file path corresponding to the pyramid tile number to be displayed; The result generation module is used to use the pyramid tile number to be displayed as the key in the index file, search for the corresponding COG file path level by level, load the processed COG data and send it to the client page, and display the final generated raster layer on the client page.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the raster layer service method for customized online computing and rendering according to any one of claims 1 to 7 is implemented.

10. A computer electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is used to implement the raster layer service method for customized online computing and rendering as described in any one of claims 1 to 7 when executing the computer program.

Citation Information

Cited By

  • Selectron-based super-large scale raster image file dynamic rendering method

    CN120525778A

  • An electron-based method for dynamic rendering of very large raster image files

    CN120525778B

  • Scanning sequence sensing pyramid interruptible construction and memory closed-loop release method and application thereof

    CN122066571A

  • Method for interrupting construction of scanning order perception pyramid and memory closed loop release and application thereof

    CN122066571B