Calculation method for fitting to hexagonal grid based on raster data
Through the calculation method of fitting GIS raster data to hexagonal grids, spatial analysis and statistical methods are used to determine the spatial relationship between hexagons and raster data, which solves the problem of low fitting efficiency in the existing technology. The effect of fast fitting and efficient fusion is achieved.
Patent Information
- Application Number
- CN202410728492.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-09-20
AI Technical Summary
In the existing technology, the efficiency of fitting GIS raster data to hexagonal grids is low, the manual fitting process is long, and fast fitting cannot be achieved.
A calculation method based on fitting raster data to a hexagonal grid is adopted, including a data reading and analysis module, a spatial data analysis module and an attribute data statistics module. The hexagonal and raster data are judged through spatial analysis and statistical methods. spatial relationship, calculate hexagonal attribute values, and generate hexagonal network patch data with specific meanings.
It improves the fitting efficiency of raster data and hexagonal network, realizes fast and efficient fusion of data, shortens the generation time of hexagonal grid model, and improves the efficiency and accuracy of the model.
Smart Images

Figure CN118673167A
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of military map systems, and in particular to a calculation method based on fitting grid data to a hexagonal grid. Background Art
[0002] Raster data is a data format that divides space into regular grids, each grid is called a unit, and each unit is assigned a corresponding attribute value to represent an entity. The position of each unit (pixel) is defined by its row and column number, and the entity position represented is implicit in the grid row and column position. Each data in the data organization represents the non-geometric attribute of the object or phenomenon or a pointer to its attribute. An excellent compressed data encoding scheme is to perform the maximum compression on the basis of minimizing the computer operation time.
[0003] Figuratively speaking, fitting is to connect a series of points on a plane with a smooth curve. Because there are countless possibilities for this curve, there are various fitting methods. The fitted curve can generally be represented by a function, and different fitting names are given according to the different functions.
[0004] In the past, the efficiency of fitting hexagonal grids for GIS raster data was low and the fitting process was long. In the storage process of GIS raster data, both encoding compression efficiency and reading speed were taken into consideration. This method optimizes the existing compression method and focuses on the reading efficiency and data traversal efficiency of raster data, as shown in the following table.
[0005] GIS raster data This method raster data Compression high Low Reading efficiency Low high Traversal efficiency Low high Space occupied Small big
[0006] At present, there is no method to fit automatic grid data to a hexagonal network. The manual fitting process mainly judges whether it is fitted based on the spatial relationship. It has the disadvantages of slow speed, low efficiency, and the need to process too many hexagonal grids, and cannot achieve fast fitting. Therefore, we propose a calculation method based on fitting grid data to hexagonal grids. Summary of the invention
[0007] 1. Technical issues to be solved
[0008] In view of the deficiencies of the prior art, the present invention provides a calculation method based on fitting raster data to a hexagonal grid, which solves the technical problem of manually fitting raster data.
[0009] (II) Technical solution
[0010] To achieve the above objectives, the present invention is implemented through the following technical solutions:
[0011] A computational method based on fitting grid data to a hexagonal grid, comprising:
[0012] Data reading and parsing module, spatial data analysis module, attribute data statistics module, and hexagonal pattern generation module;
[0013] The data reading and parsing module mainly uses GDAL to read various GIS raster data formats, such as TIF, IMG and other format data, such as various raster data digital elevation models, lake surface data, landform data, surface coverage data, etc.;
[0014] The spatial data analysis module mainly uses spatial analysis methods such as spatial query, spatial intersection, spatial clipping, geostatistics, and attribute query;
[0015] The attribute data statistics module mainly continues to calculate and generate hexagonal attribute data through statistical methods such as counting, mean, extreme value, and median.
[0016] The grid data is fitted to the hexagonal grid through spatial analysis, spatial statistics and other methods. Spatial analysis is to determine the spatial relationship between the six points of the hexagonal grid and each cell of the grid data during the fitting process. During the determination process, it is necessary to determine the inclusion relationship between the points and the polygons. If more than two points are included, it means that the proportion is at least 50%, which is an inclusion relationship. Otherwise, it is determined as a spatial non-inclusion relationship.
[0017] Spatial statistics is the process of calculating and generating hexagonal attribute data through counting, mean, extreme value, median and other statistical methods in the process of counting raster data. Count is the number of raster cells included in the statistical calculation; mean is the average value of the cell values included; extreme value is the maximum or minimum value of the hexagonal grid data included; median is to sort the hexagonal grid values included and calculate the middle value; raster data mainly includes surface digital elevation data (DEM) data, global lake raster data, global landform data, global land cover data and other GIS data;
[0018] The process of fitting raster data to hexagonal grids involves spatial analysis, spatial statistics and other methods for data calculation in the fitting process; such as spatial query, spatial intersection, spatial clipping, geostatistics, attribute query and other methods.
[0019] A calculation method based on fitting grid data to a hexagonal grid, the specific steps are as follows:
[0020] Step 1: Obtain GIS raster data, determine the geographic space area contained in the raster data, perform hexagonal grid network modeling on the geographic space area, and generate a hexagonal grid network in the data area;
[0021] Step 2: Convert the hexagonal spatial coordinate information into grid coordinate row and column information;
[0022] Step 3: Extract grid index information that intersects with the hexagon and is contained in the hexagon based on row and column information;
[0023] Step 4: Determine the hexagon attribute value by statistical counting, mean and extreme value according to the data index, so as to give the hexagon a specific meaning;
[0024] Step 5: Generate hexagonal network patch data with specific meanings.
[0025] Preferably, step 3.1: determining the geographic spatial relationship between the grid cells and the hexagon in the rectangular area,
[0026] If the grid cell and the hexagon are in a containment relationship, then the inclusion is determined.
[0027] If the grid cell and the hexagon are in an intersecting relationship, then it is judged to be contained.
[0028] If the grid cell is separated from the hexagon, it is judged as not contained.
[0029] Preferably, step 3.2: extracting index data of feature values according to the relationship between the grid unit and the hexagonal geographic space
[0030] (III) Beneficial effects
[0031] The calculation method for fitting raster data to hexagonal grid mainly solves the function of automatically fitting GIS raster data to hexagonal network; in step 1, raster data is read and a hexagonal grid system is constructed. In this process, the strategy of exchanging space for time is used to optimize the data reading and traversal efficiency, construct a hexagonal grid system in the current area, and improve the hexagon generation efficiency; in step 2, raster data and hexagons are fitted. In the fitting process, the hexagonal grid coordinates are converted into row and column numbers of raster data to facilitate the counting of the number of hexagonal vertices in the current raster pixel in step 3, so as to facilitate the estimation of fitting rules and generate feature codes in step 4, thereby improving the fitting efficiency. The spatial relationship between hexagons and raster grids is designed as the basis for fitting. In the fitting process, the statistical calculation standards such as proportion, mean and extreme value are used to calculate the attribute values of hexagons, and then the hexagons are given specific meanings; thereby realizing the rapid fitting of raster and hexagonal network and the efficient fusion of data. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention and implement it according to the contents of the specification, the following is a detailed description of the preferred embodiments of the present invention in conjunction with the accompanying drawings.
[0033] Figure 1A schematic diagram of the structure of a calculation method based on fitting grid data to a hexagonal grid according to the present invention;
[0034] Figure 2 Hexagonal grid maps generated for global surface elevation data;
[0035] Figure 3 A hexagonal grid diagram generated by a calculation method for fitting grid data to a hexagonal grid according to the present invention;
[0036] Figure 4 The present invention is a display effect diagram based on the superposition of raster digital elevation data and hexagonal grid data;
[0037] Figure 5 The present invention discloses a hexagonal elevation hexagonal network data superposition display effect diagram formed by fitting hexagons based on raster data and digital elevation data. DETAILED DESCRIPTION
[0038] The embodiment of the present application solves the problem of manually fitting raster data in the prior art by providing a calculation method based on fitting raster data to a hexagonal grid. Based on the method of fitting raster data to a hexagonal grid, hexagons are fitted to generate hexagonal network data with specific pattern attribute information. The method realizes the fitting of raster data to a hexagonal grid, shortens the generation time of the hexagonal grid model, and improves the efficiency and accuracy of the model.
[0039] Example 1
[0040] like Figure 1 As shown, the technical solution in the embodiment of the present application is to solve the above-mentioned problem of manually fitting raster data, and the overall idea is as follows:
[0041] A computational method based on fitting grid data to a hexagonal grid, comprising:
[0042] Data reading and parsing module, spatial data analysis module, attribute data statistics module, and hexagonal pattern generation module;
[0043] The data reading and parsing module mainly uses GDAL to read various GIS raster data formats, such as TIF, IMG and other format data, such as various raster data digital elevation models, lake surface data, landform data, surface coverage data, etc.;
[0044] The spatial data analysis module mainly uses spatial analysis methods such as spatial query, spatial intersection, spatial clipping, geostatistics, and attribute query;
[0045] The attribute data statistics module mainly continues to calculate and generate hexagonal attribute data through statistical methods such as counting, mean, extreme value, and median.
[0046] The grid data is fitted to the hexagonal grid through spatial analysis, spatial statistics and other methods. Spatial analysis is to determine the spatial relationship between the six points of the hexagonal grid and each cell of the grid data during the fitting process. During the determination process, it is necessary to determine the inclusion relationship between the points and the polygons. If more than two points are included, it means that the proportion is at least 50%, which is an inclusion relationship. Otherwise, it is determined as a spatial non-inclusion relationship.
[0047] Spatial statistics is the process of calculating and generating hexagonal attribute data through counting, mean, extreme value, median and other statistical methods in the process of counting raster data. Count is the number of raster cells included in the statistical calculation; mean is the average value of the cell values included; extreme value is the maximum or minimum value of the hexagonal grid data included; median is to sort the hexagonal grid values included and calculate the middle value; raster data mainly includes surface digital elevation data (DEM) data, global lake raster data, global landform data, global land cover data and other GIS data;
[0048] The process of fitting raster data to hexagonal grids involves spatial analysis, spatial statistics and other methods for data calculation in the fitting process; such as spatial query, spatial intersection, spatial clipping, geostatistics, attribute query and other methods.
[0049] In view of the problems existing in the prior art, the present invention provides a calculation method based on fitting grid data to a hexagonal grid, and the specific steps are as follows:
[0050] Step 1: Obtain GIS raster data, determine the geographic space area contained in the raster data, perform hexagonal grid network modeling on the geographic space area, and generate a hexagonal grid network in the data area;
[0051] Step 2: Convert the hexagonal spatial coordinate information into grid coordinate row and column information;
[0052] Step 3: Extract grid index information that intersects with the hexagon and is contained in the hexagon based on row and column information;
[0053] Step 4: Determine the hexagon attribute value by statistical counting, mean and extreme value according to the data index, so as to give the hexagon a specific meaning;
[0054] Step 5: Generate hexagonal network patch data with specific meanings.
[0055] Example 2
[0056] Based on Example 1, the present application embodiment is to solve the above-mentioned problem of manually fitting raster data. The overall idea is as follows:
[0057] Step 1: Obtain GIS raster data, determine the geographic space area contained in the raster data, perform hexagonal grid network modeling on the geographic space area, and generate a hexagonal grid network in the data area;
[0058] Step 2: Calculate the minimum circumscribed rectangle of the hexagon based on the spatial coordinate information of the hexagon;
[0059] Step 3: Calculate the extreme value of the row and column number based on the bounding rectangle, and calculate the grid cells contained in the minimum bounding rectangle based on the extreme value;
[0060] Step 4: Statistically determine the hexagon attribute value by counting, averaging, and extreme values based on the data index, so as to give the hexagon a specific meaning and achieve data fitting between the grid data and the hexagon;
[0061] Step 5: Generate hexagonal network patch data with specific meanings.
[0062] Step 3.1: Determine the geographic spatial relationship between the grid cells and the hexagons in the rectangular area.
[0063] If the grid cell and the hexagon are in a containment relationship, then the inclusion is determined.
[0064] If the grid cell and the hexagon are in an intersecting relationship, then it is judged to be contained.
[0065] If the grid cell is separated from the hexagon, it is judged as not contained.
[0066] The geographic spatial relationship between the grid cell and the hexagon in the rectangular area is determined. If the grid cell and the hexagon are in a containment relationship, then it is determined to be contained. If the grid cell and the hexagon are in an intersection relationship, then it is determined to be contained. If the grid cell and the hexagon are in a separation relationship, then it is determined not to be contained.
[0067] Step 3.2: Extract the index data of the feature value based on the relationship between the grid cell and the hexagonal geographic space.
[0068] Figure 2 It is the global surface elevation data, used to describe the global terrain height data. Figure 3 This is a hexagonal grid system diagram with an edge distance of 1000 meters. The white lines are the hexagonal edges. Figure 4 Contents Figure 2 and Figure 3 In the schematic diagram displayed by overlay in the drawing software, the higher the elevation of the white area, the lower the elevation of the black area; Figure 5 For the general Figure 2 and Figure 3 The data are fitted (i.e. Figure 4 ) statistics, which is a hexagonal grid patch data with elevation information.
[0069] Beneficial effect: The calculation method for fitting raster data to hexagonal grid mainly solves the function of realizing automatic fitting of GIS raster data to hexagonal network; in step 1, raster data is read and a hexagonal grid system is constructed. In this process, the strategy of exchanging space for time is used to optimize the data reading traversal efficiency, construct a hexagonal grid system in the current area, and improve the hexagon generation efficiency; in step 2, raster data and hexagons are fitted. In the fitting process, the hexagonal grid coordinates are converted into row and column numbers of raster data to facilitate the counting of the number of hexagonal vertices in the current raster pixel in step 3 to facilitate the estimation of fitting rules in step 4 to generate feature codes, thereby improving the fitting efficiency. The spatial relationship between hexagons and raster grids is designed as the basis for fitting. In the fitting process, statistical calculation standards such as proportion, mean and extreme value are used to calculate the attribute values of hexagons, and then the hexagons are given specific meanings; thereby realizing rapid fitting of raster and hexagonal networks and efficient data fusion.
[0070] Finally, it should be noted that: Obviously, the above embodiments are only examples for clearly explaining the present invention, and are not intended to limit the implementation methods. For ordinary technicians in the relevant field, other different forms of changes or modifications can be made based on the above description. It is not necessary and impossible to list all the implementation methods here. The obvious changes or modifications derived from this are still within the scope of protection of the present invention.
Claims
1. A calculation method based on fitting grid data to a hexagonal grid, characterized in that: Data reading and parsing module, spatial data analysis module, attribute data statistics module, and hexagonal pattern generation module; The data reading and parsing module uses GDAL to read various GIS raster data formats; The spatial data analysis module uses spatial query, spatial intersection, spatial clipping, geostatistics, and attribute query spatial analysis methods; The attribute data statistics module continues to calculate and generate hexagonal attribute data through counting, mean, extreme value, and median statistics.
2. The calculation method based on fitting grid data to a hexagonal grid as claimed in claim 1, wherein the specific steps are as follows: Step 1: Obtain GIS raster data, determine the geographic space area contained in the raster data, perform hexagonal grid network modeling on the geographic space area, and generate a hexagonal grid network in the data area; Step 2: Convert the hexagonal spatial coordinate information into grid coordinate row and column information; Step 3: Extract grid index information that intersects with the hexagon and is contained in the hexagon based on row and column information; Step 4: Statistically count, average and extreme value are used to determine the hexagon attribute value according to the data index, so as to give the hexagon a specific meaning; Step 5: Generate hexagonal network patch data with specific meanings.
3. A calculation method based on fitting grid data to a hexagonal grid as claimed in claim 2, characterized in that: Step 3.1: determining the geographic spatial relationship between the grid cells and the hexagons within the rectangular area, If the grid cell and the hexagon are in a containment relationship, then the inclusion is determined. If the grid cell and the hexagon are in an intersecting relationship, then it is judged to be contained. If the grid cell is separated from the hexagon, it is judged as not contained.
4. A calculation method based on fitting grid data to a hexagonal grid as claimed in claim 3, characterized in that: The step 3.2: extracting the index data of the feature value according to the relationship between the grid unit and the hexagonal geographic space.
5. The calculation method based on fitting grid data to a hexagonal grid as claimed in claim 1, characterized in that: The data reading and parsing modules include TIF, IMG format data, various raster data digital elevation models, lake surface data, landform data, and surface coverage data.
6. A calculation method based on fitting grid data to a hexagonal grid as claimed in claim 5, characterized in that: The data reading and parsing module performs statistics through spatial analysis and spatial statistics to achieve grid data fitting to a hexagonal grid. Spatial analysis is to determine the spatial relationship between the six points of the hexagonal grid and each cell of the grid data during the fitting process. During the determination process, it is necessary to determine the inclusion relationship between the points and the polygons. If more than two points are included, it means that the proportion is at least 50%, which is an inclusion relationship. Otherwise, it is determined as a spatial non-inclusion relationship.
7. A calculation method based on fitting grid data to a hexagonal grid as claimed in claim 6, characterized in that: In the process of statistical raster data, the raster data mainly includes surface digital elevation data (DEM) data, global lake raster data, global landform data, and global surface coverage data GIS data.
8. A calculation method based on fitting grid data to a hexagonal grid as claimed in claim 6, characterized in that: The spatial statistics is a process of calculating and generating hexagonal attribute data by counting, mean, extreme value, and median statistics in the process of counting raster data, where the count is the number of raster cells included in the statistical calculation.
9. A calculation method based on fitting grid data to a hexagonal grid as claimed in claim 8, characterized in that: The mean is the average value of the cell values included in the data calculation; The extreme value is the maximum or minimum value of the hexagonal grid data. The median is to sort the values of the hexagonal grid and calculate the middle value; Raster data mainly include surface digital elevation data (DEM) data, global lake raster data, global landform data, global land cover data and other GIS data. The process of fitting raster data to hexagonal grid involves spatial analysis and spatial statistical methods for data calculation in the fitting process.
