A method and medium for intelligent calculation and processing of outliers in raster spatial data
By obtaining the outlier area range and correction amount, buffer cropping and vector grid conversion are performed, and raster data of outlier area is accurately identified and processed, which solves the problem of inaccurate processing in the prior art and realizes efficient outlier processing.
Patent Information
- Application Number
- CN202411606666.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-11-12
AI Technical Summary
The prior art is difficult to accurately identify and process the raster range corresponding to the outlier area in the raster data, especially when the outlier area boundaries are irregular or linear, resulting in inaccurate processing results.
By obtaining the outlier area range and correction amount, create a buffer to crop the original raster, calculate the unique value of each raster pixel, convert it into a vector grid, identify the intersecting vector grid, and convert it into accurate raster data according to the correction amount, perform raster operations to correct outliers.
It improves the accuracy of outlier processing in irregular geometric boundary areas, improves the efficiency of processing large-scale and multi-plaque outlier areas, and solves the problem of merging grids with the same numerical values in the existing methods.
Smart Images

Figure CN119151835B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and medium for intelligent calculation and processing of grid space data abnormal values, and belongs to the field of geographic space data processing. Background Art
[0002] Raster data is a commonly used spatial data representation in geographic information systems (GIS), mainly used to describe continuously changing phenomena. It consists of regularly arranged pixels (grid cells), each pixel has a value corresponding to its position, and is used to represent a specific feature or attribute in a geographic area. Raster data types are widely used in geographic information systems (GIS), remote sensing, environmental monitoring and other fields, such as altitude, temperature, humidity, etc.
[0003] Due to its uniqueness, raster data has the following characteristics when storing information: 1. The data is intuitive. Each pixel has a clear numerical value to represent the geographic feature. 2. The structure is simple. When performing mathematical calculations at the pixel level, various spatial analysis operations (such as filtering, classification, reclassification, convolution, algebraic operations, etc.) can be directly applied to raster data. 3. The format is standard, and common formats (such as GeoTIFF, ASCII, NetCDF, etc.) are supported by various GIS software and remote sensing processing tools. 4. Convenient storage. Remote sensing data is usually stored in the form of rasters, which can cover a very large geographical range and can process different types of geographic information in layers. It can be used for multi-band analysis, time series analysis and classification applications, which is convenient for monitoring and evaluation of large-scale surface changes.
[0004] Although raster data has many advantages, there are limitations when processing and handling data. Raster data is composed of regular grids (pixels), each pixel has a fixed size and shape (usually a square), which makes it difficult to express precise boundaries, irregular shapes and linear features, especially when dealing with linear features or small and slender objects (such as narrow rivers, islands, buildings, etc.). The spatial resolution of raster data is often not enough to accurately capture these details. Especially in scenarios with large amounts of data and high precision requirements, the numerical process of directly editing a single pixel or local area is cumbersome, and it is difficult to carry out manual processing of massive raster data (such as remote sensing images or high-resolution DEMs). In addition, existing software and methods have defects when performing spatial analysis of vector data and raster data. It is difficult to accurately identify the raster range corresponding to the vector range with a small area and complex boundaries, resulting in the inability to accurately complete operations such as raster clipping. Summary of the invention
[0005] The present invention proposes a method and medium for intelligent calculation and processing of outliers in raster spatial data. For outliers existing in raster data, the raster range corresponding to the outlier region is accurately identified, and the outlier recognition and processing is realized by raster data calculation. The method proposed by the present invention can accurately read the outlier region range and correction amount, and quickly process outlier data in batches.
[0006] In a first aspect, an embodiment provides a method for intelligently calculating and processing outliers of raster spatial data, including:
[0007] Obtaining an outlier region range and a corresponding outlier correction amount of a region object, wherein the outlier region range is saved as a planar vector element, and the outlier correction amount is saved in the form of positive and negative numbers;
[0008] A buffer is created according to the surface vector elements in the outlier area, and according to the buffer, the original grid is clipped to obtain the corresponding first grid data, and the number of rows and columns of the first grid data is obtained, and according to the number of rows and columns, a unique value is calculated for each grid pixel in the first grid data;
[0009] Generate second raster data according to the unique value of each first raster pixel, convert the second raster data into a vector grid, and obtain first vector grid data;
[0010] Superimposing the surface vector elements of the outlier region with the first vector grid data, identifying the intersecting vector grids, and obtaining the second vector grid data;
[0011] Converting the second vector grid data into third raster data according to the correction amount; the third raster data is a raster range that accurately corresponds to the abnormal value area;
[0012] The third raster data is subjected to raster operation with the original raster data to obtain pixel values after outlier correction.
[0013] In one embodiment, the outlier region range of the region object and the corresponding outlier correction amount are obtained, and the outlier region range is saved as a surface vector element.
[0014] In one embodiment, a buffer is created according to the planar vector elements of the outlier region, and the original grid is clipped according to the buffer to obtain the corresponding first grid data, and the number of rows and columns of the first grid data is obtained. According to the number of rows and columns, the unique value of each grid pixel in the first grid data is calculated, and the calculation formula is:
[0015]
[0016] in, is a unique value for each pixel in the first raster data, and are the number of rows and columns of the first grid data respectively.
[0017] In one embodiment, second raster data is generated according to a unique value of each raster pixel in the first raster data, and the second raster data is converted into a vector grid to obtain the first vector grid data.
[0018] In one embodiment, the surface vector elements of the outlier region are superimposed on the first vector grid data, and the intersecting vector grids are identified to obtain the second vector grid data. The calculation formula for the second vector grid data is:
[0019]
[0020] in, is the second vector grid data, is the surface vector element of the outlier area. is the first vector grid data, Represents a spatial intersection operation.
[0021] In one embodiment, the second vector grid data is converted into third raster data according to the correction amount; the third raster data is a raster range that accurately corresponds to the abnormal value area;
[0022] In one embodiment, the third grid data and the original grid data are subjected to grid operation to obtain pixel values after outlier correction. The calculation formula for the pixel values after outlier correction is:
[0023]
[0024] in, is the pixel value after outlier correction, is the original raster pixel value, is the pixel value of the third grid data; when the outlier correction amount is a positive number, If is a positive number, Decrease; when the outlier correction amount is negative, If is a negative number, Increase.
[0025] In a second aspect, an embodiment provides a computer-readable storage medium, in which a program is stored. The program can be loaded by a processor and execute the method for intelligent calculation and processing of outliers of raster spatial data described in any one of the above embodiments.
[0026] The beneficial effects of the present invention are:
[0027] The present invention proposes a method and medium for intelligent calculation and processing of outliers in raster spatial data, which improves the accuracy of outlier processing in irregular geometric boundary areas and improves the efficiency of processing large-scale, multi-patch outlier areas.
[0028] The present invention obtains the range of an outlier region and the corresponding outlier correction amount, creates surface elements in batches, and solves the problem of time-consuming and labor-intensive manual processing; establishes a surface element buffer according to a threshold value, clips the original grid in the buffer range, calculates the grid unique value, and converts it into a vector grid, and solves the problem of grid recognition error when the values of adjacent original grid pixels are the same; superimposes the outlier region surface element and the buffer vector grid, accurately identifies the vector grid corresponding to the outlier region, and converts the vector grid into raster data according to the correction amount, and solves the problem of incorrect raster clipping when the vector boundary is irregular in the existing method; uses raster operation to realize outlier processing, performs operation on the outlier region raster data and the original raster data, corrects the outliers in the original data, and improves the raster data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 It is a schematic diagram of processing outliers of raster spatial data in the prior art;
[0031] Figure 2 This is a schematic diagram of outlier processing of raster spatial data in one embodiment of the present application;
[0032] Figure 3 This is a flowchart of processing outliers in raster spatial data according to an embodiment of the present application; DETAILED DESCRIPTION
[0033] In order to make the purpose, technical scheme and advantages of the embodiment of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, not all of the embodiments. Therefore, the following detailed description of the embodiment of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but only represents the selected embodiment of the present application. Based on the embodiment of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application. In the following embodiments, many detailed descriptions are intended to enable the present application to be better understood. However, those skilled in the art can understand effortlessly that some of the features can be omitted in different situations, or can be replaced by other elements, materials, and methods. In some cases, some operations related to the present application are not shown or described in the specification, in order to avoid the core part of the present application being overwhelmed by too much description, and for those skilled in the art, it is not necessary to describe these related operations in detail, and they can fully understand the related operations according to the description in the specification and the general technical knowledge in the art.
[0034] In addition, the features, operations or characteristics described in the specification can be combined in any appropriate manner to form various implementations. At the same time, the steps or actions in the method description can also be interchanged or adjusted in a manner that is obvious to those skilled in the art. Therefore, the various sequences in the specification and the drawings are only for the purpose of clearly describing a certain embodiment and are not meant to be a required sequence, unless otherwise specified that a certain sequence must be followed.
[0035] The serial numbers assigned to the components in this article, such as "first", "second", etc., are only used to distinguish the objects described and do not have any order or technical meaning.
[0036] To facilitate the description of the inventive concept of the present application, the processing effects of the present invention are briefly described below.
[0037] Raster data is widely used in the field of geoscience data and is of great value in storing information such as altitude, temperature, water depth, and remote sensing image bands. However, it is relatively complicated to edit outliers in raster data. Given the uniqueness of the raster data storage format and the complexity of editing it, vector data is often introduced first in the data processing process to determine the scope of the area to be edited and the raster values, and then complex spatial calculations are performed to edit the raster values based on the spatial position of the vector data. Studies have shown that the current series of methods face challenges in carrying out DEM outlier processing, high-precision terrain correction, and river and lake depth correction. With the deepening of related research, there is an urgent need for an intelligent calculation and processing method for outliers in raster spatial data to quickly and efficiently solve the current problems.
[0038] The applicant found in the research that there are two main problems with the existing raster data outlier processing methods: 1) When the outlier area is small, the boundary is irregular or presents linear features, the existing vector and raster processing methods are difficult to accurately identify the raster corresponding to the outlier area. For easier understanding, please refer to Figure 1 , Figure 1 Figures a and b show the results obtained when using irregular boundary vectors to clip the grid in the existing method. The grid pixel coordinates corresponding to the outlier area are (2, 2), (2, 3), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (4, 4), (4, 5), (4, 6). For existing vector and raster processing methods, please refer to Figure 1 In the diagram b, only the grid pixels with coordinates (3, 4), (3, 5), and (4, 5) are identified. When the geometric boundary is irregular, or the geometric boundary covers a small area of the grid pixel when passing through it, using vectors to clip the grid will cause deviations in the clipping results, resulting in inaccurate processed data. 2) When the grid corresponding to the boundary of the outlier area has the same value as the adjacent grid outside the boundary, when converting the grid to a vector grid, the grids with the same value are merged into one grid. For easier understanding, please refer to Figure 1 For example, the pixels with coordinates (3, 3) and (4, 3) in Figure c, as well as the pixels with coordinates (2, 6) and (3, 6), have the same values for adjacent raster pixels in the raster data. When converting raster data to vector data, please refer to Figure 1 In the middle d figure, the vector data boundaries corresponding to the same numerical raster pixels will be merged. When determining the spatial relationship between the outlier area and the vector grid, please refer to Figure 1 Figure e in the middle shows that the identification range of the outlier area grid is expanded.
[0039] In view of this, this application provides a method and medium for intelligent calculation and processing of outliers in raster spatial data, which can overcome the defects of existing methods, accurately obtain outlier region raster data through outlier region surface elements, and use raster operations to realize outlier processing. Figure 2 In Figures a and b, buffers are created based on the area features of the outlier areas. For further information, please refer to Figure 2 In Figure c, the original grid is clipped according to the buffer, the first grid data is obtained, and the unique value is calculated according to the row and column numbers of the first grid data, and stored as the second grid data; the first vector grid data converted from the second grid data has clear boundaries between adjacent grids, and no grids with boundary fusion appear. For further information, please refer to Figure 2 In the figure d, the surface element of the outlier area is superimposed on the first vector grid data, and the second vector grid data intersecting with the outlier area is identified. For further information, please refer to Figure 2 In Figures e and d, the second vector grid is converted into third raster data according to the correction amount, the raster data of the outlier area is accurately obtained, and raster operations are performed on the third raster data and the original raster data to correct the outliers in the original data.
[0040] This application embodiment provides a method for intelligent calculation and processing of outliers in raster space data. Figure 3 , the steps include:
[0041] Step S10, obtaining the outlier region range of the region object and the corresponding outlier correction amount, wherein the outlier region range is saved as a planar vector element, and the outlier correction amount is saved in the form of positive and negative numbers.
[0042] In one embodiment, in order to improve processing efficiency and applicability, the acquired outlier region planar vector elements may include vector elements further created by measured regional node coordinates, or planar vector elements directly formed according to remote sensing image interpretation. These outlier regions have the characteristics of large data volume and complex pattern shapes.
[0043] Step S20, creating a buffer according to the surface vector elements in the outlier area, clipping the original grid according to the buffer to obtain the corresponding first grid data, and obtaining the number of rows and columns of the first grid data, and calculating the unique value of each grid pixel in the first grid data according to the number of rows and columns.
[0044] In one embodiment, the unique value calculation formula for each grid pixel in the first grid data is:
[0045]
[0046] in, is a unique value for each pixel in the first raster data, and are the number of rows and columns of the first grid data respectively.
[0047] Step S30, generating second raster data according to the unique value of each raster pixel in the first raster data, converting the second raster data into a vector grid to obtain first vector grid data. The value in the attribute table of the first vector grid data is the unique value of the second raster pixel, which is used to distinguish adjacent raster pixels with the same original raster value.
[0048] Step S40, superimposing the planar vector elements of the abnormal value region with the first vector grid data, identifying intersecting vector grids, and obtaining second vector grid data.
[0049] In one embodiment, the second vector grid data acquisition formula is:
[0050]
[0051] in, is the second vector grid data, is the surface vector element of the outlier area. is the first vector grid data, Represents a spatial intersection operation.
[0052] Step S50: convert the second vector grid data into third raster data according to the correction amount, wherein the third raster data is a raster range that exactly corresponds to the abnormal value region.
[0053] Step S60, performing a raster operation on the third raster data and the original raster data to obtain pixel values after outlier correction.
[0054] In one embodiment, the calculation formula for the pixel value after outlier correction is:
[0055]
[0056] in, is the pixel value after outlier correction, is the original raster pixel value, is the pixel value of the third grid data; when the outlier correction amount is a positive number, If is a positive number, Decrease; when the outlier correction amount is negative, If is a negative number, Increase.
[0057] In one embodiment of the present application, a computer-readable storage medium is provided, on which a program is stored. The stored program includes a method for intelligently calculating and processing outliers of raster spatial data in any of the above embodiments that can be loaded by a processor and processed.
[0058] Those skilled in the art will appreciate that all or part of the functions of the various methods in the above-mentioned embodiments can be implemented by hardware or by computer programs. When all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can be stored in a computer-readable storage medium, and the storage medium can include: read-only memory, random access memory, disk, optical disk, hard disk, etc., and the program is executed by a computer to implement the above-mentioned functions. For example, the program is stored in the memory of the device, and when the program in the memory is executed by the processor, all or part of the above-mentioned functions can be implemented. In addition, when all or part of the functions in the above-mentioned embodiments are implemented by computer programs, the program can also be stored in a storage medium such as a server, another computer, disk, optical disk, flash disk or mobile hard disk, and can be downloaded or copied and saved in the memory of the local device, or the system of the local device is updated, and when the program in the memory is executed by the processor, all or part of the functions in the above-mentioned embodiments can be implemented.
[0059] The above specific examples are used to illustrate the present invention, which is only used to help understand the present invention and is not intended to limit the present invention. For those skilled in the art, according to the concept of the present invention, some simple deductions, modifications or substitutions can be made.
Claims
1. A method for intelligent calculation and processing of outliers in raster space data, characterized in that: The method comprises: Obtaining an outlier region range and a corresponding outlier correction amount of a region object, wherein the outlier region range is saved as a planar vector element, and the outlier correction amount is saved in the form of positive and negative numbers; A buffer is created according to the surface vector elements in the outlier area, and according to the buffer, the original grid is clipped to obtain the corresponding first grid data, and the number of rows and columns of the first grid data is obtained, and the unique value of each grid pixel in the first grid data is calculated according to the number of rows and columns; Generate second raster data according to the unique value of each raster pixel in the first raster data, convert the second raster data into a vector grid, and obtain first vector grid data; Superimposing the surface vector elements of the outlier region with the first vector grid data, identifying the intersecting vector grids, and obtaining the second vector grid data; Converting the second vector grid data into third raster data according to the correction amount; the third raster data is a raster range that accurately corresponds to the abnormal value area; The third grid data is subjected to a grid subtraction operation with the original grid data to obtain pixel values after outlier correction.
2. The method for intelligent calculation and processing of outlier values of raster spatial data according to claim 1, characterized in that: Create a buffer based on the surface vector features in the outlier area. According to the buffer, clip the original grid to obtain the corresponding first grid data and the number of rows and columns of the first grid data. According to the number of rows and columns, calculate the unique value of each grid pixel in the first grid data. The formula is: Unique_value={1,2,3,…,rows*columns} Among them, Unique_value is the unique value of each grid pixel in the first grid data, and rows and columns are the number of rows and columns of the first grid data respectively.
3. The method for intelligent calculation and processing of outlier values of raster spatial data according to claim 1, characterized in that: The surface vector elements in the outlier area are superimposed on the first vector grid data, and the intersecting vector grids are identified to obtain the second vector grid data. The calculation formula for the second vector grid data is: Gird e =Area polygon ∩Grid buffer Among them, Gird e Is the second vector grid data, Area polygon It is the surface vector element of the outlier area. buffer is the first vector grid data, and ∩ represents a spatial intersection operation.
4. The method for intelligent calculation and processing of outlier values of raster spatial data according to claim 1, characterized in that: The third grid data is subtracted from the original grid data to obtain the pixel value after outlier correction. The calculation formula is: Value m =Value o -Value e Among them, Value m is the pixel value after outlier correction, Value o is the original raster pixel value, Value e is the pixel value of the third grid data; when the outlier correction amount is a positive number, Value e is a positive number, then Value m Decrease; when the outlier correction amount is negative, Value e If it is a negative number, then Value m Increase.
5. A computer-readable storage medium, characterized in that: The medium stores a program, which can be loaded by a processor and execute a method for intelligent calculation and processing of outlier values of raster spatial data as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Correction method for solving the deviation of layout graph from grid line
CN109001958A
ArcGIS-based three-dimensional stratum model construction and calculation method
CN117351165A