A method for completing spatial data attributes
By acquiring the internal points and proximity relationships of spatial data, and combining rasterization and heap sorting algorithms, spatial data attribute completion is performed step by step. This solves the problem of low data completion efficiency caused by regional characteristics in existing technologies, and achieves fast, accurate data completion and automated processing.
Patent Information
- Application Number
- CN202310662430.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-06
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2043-06-06
AI Technical Summary
Existing methods for completing missing values in spatial data attributes are inefficient when considering regional characteristics and require a large amount of manpower and resources to label training samples, making it difficult to achieve data completion quickly and accurately.
By acquiring internal points of spatial data from the current and previous periods, and utilizing spatial correlation and proximity relationships, combined with geographic information data processing technology, and employing rasterization and heap sorting algorithms, data completion is performed step by step. This includes directly inheriting overlapping data attributes and completing non-overlapping data through proximity relationships, and finally merging the results.
It enables fast and accurate spatial data attribute completion, lowers the user entry threshold, provides automated data completion methods, ensures data integrity and accuracy, and is suitable for situations where multiple periods of data are missing.
Smart Images

Figure CN116821607B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of spatial data processing, and in particular to a spatial data attribute completion method. BACKGROUND
[0002] Data missing is a common problem in various research fields. Due to the uncertainty of many factors, this phenomenon is difficult to avoid in real life. At the same time, the quality of basic data determines whether the research results are accurate or not. In order to provide accurate basic data for scientific research, it is of great theoretical and practical significance to carry out analysis and research on data missing values. For many years, the method of data missing value completion has always been a popular research direction for scholars. In 2021, Xu Wenquan extracted the spatial characteristics of the road network and the time characteristics of the traffic data by mining the traffic data, and also captured the correlation information between different types of data, effectively recovered the missing data, and provided effective data integrity support for the application based on traffic data in the intelligent transportation system. In 2022, Yang Zhe compared and analyzed the GAN-TRTI model and the mean filling method, KNN filling method, missing forest filling method and other methods through experiments. The experiment shows that the GAN-TRTI model has better filling performance. In 2023, Zhou Chao et al. proposed a method for highway traffic flow data missing completion based on self-supervised learning. This method uses a time series model based on attention mechanism (Seq2Seq-Att); then uses self-supervised learning to train the model; finally, taking 80 toll stations of the Guangdong highway network as an example, the reliability of the method is verified. At present, the data completion method commonly uses machine learning method, which needs a large number of training samples. The sample marking in the early stage needs to consume a lot of manpower and material resources. The sample determines the precision and applicability of the model.
[0003] At present, the missing values of spatial data are mainly completed after analyzing the spatial correlation, temporal correlation and spatio-temporal correlation. Most scholars use the method of considering time and space correlation at the same time, so as to improve the data completion effect. For example, the patent application with publication number CN114330146A discloses a satellite gas data completion method and system, and the patent application with publication number CN114756727A discloses a data completion model, a data completion method, a device and a medium. The training machine learning model is used for data completion. However, the completion of spatial data attribute missing values usually has strong regional characteristics, such as lithology, soil type, soil index, etc. The position and distribution of adjacent elements need to be considered. In view of the fact that adjacent spatial data has the same or similar spatial characteristics, a spatial data attribute completion method is needed to overcome the shortcomings of the prior art. SUMMARY
[0004] The main object of the present application is to provide a spatial data attribute completion method, aiming at solving the above technical problems.
[0005] To achieve the above object, the present application provides a spatial data attribute completion method, comprising the following steps:
[0006] S1, data preparation: the data includes the current spatial data and the last period spatial data in long time series spatial data, wherein the current data is the data to be completed;
[0007] S2, obtaining the internal points of the current spatial data: calculating the size of each element raster unit in the current spatial data, rasterizing its elements, counting the number of each element rasterization unit, calculating the median of the number of raster units, extracting the median raster unit, and converting the center point position to a point element as the internal point of the current element;
[0008] S3, spatial correlation: the internal points of the current spatial data obtained in step S2 are spatially correlated with the last period spatial data, and the records with spatial position overlap are recorded as 1, and the records without spatial position overlap are recorded as 0; for the internal points with spatial position overlap, the attribute values of the last period spatial data are directly inherited, the attribute value completion of the internal points with spatial position overlap is completed, the internal point attribute is hung to the current spatial data, and the first data completion result is obtained; for the internal points without spatial position overlap, the element node set and the identification code in the current spatial data and the last period spatial data are read respectively, the number N of adjacent last period elements that the current element needs to refer to is set, the minimum distance value between the current element and each element of the last period is calculated by using the distance formula and the traversal method, the first N records are retained by ascending order sorting, the traversal step is cycled to obtain the adjacent last period element set of the current element, the attribute table of the current element and the last period element is hung respectively, the record rows with inconsistent categories are deleted, and the remaining records are checked and completed to obtain the second data completion result;
[0009] S4, merging the completion results: merging the first data completion result and the second data completion result obtained in step S3 to obtain the final spatial data attribute completion result.
[0010] Preferably, in step S2, when calculating the size of each element raster unit in the current spatial data, the size of each element rasterization unit is calculated separately, and the size of the raster unit is calculated by the following formula:
[0011] CellSize=INT((sqr(TBMJ)-1) / 2),
[0012] Wherein: TBMJ is the area of the element;
[0013] In step S2, after the data is rasterized, the frequency of the raster cell identification code is counted, and when there is a frequency that is inconsistent with the total number of elements in the current period, the rasterized elements are screened out, the raster cell size is adjusted, the adjustment number is half of the original raster cell size, and rasterization is performed again to obtain the raster data in the current period.
[0014] Preferably, in step S2, when rasterizing, the vector data is rasterized by using a scan line seed point filling algorithm, including the following steps:
[0015] S201, a seed point Seed(x, y) is selected and stored in the stack;
[0016] S202, if the stack is empty, the algorithm ends, otherwise step S203 is executed;
[0017] S203, the pixel to be filled is taken out from the stack, and all pixels to be filled connected to the pixel on the same scan line are filled, and the leftmost position Xleft and the rightmost position Xright of the filled pixels are recorded;
[0018] S204, the previous and next rows of step S203 are scanned in the range of Xleft≤x≤Xright, and whether all are boundary points or filled points is investigated, if not, the rightmost position of each segment to be filled is taken as a new seed point and stored in the stack;
[0019] S205, return to step S202.
[0020] Preferably, in step S2, when calculating the median of the number of raster cells, each raster is taken as a unit, and the center of each raster cell is vectorized into a point element, and after each raster cell is vectorized, one point is formed, and the calculation formula is as follows:
[0021] x=x0+(J-0.5)*D x
[0022] y=y0+(I-0.5)*D y
[0023] Wherein: x0, y0 is the coordinate of the upper left corner, D x , D y is the length of the two sides of the raster cell.
[0024] Preferably, in step S2, when obtaining the points inside the elements in the current period, the rasterization cells of each element are self-increment coded, the median of the number of raster cells inside the elements is calculated according to the formula Median=INT((Frequency / 2)+0.5), and the points inside the elements are extracted, wherein Frequency is the number of raster cells of each element after being rasterized in the current period.
[0025] Preferably, in step S3, for the internal points without spatial position overlap, the current period re-completion data and the last period data profile point coordinates are read respectively, the records including the feature ID and X, Y coordinates are recorded, and the records are as follows:
[0026] R = {ID, (x1, y1), (x2, y2), …, (xn, yn)}; S = {1, (x1, y1), (x2, y2), …, (xn, yn); 2, (x1, y1), (x2, y2), …, (xn, yn); …; K, (x1, y1), (x2, y2), …, (xn, yn)}; F = {1, (x1, y1), (x2, y2), …, (xn, yn); 2, (x1, y1), (x2, y2), …, (xn, yn); …; W, (x1, y1), (x2, y2), …, (xn, yn)}. n n
[0027] S a = {1, (x1, y1), (x2, y2), …, (xn, yn); 2, (x1, y1), (x2, y2), …, (xn, yn); …; K, (x1, y1), (x2, y2), …, (xn, yn)}. n n n n n n
[0028] F a = {1, (x1, y1), (x2, y2), …, (xn, yn); 2, (x1, y1), (x2, y2), …, (xn, yn); …; W, (x1, y1), (x2, y2), …, (xn, yn)}. n n n n n n
[0029] In the formula, R is the record form of each feature, ID is the feature identification code, n is the number of feature nodes, S a and F a are respectively associated with the current period completion data and the last period data with record 0, K and W are respectively the number of features in the two periods.
[0030] Preferably, in step S3, when ascending order sorting is performed, the following steps are included:
[0031] S301, create an initial to-be-sorted sequence (R1, R2…Rn) as a large top heap, which is an initial unordered heap;
[0032] S302, exchange the heap top element R[1] with the last element R[n] to obtain a new unordered area (R1, R2, …Rn-1) and an ordered area (Rn), and satisfy R[1,2…n-1]<=R[n];
[0033] S303, the new stack top R[1] after the exchange may violate the properties of the stack, so the current unordered area (R1, R2,..., Rn-1) needs to be adjusted to a new stack, and then R[1] is exchanged with the last element of the unordered area to obtain a new unordered area (R1, R2,..., Rn-2) and an ordered area (Rn-1, Rn), and the process is repeated until the number of elements in the ordered area is n-1, and then the entire sorting process is completed.
[0034] Thanks to the above technical solutions, the application has the following advantages:
[0035] (1) According to the missing situation of the time series spatial data, combined with the distribution of the adjacent spatial data, the application adopts the geographic information data processing and analysis technology, inputs the current data (i.e. the data to be completed) and the last period data, and according to the spatial position overlap of the two periods of data, the spatial data attribute initial completion work is quickly realized. Then, the analysis of the to-be-completed data without spatial position overlap is carried out according to the adjacent relationship with the last period data, the number of adjacent reference last period elements is set, the spatial position adjacent correlation table is generated, the completion content is determined after analysis and verification, and finally the final completed data is generated, thereby providing accurate data support for spatial data management and analysis and application.
[0036] (2) In the application, under the condition that the spatial objects adjacent to each other have the same or similar attribute characteristics, different completion methods are adopted according to the situation and step by step to complete the data, and finally the completed data is obtained, thereby forming a spatial data attribute completion method, which is beneficial to realize the automatic completion of the spatial data attribute content and reduce the user entry threshold. The method can quickly realize the automatic completion of the attribute of the vector point, line and surface element, and provide accurate and complete data support for spatial data management and analysis application.
[0037] (3) The method considers the topological relationship between the spatial data and provides a setting interface for the number of adjacent elements, thereby forming a spatial data attribute completion method, obtaining accurate and complete data sets, and making the completion result more in line with the actual situation. It is also applicable in the case of missing multiple period data. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description only some embodiments of the application, and for those skilled in the art, other drawings can be obtained without creative labor based on the drawings shown.
[0039] Figure 1 The flowchart of the spatial data attribute completion method provided by the application;
[0040] Figure 2The operation interface schematic diagram of the spatial data attribute completion method provided by the present application;
[0041] Figure 3 The last period spatial data prepared in step S1 of the present application;
[0042] Figure 4 The attribute missing condition of the current period spatial data in the present application;
[0043] Figure 5 The element rasterization example of the current period spatial data in the present application;
[0044] Figure 6 The rasterization unit center point example obtained in the present application;
[0045] Figure 7 The current period element internal point example in the present application;
[0046] Figure 8 The raster operation example in the present application;
[0047] Figure 9 The first data completion result example in the present application;
[0048] Figure 10 The spatial position non-overlapping data position schematic diagram in the present application;
[0049] Figure 11 The second data completion result example in the present application;
[0050] Figure 12 The merging result example of the first data completion result and the second data completion result in the present application. DETAILED DESCRIPTION
[0051] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all the other embodiments obtained by those skilled in the art without creative work are within the protection scope of the present application.
[0052] Through collecting and analyzing the fixed period update content of spatial data, it is found that the spatial data update includes type, outline and thematic information update. Usually, the fixed period update only updates the spatial data, and does not update the attribute data. The attribute data update needs to be updated and completed according to the last period update result and the field surrounding neighbor condition of the changed element.
[0053] When the spatial data is updated annually, only the basic information of the current period is usually updated, and the rest of the thematic information is supplemented and improved on the basis of the thematic data of the previous period. The spatial data attribute completion method provided in the embodiment can inherit the thematic data of the previous period when the current spatial data and the elements of the previous spatial data have a spatial overlapping relationship, but when there are new elements in the current period, i.e., no spatial overlapping, the thematic information of the new elements needs to be completed by referring to the surrounding situation of the elements of the previous period and the present situation.
[0054] Specifically, as shown in Figure 1 、 Figure 2 , a spatial data attribute completion method includes the following steps:
[0055] S1, data preparation.
[0056] The data to be prepared includes the current spatial data and the previous spatial data in the long-time sequence spatial data, wherein the current data is the data to be completed. The current spatial data has 9795 records, and the previous spatial data has 9196 records. Both the current spatial data and the previous spatial data are SHP format vector data. The previous spatial data is as shown in Figure 3 , and the attribute missing situation of the current spatial data is as shown in Figure 4 . The thematic information missing in the data to be completed includes natural region code (ZRQDM), soil layer thickness (TCHD), soil texture (TRZD), soil organic matter content (TRYJZHL), soil PH value (TRPHZ), biodiversity (SWDYX), maturity (SZ), quality classification code (ZLFLDM), etc.
[0057] S2, obtaining the internal points of the current spatial data.
[0058] The grid unit size of each element in the current spatial data is calculated, the elements are rasterized, the number of each element rasterization unit is counted, the median of the number of grid units is calculated, the median grid unit is extracted, and the center point position is converted into a point element as the internal point of the current element.
[0059] When calculating the grid unit size of each element in the current spatial data, the grid unit size of each element is calculated separately, and the grid unit size is calculated by the following formula:
[0060] CellSize=INT((sqr(TBMJ)-1) / 2),
[0061] wherein TBMJ is the area of the element.
[0062] After rasterizing the data, the frequency of the raster cell identification code is counted, and when the frequency is inconsistent with the current element, the rasterized element is screened out, the raster cell size is adjusted, the adjustment number is half of the original raster cell size, and rasterization is performed again to obtain the current raster data.
[0063] In the rasterization, a scan line seed point filling algorithm is used to realize the rasterization of the vector data, including the following steps:
[0064] S201, a seed point Seed(x, y) is selected and stored in the stack;
[0065] S202, if the stack is empty, the algorithm ends, otherwise step S203 is executed;
[0066] S203, the pixel to be filled is taken out from the stack, and all the pixels to be filled connected to the point on the same scan line are filled, and the leftmost position Xleft and the rightmost position Xright of the filled pixels are recorded;
[0067] S204, the previous and next rows of step S203 are scanned in the range of Xleft≤x≤Xright, and whether all the points are boundary points or filled points is investigated, if not, the rightmost position of each segment to be filled is taken as a new seed point and stored in the stack;
[0068] S205, return to step S202.
[0069] Specifically, the current element identification code is 7919, 446, 7916, 9416, 1139, 753, 444, 445, and the rasterization result data is as shown in Figure 5
[0070] In the calculation of the median of the number of raster cells, each raster is taken as a unit, and a point is formed after vectorization in the point vectorization mode, and the calculation formula is as follows:
[0071] x=x o +(J-0.5)*D x
[0072] y=y0+(I-0.5)*D y
[0073] Where: x0, y0 is the coordinate of the upper left corner, D x , D y is the length of the two sides of the raster cell. An example of obtaining the center point of the rasterization unit is shown in Figure 6
[0074] Statistics of this period, each element is rasterized into how many grid cells Frequency, each element rasterization unit is self-increment coding, according to the formula Median = INT ((Frequency / 2) +0.5) to calculate the internal points of the element. This period, the internal points of the element are shown in the following table 1: Figure 7
[0075] S3, spatial correlation: the internal points of the element in this period obtained in step S2 are spatially correlated with the spatial data of the last period. The records with spatial position overlap are recorded as 1, and the records without spatial position overlap are recorded as 0. For the internal points with spatial position overlap, the attribute values corresponding to the internal points of the spatial data of the last period are directly inherited, the attribute values of the internal points with spatial position overlap are completed, and the first data completion result is obtained. For the internal points without spatial position overlap, the node sets and identification codes of each element in the spatial data of this period and the spatial data of the last period are read respectively, the number N of adjacent elements of the last period that this period element needs to refer to is set, the minimum distance values between this period element and each element of the last period are calculated respectively by using the distance formula and the traversal method, the top N records are retained by ascending order sorting, and the traversal step is cycled to obtain the adjacent element set of this period element of the last period. The attribute tables of this period element and the last period element are associated respectively, the records with inconsistent categories are deleted, the remaining records are checked and completed, and the second data completion result is obtained.
[0076] Specifically, in combination with Figure 8 shown, the data of the last period and the internal points of this period element are rasterized, the identification code is selected as the rasterization unit value, the resampling is performed after rasterization to ensure that the rasterization unit sizes of the two periods of data are the same, and then the rasterization addition operation is performed. The internal point rasterization value of the element with identification code 2 in this period is 2, the rasterization value of the element with identification code 1 in the last period is 1, and when the two periods of data exist spatially, the intermediate rasterization unit value is 3. When the rasterization unit value is subtracted from the identification code 1 of the element in the last period, 2 is obtained, which indicates that the element with identification code 2 in this period exists intersection relationship with the element with identification code 1 in the last period, and the association identification code of the two periods of data is recorded. The data spatial position overlap association data is shown in the following table 1:
[0077] Table 1 Data spatial overlap association data table
[0078] Serial number This period element identification code Last period element identification code Record quantity 440 440 474 1 441 441 475 1 442 442 476 1 443 443 477 1 444 444 478 1 445 445 479 1 446 446 480 1
[0079] According to whether the two periods of elements exist spatial position overlap, the experiment found that there are 9783 intersecting records, and after screening the intersecting data, the last period data is directly inherited by connecting table association, and the thematic information includes ZRQDM, TCHD, TRZD, TRYJZHL, TRPHZ, SWDYX, SZ, ZLFLDM and the like. Then the point element attribute table is associated with the current data according to the element identification code, the redundant fields are deleted, and the first data completion result is formed, as shown in Figure 9 .
[0080] After spatial connection, it is found that there are 12 non-overlapping records, and the non-overlapping point data is screened. After association of the point element identification code and the current element, the current data which needs to be completed again is obtained. The non-overlapping data position is as shown in Figure 10 .
[0081] For the internal points without spatial position overlap, the current data to be completed and the last period element contour point coordinates are read respectively, and the records include element ID and X, Y coordinates, and the records are as follows:
[0082] R={ID,(x1,y1),(x2,y2),…,(x n ,y n )};
[0083] S a ={1,(x1,y1),(x2,y2),…,(x n ,y n );2,(x1,y1),(x2,y2),…(x n ,y n );...;K,(x1,y1),(x2,y2),…(x n ,y n )};
[0084] F a ={1,(x1,y1),(x2,y2),…,(x n ,y n );2,(x1,y1),(x2,y2),…(x n ,y n );...;W,(x1,y1),(x2,y2),…(x n ,y n )};
[0085] In the formula, R is the record form of each element, ID is the element identification code, n is the number of element nodes, S a and F a are associated with the current completion data and the last period data respectively, and K and W are the numbers of elements in two periods.
[0086] Set the reference last period element number N, according to the distance formula, traversal calculation again complete each element node and last period element node distance value, with the minimum distance value as the element between adjacent values. Distance formula as follows:
[0087]
[0088] When ascending order sorting, using heap sorting algorithm to obtain ascending order set of adjacent distance value of again complete data. Sorting algorithm includes the following steps:
[0089] S301, create the initial to be sorted sequence (R1, R2…Rn) as a large top heap, which is the initial unordered heap;
[0090] S302, exchange the top element R[1] and the last element R[n] to obtain a new unordered area (R1, R2, …Rn-1) and an ordered area (Rn), and satisfy R[1,2…n-1]<=R[n];
[0091] S303, the new top R[1] after exchange may violate the properties of the heap, so it is necessary to adjust the current unordered area (R1, R2, …Rn-1) to a new heap, and then exchange R[1] and the last element of the unordered area again to obtain a new unordered area (R1, R2…Rn-2) and an ordered area (Rn-1, Rn), repeat this process until the number of elements in the ordered area is n-1, then the entire sorting process is completed.
[0092] The experimental data set the reference adjacent last period data number to 10, and the calculation result is shown in the following table 2.
[0093] Table 2 example table of adjacent last period element of again complete data
[0094]
[0095]
[0096] The obtained adjacent table is associated with the current data and the last period data to obtain again complete data, and the thematic information is further verified and confirmed according to the category of the current element and the category of the last period element. When the categories are inconsistent, delete the record directly, and the example data category land class name (DLMC) is, for example, paddy field, dry land, watered land, etc. The adjacent last period element of again complete data after deleting the different categories is shown in the following table 3.
[0097] Table 3 example table of adjacent last period element of again complete data after deleting different categories
[0098]
[0099]
[0100] Finally, careful analysis, determine the supplementary topic information, obtain the second data completion result, such as Figure 11 As shown.
[0101] S4, the completion result is merged: the first data completion result obtained in step S3 is merged with the second data completion result, and the final spatial data attribute completion result is obtained, as shown in Figure 12 As shown.
[0102] The spatial data attribute completion method provided by the application reduces the entry threshold of the user, the user does not need to understand the internal data completion process of the method, and does not need to have relevant spatial data processing and analysis professional knowledge background, as long as the original data, process data and result output position are selected, the spatial data attribute can be automatically completed, the spatial data attribute completion efficiency is effectively improved, the spatial data quality is ensured, and accurate and complete basic data is provided for spatial data management and related application analysis.
[0103] The above only describes the preferred embodiments of the application, and does not limit the patent range of the application, any equivalent structural transformation made under the inventive concept of the application, and direct / indirect application in other related technical fields are included in the patent protection range of the application.
Claims
1. A method for completing spatial data attributes, characterized in that, Includes the following steps: S1. Data preparation: The data includes spatially overlapping spatial data of the current period and spatial data of the previous period, wherein the current period data is data to be completed. S2. Obtain the internal points of the current spatial data: Calculate the size of each element's raster cell in the current spatial data, rasterize the element, count the number of rasterized cells for each element, calculate the median number of raster cells, extract the median raster cell, and convert its center point position into a point element as the internal point of the current element. S3. Spatial Association: Spatially associate the internal points of the current period's spatial data obtained in step S2 with the spatial data of the previous period. Records with overlapping spatial locations are marked as 1, and records without overlapping spatial locations are marked as 0. For internal points with overlapping spatial locations, directly inherit the attribute values of the previous period's spatial data to complete the attribute values of the internal points with overlapping spatial locations in the current period. The attributes of the internal points are then attached to the current period's spatial data to obtain the first data completion result. For internal points without overlapping spatial locations, read the set of element nodes and the identifier code of each element in the current period's spatial data and the previous period's spatial data respectively. Set the number N of neighboring elements in the previous period that the current period's elements need to refer to. Using the distance formula, calculate the minimum distance value between the current period's elements and each element in the previous period using a traversal method. Sort the data in ascending order and retain the first N records. Repeat the above traversal steps to obtain the set of neighboring elements in the previous period for the current period's elements. Attach the attribute tables of the current period's elements and the previous period's elements respectively. Delete records with inconsistent categories. Check and complete the remaining records to obtain the second data completion result. S4. Merging the completion results: Merge the first data completion result obtained in step S3 with the second data completion result to obtain the final spatial data attribute completion result.
2. The spatial data attribute completion method as described in claim 1, characterized in that, In step S2, when calculating the raster cell size of each feature in the current spatial data, the raster cell size of each feature is calculated separately, and the raster cell size is calculated using the following formula: CellSize=INT((sqr(TBMJ)-1) / 2), Where: TBMJ is the area of the element; In step S2, after rasterizing the data, the frequency of raster cell identifier codes is counted. When the frequency is inconsistent with the total number of elements in the current period, the elements that have not been rasterized are selected, the raster cell size is adjusted, and the adjustment number is half of the original raster cell size. Then, the data is rasterized again to obtain the raster data for the current period.
3. The spatial data attribute completion method as described in claim 1, characterized in that, In step S2, during rasterization, a scan line seed point filling algorithm is used to rasterize the vector data, including the following steps: S201. Select a seed point Seed(x, y) and store it in the stack; S202. If the stack is empty, the algorithm ends; otherwise, proceed to step S203. S203. Take the pixel to be filled from the stack, perform the filling operation on all points connected to the pixel on the same scan line, and record the leftmost position Xleft and the rightmost position Xright of the filling operation. S204. Scan the row above and the row below in step S203. Within the range Xleft≤x≤Xright, check whether all of them are boundary points or points that have already been filled. If not, store the rightmost position of each segment to be filled as a new seed point on the stack. S205, Return to step S202.
4. The spatial data attribute completion method as described in claim 3, characterized in that, In step S2, when calculating the median number of raster cells, each raster cell is used as a unit, and the point formed after vectorization of each raster cell is calculated by the following formula: x=x0+(J-0.5)*D x y=y0+(I-0.5)*D y Where: x0, y0 are the coordinates of the top-left corner origin, D x D y The lengths of the two sides of the grid cell are given.
5. The spatial data attribute completion method as described in claim 1, characterized in that, In step S2, when obtaining the internal points of the current period's elements, the rasterized units of each element are encoded using an auto-incrementing method. The median of the number of internal raster units of the element is calculated according to the formula Median = INT((Frequency / 2) + 0.5), and the internal points of the element are extracted. Here, Frequency is the number of raster units of each element after being rasterized in the current period.
6. The spatial data attribute completion method as described in claim 1, characterized in that, In step S3, for interior points without spatial overlap, the coordinates of the outline points in the current period's supplementary data and the previous period's data are read and recorded, including the feature ID and X and Y coordinates, as follows: R={ID,(x1,y1),(x2,y2),…,(x n ,y n )}; S a ={1,(x1,y1),(x2,y2),…,(x n ,y n );2,(x1,y1),(x2,y2),…(x n ,y n );...;K,(x1,y1),(x2,y2),…(x n ,y n )}; F a ={1,(x1,y1),(x2,y2),…,(x n ,y n );2,(x1,y1),(x2,y2),…(x n ,y n );...;W,(x1,y1),(x2,y2),…(x n ,y n )}; In the formula, R is the record format of each feature, ID is the feature identifier code, n is the number of feature nodes, and S a and F a Link the current period's supplementary data with a record of 0 to the previous period's data, where K and W represent the number of elements in the two periods, respectively.
7. The spatial data attribute completion method as described in claim 6, characterized in that, In step S3, the ascending sort includes the following steps: S301. Create a max-heap from the initial unsorted sequence (R1, R2, ..., Rn), which is the initial unsorted heap; S302. Swap the top element R[1] with the last element R[n] to obtain a new unordered region (R1,R2,……Rn-1) and an ordered region (Rn), and satisfy R[1,2…n-1]<=R[n]; S303. After the swap, the new top R[1] of the heap may violate the property of the heap. Therefore, it is necessary to adjust the current unordered region (R1,R2,……Rn-1) into a new heap. Then, swap R[1] with the last element of the unordered region again to obtain a new unordered region (R1,R2….Rn-2) and an ordered region (Rn-1,Rn). Repeat this process until the number of elements in the ordered region is n-1, and then the entire sorting process is completed.
Citation Information
Patent Citations
Satellite gas data completion method and system
CN114330146A
Data completion model obtaining method and device, data completion method and device and medium
CN114756727A
Power missing data complementation method
CN115511002A
High efficiency parallel vector data visualization method
WO2017024443A1