Global elevation map compression storage method, system, equipment and medium
By latitude division and Hafman coding compression of global elevation data, the problems of complex storage of elevation data and large index occupancy in the existing technology are solved, and efficient storage and compression are achieved, which is suitable for a variety of application scenarios.
Patent Information
- Application Number
- CN202510189003.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-20
- Publication Date
- 2025-06-10
AI Technical Summary
When storing and managing global elevation data, the directory structure is complex and the number of files is huge, so it cannot flexibly adapt to a variety of lightweight applications. When high-resolution global elevation information is stored, the index information occupies a large amount of storage space, affecting storage efficiency.
The global elevation map compression storage method is adopted to achieve efficient storage and compression by latitude division and Hafman encoding and compression of elevation data, multiple data blocks are formed and index information is established.
Without losing elevation information, it significantly saves storage space, simplifies the index structure, improves storage efficiency, and makes the data more suitable for different application scenarios.
Smart Images

Figure CN120123302A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic elevation data processing, and in particular, to a method, system, device and medium for compressing and storing a global elevation map. Background Art
[0002] With the development of space remote sensing technology, especially the SRTM (Shuttle Radar Topography Mission) mission, high-resolution DEM (Digital Elevation Model) data of most regions of the world has been generated through interferometric radar technology. The release of this data enables the public to obtain ultra-high-resolution DEM data for free. The DEM model data used to represent ground elevation is mainly divided into three categories: regular grid model (GRID), irregular triangular grid model (TIN), and digital contour model.
[0003] Currently, the digital terrain elevation database of some surveying and mapping institutions uses the DTED (Digital Terrain Elevation Data) format. It takes the area covered by 1 degree of longitude * 1 degree of latitude as the file unit and stores DEM data using a grid terrain model. Generally stored on a CD-ROM, a strict directory structure is used to sequentially store the terrain elevation data of different longitude and latitude regions. Overall, the directory structure is complex and the number of files is huge.
[0004] In addition, the DEM data generated by a certain surveying institution is organized into three logical records: TypeA, TypeB, and TypeC. Among them, TypeA defines the common features of the DEM, including the DEM name, regional boundary, measurement unit, height extreme value, projection parameters, etc. TypeB contains the elevation data of the terrain and its header information. There are as many TypeB records as there are data columns in a DEM file. TypeC contains the statistical information on data accuracy.
[0005] However, both of these two formats store large-scale terrain data in a way that coordinates with a directory file. The management is complex, and it is even less able to flexibly adapt to various lightweight application scenarios. Some other improved storage methods are all optimizing the directory and file layout, without improving the elevation storage file itself. The elevation storage file usually still adopts the storage method of raster images (TIFF\JPEG2000\EsriGrid\Mr Grid), arranging and storing elevations in the order of grids divided by the geospatial area. There are also some optimized geographic information systems that divide the grids according to different latitudes and longitudes according to the terrain characteristics, and then establish indexes for storing and reading elevation information. If it is high-resolution global elevation information, the divided file blocks are very large, and the index information will occupy a large amount of storage space and is not conducive to flexible use.
[0006] For example, Patent Publication No. CN103678657A discloses a method for storing and reading terrain elevation data, in which the steps of data compression processing are as follows: dividing the area included in each elevation file into a number of smaller longitudinally and laterally arranged plots according to latitude and longitude, and generating a compressed elevation file corresponding to each elevation file; the elevation file is obtained by dividing the area elevation data after map projection into several parts according to the longitude direction or the latitude direction. This method is mainly for local areas. Although it can be used for global elevation, it still needs to be divided according to local areas and indexes are established. Since it is indexed according to latitude and longitude, when applied to global elevation, the index will occupy a very large space and will not achieve a good compression effect.
[0007] Another example is that Patent Publication No. CN115830260A discloses a method, a server and a storage medium for processing elevation data based on terrain. By combining terrain types and terrain feature factors such as slope, aspect and elevation value to preprocess the data, and combining data compression methods such as wavelet transform and Huffman coding to ensure data continuity to achieve the maximum compression effect. It mainly performs wavelet transform on complex terrain data and then stores file information in the form of Huffman coding. It is aimed at complex terrain rather than single elevation.
[0008] For another example, patent publication number CN116309892A discloses a method for compressing elevation topographic maps, including: reading the longitude and latitude information and map height data in an existing.xyz elevation topographic map file; sorting, de-duplicating, and performing relevant calculations on the longitude and latitude information in sequence to obtain the starting longitude and latitude of the map, its direction sampling numbers, and the longitude and latitude differences between adjacent sampling points on the map, and writing them as header information into a new.dxt file; storing the map height data into a map height array according to its corresponding longitude and latitude and set rules, and writing them into the new.dxt file column by column to complete file compression. Starting from the mutual relationship between elevation data, it not only needs to store the information of the elevation itself, but also the mutual relationship information between elevations, as well as complex indexing and calculations, making it difficult to quickly and simply implement the compression of elevation topographic maps. Summary of the Invention
[0009] To solve the above problems, the present invention proposes a method, system, device, and medium for compressing and storing global elevation maps, which divides files by latitude and then performs Huffman coding compression. Compared with the traditional format method of storing original elevations in grid order, the present invention can better save storage space without losing elevation information, does not require complex indexing and prior information, and can be more conveniently transplanted to different application scenarios for flexible use.
[0010] The technical solution adopted by the present invention is as follows:
[0011] A method for compressing and storing global elevation maps, including:
[0012] Extracting the elevation information part from elevation raster data or elevation images to obtain global elevation data indexed by longitude and latitude coordinates;
[0013] Dividing the global elevation data into different strips according to latitude according to the geographical resolution of the elevation, forming multiple data blocks, and each data block contains different numbers of minimum resolution grids;
[0014] Establishing index information, that is, recording the mapping relationship between the data block numbers and longitude and latitude;
[0015] Performing variable-length coding on each data block according to the Huffman coding tree, thereby compressing the global elevation data into multiple data files, and the data files and their index files are the final storage files.
[0016] Further, the step of dividing the global elevation data into different strips according to latitude according to the geographical resolution of the elevation to form multiple data blocks includes: taking the equator as the axis of symmetry, dividing the northern and southern hemispheres into different latitude zones, thereby dividing the global elevation data into multiple data blocks; inside each data block, the elevation data is arranged in the order of first increasing longitude from small to large and then increasing latitude from small to large.
[0017] Furthermore, inside each data block, the side length of each grid is less than or equal to the resolution of the elevation map and is recorded sequentially, i.e., no indexing of the data is required.
[0018] Furthermore, establishing the index information, i.e., recording the mapping relationship between the data block number and the longitude and latitude, includes: for elevation maps with different resolutions, performing different latitude slicing. In principle, the actual arc lengths corresponding to the minimum longitude and latitude of equal division should be equal to or lower than the resolution of the elevation map.
[0019] A global elevation map compression storage system includes:
[0020] A global elevation data extraction module, configured to extract the elevation information part from elevation raster data or elevation images to obtain global elevation data indexed by longitude and latitude coordinates;
[0021] A geographical latitude division module, configured to divide the global elevation data into different strips according to latitude according to the geographical resolution of the elevation, forming multiple data blocks, and each data block contains different numbers of minimum resolution grids;
[0022] An index information establishment module, configured to record the mapping relationship between the data block number and the longitude and latitude;
[0023] A data encoding and storage module, configured to perform variable-length encoding on each data block according to the Huffman coding tree, thereby compressing the global elevation data into multiple data files, and the data files and their index files are the final storage files.
[0024] Furthermore, in the geographical latitude division module, dividing the global elevation data into different strips according to latitude according to the geographical resolution of the elevation to form multiple data blocks includes: taking the equator as the axis of symmetry, dividing the northern and southern hemispheres into different latitude zones, thereby dividing the global elevation data into multiple data blocks; inside each data block, the elevation data is arranged in the order of longitude from small to large first and then latitude from small to large.
[0025] Furthermore, inside each data block, the side length of each grid is less than or equal to the resolution of the elevation map and is recorded sequentially, i.e., no indexing of the data is required.
[0026] Furthermore, in the index information establishment module, recording the mapping relationship between the data block number and the longitude and latitude includes: for elevation maps with different resolutions, performing different latitude slicing. In principle, the actual arc lengths corresponding to the minimum longitude and latitude of equal division should be equal to or lower than the resolution of the elevation map.
[0027] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the above-mentioned method for compressing and storing a global elevation map is implemented.
[0028] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for compressing and storing a global elevation map is implemented.
[0029] The beneficial effects of the present invention are as follows:
[0030] 1. Compared with the traditional format method of storing original elevations in grid order, the present invention divides files by latitude and then performs Huffman coding compression. Without losing elevation information, it can better save storage space, does not require complex indexing and prior information, and can be more conveniently transplanted to different application scenarios for flexible use.
[0031] 2. Using the SRTM high-definition original data downloaded from the Internet, which covers the entire area from latitude -60 to +60, includes elevation original data with a resolution of 250m, and consists of 3 files with a total file size of 19.9GB. After compressing and storing using the method of the present invention, without changing the resolution, the total file size is 6.2GB, greatly saving storage space.
[0032] 3. The present invention has been applied to the artificial auxiliary analysis software of a certain positioning system for situation display and artificial auxiliary positioning. While ensuring accuracy, it significantly reduces the storage space occupied by the software. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 is a flowchart of a method for compressing and storing a global elevation map according to Embodiment 1 of the present invention.
[0034] Figure 2 is a schematic diagram of compressing and storing global elevation data according to Embodiment 1 of the present invention.
[0035] Figure 3 is a schematic diagram of global grid division according to Embodiment 1 of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0036] In order to have a clearer understanding of the technical features, objectives, and effects of the present invention, the specific embodiments of the present invention are now described. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention, that is, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts fall within the protection scope of the present invention.
[0037] Embodiment 1
[0038] This embodiment provides a method for compressing and storing a global elevation map, which can better save storage space without losing elevation information, does not require complex indexing and prior information, and can be more conveniently transplanted to different application scenarios for flexible use. The method for compressing and storing a global elevation map in this embodiment includes:
[0039] Extract the elevation information part from the elevation raster data or elevation image to obtain global elevation data indexed by longitude and latitude coordinates;
[0040] Divide the global elevation data into different strips according to latitude according to the geographical resolution of the elevation, forming multiple data blocks, and each data block contains different numbers of minimum resolution grids;
[0041] Establish index information, that is, record the mapping relationship between the data block number and longitude and latitude;
[0042] Perform variable-length coding on each data block according to the Huffman coding tree, so as to compress the global elevation data into multiple data files, and the data files and their index files are the final storage files.
[0043] Specifically, as Figure 1 shown, the method for compressing and storing a global elevation map in this embodiment can be implemented by the following steps:
[0044] 1. Global elevation data extraction.
[0045] Extract the elevation information part from the elevation raster data or elevation image to obtain the original elevation data indexed by longitude and latitude coordinates. This original data is a series of rasters as Figure 2 shown, and the elevation inside each raster is the same. Specifically, the elevation data resolution adopted in this embodiment is 250 meters.
[0046] 2. Geographical latitude division.
[0047] Divide the global elevation data into different strips according to latitude according to the geographical resolution of the elevation. Each strip contains different numbers of minimum resolution grids. The side length of the grid is less than or equal to the resolution of the elevation map and is recorded in sequence, so that no indexing of the data is required.
[0048] As Figure 3 shown, symmetric about the equator, the two sides are divided into different latitude zones, and the division of the strips is shown in Table 1:
[0049] Table 1 - Grid side length and longitude and latitude resolution
[0050]
[0051]
[0052] In this way, the original elevation data is divided into eight data blocks numbered from 0 to 7. Inside each data block, the elevation data is arranged in the order of longitude increasing from small to large first, and then latitude increasing from small to large.
[0053] 3. Establish index information.
[0054] Record the mapping relationship between the data block number and the longitude and latitude. The file index includes the information shown in Table 2:
[0055] Table 2 - Elevation Information Index Table
[0056] Serial number Lowest latitude Highest latitude Grid longitude (degrees) Grid latitude (degrees) 0 -90 -75 0.008027 0.002078 1 -75 -60 0.004156 0.002082 2 -60 -30 0.002404 0.002092 3 -30 0 0.002083 0.002098 4 0 30 0.002083 0.002098 5 30 60 0.002404 0.002092 6 60 75 0.004156 0.002082 7 75 90 0.008027 0.002078
[0057] As shown in Table 2, due to the uniform division, a data block includes all longitude position information of a section of latitude, and the longitude and latitude positions are stored in order according to the grid size, so the index is very short.
[0058] For elevation maps with different resolutions, different latitude slicing is required. In principle, the actual arc lengths corresponding to the minimum equally divided longitude and latitude should be equal to or lower than the resolution of the elevation map.
[0059] 4. Encode the original data.
[0060] Perform variable-length coding on each data block according to the Huffman coding tree. Since computer storage is in bytes, if the total coding length is less than 8 bits at the end, a part of the longest code can be used for padding. Finally, the global elevation data can be compressed and stored in 8 dat files numbered from 0 to 7.
[0061] 5. Data storage and reading.
[0062] The generated 8 dat files and the index file are the final storage files.
[0063] If reading is required, the file location where the elevation information belongs can be queried first according to the longitude and latitude information of the elevation to be read. For example, to find the elevation with longitude 121.1457 and latitude 24.1111, its belonging file numbered 4 can be queried through the index table first, and the file is decoded to form a longitude and latitude matrix and stored in memory, where the latitude is the row number and the longitude is the column number. Query the elevation at the 11493rd row and the 144574th column, i.e., round((24.1111 - 0) / 0.002098) = 11493 and round((121.1457 + 180) / 0.002083) = 144574.
[0064] As verification, in this embodiment, SRTM high-definition raw data downloaded from the Internet is adopted. It covers the entire area from latitude -60 to +60, includes elevation raw data with a resolution of 250m, contains 3 files, and the total size of the files is 19.9GB. After compression and storage using the method of this embodiment, on the premise of unchanged resolution, the total size of the files is 6.2GB, greatly saving storage space.
[0065] In addition, the method of this embodiment has been applied to the manual-assisted analysis software of a certain positioning system for situation display and manual-assisted positioning. While ensuring accuracy, it significantly reduces the storage space occupied by the software.
[0066] Embodiment 2
[0067] This embodiment provides a global elevation map compression and storage system, including:
[0068] A global elevation data extraction module, configured to extract the elevation information part from elevation raster data or elevation images to obtain global elevation data indexed by longitude and latitude coordinates;
[0069] A geographical latitude division module, configured to divide the global elevation data into different strips according to latitude according to the geographical resolution of the elevation, forming multiple data blocks, and each data block contains different numbers of minimum resolution grids;
[0070] An index information establishment module, configured to record the mapping relationship between the data block numbers and longitude and latitude;
[0071] A data encoding and storage module, configured to perform variable-length encoding on each data block according to the Huffman coding tree, thereby compressing the global elevation data into multiple data files, and the data files and their index files are the final storage files.
[0072] Preferably, in the geographical latitude division module, the global elevation data is divided into different strips according to latitude according to the geographical resolution of the elevation, forming multiple data blocks, including: taking the equator as the axis of symmetry, dividing the northern and southern hemispheres into different latitude zones, thereby dividing the global elevation data into multiple data blocks; inside each data block, the elevation data is arranged in the order of first longitude from small to large and then latitude from small to large.
[0073] Preferably, inside each data block, the side length of each grid is less than or equal to the resolution of the elevation map and is recorded in sequence, that is, no indexing of the data is required.
[0074] Preferably, in the index information establishing module, the mapping relationship between the data block serial number and the longitude and latitude is recorded, including: for elevation maps with different resolutions, different latitude slicing is performed. In principle, the actual arc lengths corresponding to the minimum longitude and latitude of equal division should be equal to or lower than the resolution of the elevation map.
[0075] Embodiment 3
[0076] This embodiment is based on Embodiment 1:
[0077] This embodiment provides a computer device, including a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the global elevation map compression storage method of Embodiment 1 is implemented. Among them, the computer program can be in the form of source code, object code, executable file, or some intermediate form, etc.
[0078] Embodiment 4
[0079] This embodiment is based on Embodiment 1:
[0080] This embodiment provides a computer-readable storage medium, storing a computer program, and when the computer program is executed by a processor, the global elevation map compression storage method of Embodiment 1 is implemented. Among them, the computer program can be in the form of source code, object code, executable file, or some intermediate form, etc. The storage medium includes: any entity or device capable of carrying computer program code, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, and software distribution medium, etc. It should be noted that the content included in the storage medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the storage medium does not include electrical carrier signals and telecommunication signals.
[0081] It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations. However, those skilled in the art should know that this application is not limited by the described action sequence, because according to this application, some steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
Claims
1. A method for compressing and storing a global elevation map, characterized in that: include: Extract the elevation information part of the elevation raster data or elevation image to obtain the global elevation data indexed by longitude and latitude coordinates; According to the geographic resolution of the elevation, the global elevation data is divided into different strips according to latitude to form multiple data blocks, each of which contains a different number of minimum resolution grids; Establish index information, that is, record the mapping relationship between data block serial number and longitude and latitude; Each data block is subjected to variable-length coding according to the Huffman coding tree, thereby compressing the global elevation data into multiple data files, and the data files and their index files are the final storage files.
2. A method for compressing and storing a global elevation map according to claim 1, characterized in that: The global elevation data is divided into different strips according to the latitude according to the geographic resolution of the elevation to form multiple data blocks, including: taking the equator as the axis of symmetry, dividing the northern and southern hemispheres into different latitude bands, thereby dividing the global elevation data into multiple data blocks; within each data block, the elevation data is arranged in the order of longitude from small to large, and then latitude from small to large.
3. A method for compressing and storing a global elevation map according to claim 1, characterized in that: Within each data block, the side length of each grid is less than or equal to the resolution of the elevation map and is recorded sequentially, that is, no indexing of the data is required.
4. A method for compressing and storing a global elevation map according to claim 1, characterized in that: The establishment of index information, i.e. recording the mapping relationship between data block serial number and longitude and latitude, includes: for elevation maps of different resolutions, different latitude slicing is performed. In principle, the actual arc length corresponding to the minimum longitude and latitude of equal division should be equal to or lower than the resolution of the elevation map.
5. A global elevation map compression storage system, characterized in that: include: The global elevation data extraction module is configured to extract the elevation information portion of the elevation raster data or the elevation image to obtain the global elevation data indexed by the latitude and longitude coordinates; The geographic latitude division module is configured to divide the global elevation data into different strips according to the latitude according to the geographic resolution of the elevation, forming multiple data blocks, each of which contains a different number of minimum resolution grids; An index information establishment module is configured to record the mapping relationship between the data block sequence number and the longitude and latitude; The data encoding and storage module is configured to perform variable-length encoding on each data block according to the Huffman coding tree, thereby compressing the global elevation data into multiple data files, and the data files and their index files are the final storage files.
6. A global elevation map compression storage system according to claim 5, characterized in that: In the geographic latitude division module, the global elevation data is divided into different strips according to the latitude according to the geographic resolution of the elevation to form multiple data blocks, including: taking the equator as the axis of symmetry, dividing the northern and southern hemispheres into different latitude bands, thereby dividing the global elevation data into multiple data blocks; within each data block, the elevation data is arranged in the order of longitude from small to large, and then latitude from small to large.
7. A global elevation map compression storage system according to claim 5, characterized in that: Within each data block, the side length of each grid is less than or equal to the resolution of the elevation map and is recorded sequentially, that is, no indexing of the data is required.
8. A global elevation map compression storage system according to claim 5, characterized in that: In the index information establishment module, the mapping relationship between the data block serial number and the longitude and latitude is recorded, including: for elevation maps with different resolutions, different latitude slices are performed. In principle, the actual arc length corresponding to the minimum longitude and latitude of equal division should be equal to or lower than the resolution of the elevation map.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the global elevation map compression storage method according to any one of claims 1 to 4 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the global elevation map compression storage method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Method for storing and reading altitude data of terrain
CN103678657A
Elevation data processing method based on terrain, server and storage medium
CN115830260A
Method for compressing elevation topographic map
CN116309892A