Overlay analysis method and device based on spatial big data
Through the use of data segments, grid models and parallel computing methods in the analysis of spatial data superposition, the problem of low -scale space stacking computing efficiency in existing technologies has been solved, and efficient and real -time superposition analysis results are achieved.
Patent Information
- Application Number
- CN202411943781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The prior art is less efficient when performing large-scale spatial data superposition calculations, and cannot meet users' needs for efficient and real-time superposition analysis.
Through the data segmentation segmentation collection, calculate the four -to -range range of effective data, create a grid model and space index, use parallel computing method to establish the association between source data and overlay data and perform superposition calculations. surface.
It effectively solves the problem of low efficiency of superposition calculation, provides users with efficient and real-time superposition calculation results when processing large-scale complex spatial data, and improves the efficiency and accuracy of superposition calculation.
Smart Images

Figure CN119357201A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of geographic information spatial data analysis, and in particular to an overlay analysis method and device based on spatial big data. Background Art
[0002] With the rapid development of society, the demand for comprehensive digitization of the physical world has increased dramatically. At present, in the field of geographic information, with the help of geographic information systems (GIS) and remote sensing technology, through spatial overlay analysis and other processing methods, the complex, diverse and large-scale real-time or historical spatial data from all corners of the earth are integrated and managed, and are widely used in urban planning, environmental protection, resource management and other fields.
[0003] With the explosive growth of spatial data, in terms of data storage, for data volumes of millions, the database is given the ability to perform spatial analysis by splitting the data and adding optimized indexes, usually through search trees to complete spatial indexing. The existing serial data overlay analysis method is inefficient in spatial data operations between points and surfaces, lines and surfaces, and surfaces and surfaces, and the operation complexity is relatively high. There is still a lot of room for improvement in practical applications.
[0004] In addition, although the graphic processing method and sequential calculation method of the traditional GIS software platform can realize the merging processing, difference analysis and data splitting of multiple layers, due to the randomness and unevenness of spatial data distribution, the existing technology has uniform grid unit size and simple division rules, which is inefficient and cannot meet users' requirements for efficient and real-time overlay analysis when processing large amounts of spatial data. Summary of the invention
[0005] The embodiment of the present application solves the problem of low efficiency in the overlay calculation of large-scale spatial data in the prior art by providing an overlay analysis method and device based on spatial big data. The data segmentation is used to divide the segment set, calculate the four-dimensional range of the valid data, create a grid model and a spatial index, establish the association between the source data and the overlay data through parallel calculation, perform overlay calculation, and merge the overlay results into the result table. The overall process of overlay analysis is optimized, effectively solving the problem of low efficiency of overlay calculation.
[0006] In a first aspect, an embodiment of the present application provides an overlay analysis method based on spatial big data, including: acquiring source data and overlay data and storing them in a source data table and an overlay data table respectively; segmenting the source data table and the overlay data table according to a preset data amount to obtain segmented data, and setting a starting ID for the starting data of each segmented data, and storing the segmented data and the starting ID in the corresponding source data set and overlay data set; performing overlay analysis on the source data set and the overlay data set to obtain the spatial boundaries of the result data; gridding the spatial boundaries according to a pre-scaled grid to obtain the total number of rows and columns of the grid, performing secondary grid division on the spatial boundaries with the minimum value as the target number of rows and columns to obtain a spatial range grid, and setting a cell ID for each cell of the spatial range grid; determining the starting ID and the spatial range of the overlay data set The superposition intersection data is obtained by determining the intersection of the starting ID of the source data set and the spatial boundaries, determining the superposition spatial boundaries of the superposition intersection data in the spatial boundaries, and constructing the superposition association relationship between the superposition spatial boundaries and the spatial scope grid based on the superposition spatial boundaries and the corresponding cell ID; integrating all the superposition association relationships to form a grid index file; determining the intersection of the starting ID of the source data set and the spatial boundaries to obtain source intersection data, determining the source spatial boundaries of the source intersection data in the spatial boundaries, and constructing the source association relationship between the source spatial boundaries and the spatial scope grid based on the source spatial boundaries and the cell ID; indexing the superposition data set in the grid index file based on the source association relationship, and according to the indexed superposition data set, performing superposition calculation on it and the source data set in the source spatial boundaries to realize spatial superposition.
[0007] In a possible implementation, the performing of overlay analysis on the source data set and the overlay data set to obtain the spatial boundaries of the result data includes: intersection overlay, union, mark overlay and erasure, and clip overlay.
[0008] In a possible implementation, the overlay analysis of the source data set and the overlay data set to obtain the spatial boundaries of the result data includes: respectively determining the source data boundaries and the overlay data boundaries of the source data set and the overlay data set; respectively determining the minimum enclosing rectangle and corner point coordinates of the source data set and the overlay data set according to the source data boundaries and the overlay data boundaries; and determining the spatial boundaries of the intersection of the source data boundaries and the overlay data boundaries using the minimum enclosing rectangle and the corner point coordinates.
[0009] In a possible implementation, the spatial boundaries of the intersection of the source data boundaries and the superimposed data boundaries determined by using the minimum circumscribed rectangle and the corner point coordinates include: when the superposition analysis is the intersection superposition, taking the largest corner point coordinate in the southwest corner coordinates and the smallest corner point coordinate in the northeast corner coordinates of the source data boundaries and the superimposed data boundaries, and taking them as the corner point coordinates of the main diagonal of the spatial boundaries; determining the corner point coordinates of the secondary diagonal according to the corner point coordinates of the main diagonal, and obtaining the spatial boundaries during the intersection superposition.
[0010] In a possible implementation, the spatial boundaries of the intersection of the source data boundaries and the superimposed data boundaries are determined by using the minimum circumscribed rectangle and the corner point coordinates, including: when the superposition analysis is the union and identification superposition, traversing the corner point coordinates of the source data boundaries and the superimposed data boundaries, and removing the repeated corner point coordinates; taking the boundary value endpoints of all the adjusted corner point coordinates as the main and / or secondary diagonal corner point coordinates of the spatial boundaries, and obtaining the spatial boundaries during the union and identification superposition.
[0011] In a possible implementation, the spatial boundaries of the intersection of the source data boundaries and the superimposed data boundaries determined by using the minimum enclosing rectangle and the corner point coordinates include: when the overlay analysis is the erasing and clipping overlay, the erasing overlay includes erasing the intersection overlay area of the source data boundaries and the superimposed data boundaries, and retaining the area falling outside the target erasing area; the clipping overlay retains the intersection overlay area of the source data boundaries and the superimposed data boundaries, and obtains the spatial boundaries after the erasing and clipping overlay are merged.
[0012] In a possible implementation, before the overlay calculation is performed on it and the source data set within the four boundaries of the source space to complete the spatial overlay, it also includes: taking the source data set and / or the overlay data set as the original geometric element, iteratively performing the segmentation step until the number of nodes of the original geometric element is less than the preset demarcation value; the segmentation step includes: judging whether the number of nodes of the original geometric element exceeds the preset demarcation value; if the number of nodes of the original geometric element exceeds the preset demarcation value, judging whether it is a multi-component element; if the original geometric element is the multi-component element, opening the multi-component element to obtain multiple single-component elements; taking the single-component elements as the original geometric elements respectively, and performing the segmentation step; if the original geometric element is not the multi-component element, segmenting the original geometric element into multiple local geometric elements, and taking the local geometric elements as the original geometric elements, and performing the segmentation step.
[0013] In a possible implementation, after performing overlay calculation with the source data set within the four boundaries of the source space to achieve spatial overlay, it also includes: creating a result table for storing the overlay results after the overlay calculation, and storing the result table in a relational database.
[0014] In a second aspect, an embodiment of the present application provides a device for overlay analysis based on spatial big data, including: a data storage module, used to obtain source data and overlay data and store them in a source data table and an overlay data table respectively; a data segmentation module, used to segment the source data table and the overlay data table according to a preset data amount to obtain segmented data, and set a starting ID for the starting data of each segmented data, and store the segmented data and the starting ID in the corresponding source data set and overlay data set; a valid data range module, used to perform overlay analysis on the source data set and the overlay data set to obtain the spatial boundaries of the result data; a grid model module, used to grid the spatial boundaries according to a pre-scaled grid to obtain the total number of rows and columns of the grid, and perform secondary grid division on the spatial boundaries with the minimum value as the target number of rows and columns to obtain a spatial range grid, and set a cell ID for the cell of the spatial range grid; an index module, used to determine the The intersection of the starting ID of the overlay data set and the spatial boundaries is used to obtain overlay intersection data, the overlay spatial boundaries of the overlay intersection data in the spatial boundaries are determined, and the overlay association relationship between the overlay spatial boundaries and the spatial scope grid is constructed based on the overlay spatial boundaries and the cell ID corresponding to the overlay spatial boundaries; all the overlay association relationships are integrated to form a grid index file; the intersection of the starting ID of the source data set and the spatial boundaries is determined to obtain source intersection data, the source spatial boundaries of the source intersection data in the spatial boundaries are determined, and the source association relationship between the source spatial boundaries and the spatial scope grid is constructed based on the source spatial boundaries and the cell ID; an overlay calculation module is used to index the overlay data set in the grid index file based on the source association relationship, and according to the indexed overlay data set, perform overlay calculation on it and the source data set in the source spatial boundaries to achieve spatial overlay.
[0015] In a third aspect, an embodiment of the present application provides a device for an overlay analysis method based on spatial big data, the device comprising: a processor; a memory for storing processor executable instructions; when the processor executes the executable instructions, it implements the method described in the first aspect or any possible implementation method of the first aspect.
[0016] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages: The embodiment of the present application adopts a method and device for overlay analysis based on spatial big data, classifies and stores data in segments by creating different data tables for subsequent overlay analysis and calculation, uses intersection, union and identification, erasure and clipping overlay analysis to determine the spatial boundaries of source data and overlay data, and then uses parallel computing to build indexes through further grid division, establishes the association between data and grids, and uses large geometric element processing methods to segment graphic elements for easy overlay calculation. It effectively solves the problem of low efficiency when performing large-scale spatial data overlay analysis, and then provides users with efficient and real-time overlay calculation results when processing large-scale complex spatial data, thereby improving the efficiency and accuracy of overlay calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0018] Figure 1 A flowchart of a method for overlay analysis based on spatial big data provided in an embodiment of the present application; Figure 2 A schematic diagram of intersection and superposition provided in an embodiment of the present application; Figure 3 A schematic diagram of the combination and logo superposition provided in the embodiment of the present application; Figure 4 A schematic diagram of erasing, cutting and overlaying provided in an embodiment of the present application; Figure 5 A schematic diagram of a pre-grid model provided in an embodiment of the present application; Figure 6 A schematic diagram of a spatial range grid model provided in an embodiment of the present application; Figure 7 A flowchart of large geometric element segmentation provided in an embodiment of the present application; Figure 8 A schematic diagram of the structure of a superposition analysis device based on spatial big data provided in an embodiment of the present application. DETAILED DESCRIPTION
[0019] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0020] The following describes some of the techniques involved in the embodiments of the present application to facilitate understanding, and they should be considered as merely exemplary. Therefore, it should be appreciated by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, some descriptions of well-known functions and structures are omitted in the following description.
[0021] The embodiment of the present application proposes an overlay analysis method and device based on spatial big data, which creates and stores source data and overlay data in a relational database, uses the GDLA (an open source raster spatial data conversion library) tool to perform spatial permission operations, and implements JNI (a protocol for interaction between JAVA and C++ languages) interface encapsulation through C++ coding, and interfaces each process step and algorithm so that Spark (a task scheduling mechanism) can schedule each processing step of grid division, data segmentation, large geometric data processing and overlay calculation, thereby optimizing the entire spatial big data processing process and obtaining the result after overlay processing.
[0022] Figure 1 It is a flowchart of a superposition analysis method based on spatial big data provided in an embodiment of the present application, including steps 101 to 108. Figure 1 This is only an execution order shown in the embodiment of the present application, and does not represent the only execution order of the overlay analysis method based on spatial big data. If the final result can be achieved, Figure 1 The steps shown may be performed in parallel or in reverse, as follows.
[0023] Step 101: Obtain source data and overlay data and store them in a source data table and an overlay data table, respectively. In an embodiment of the present application, a PostgreSQL relational database is used, and a PostGIS (an open source spatial database extension) module is extended to facilitate spatial storage of source data and overlay data and subsequent spatial data query and analysis. For example, the source data table is marked as table A, and the overlay data table is marked as table B.
[0024] Step 102: Segment the source data table and the overlay data table according to the preset data volume to obtain segmented data, set a starting ID for the starting data of each segmented data, and store the segmented data and the starting ID in the corresponding source data set and the overlay data set. In an embodiment of the present application, the source data table and the overlay data table stored in the PostgreSQL database are segmented according to the table data record order with a certain amount of data, and the ID of the first data of each segment is set to the starting ID. Exemplarily, the data is segmented according to 1000 data, and the corresponding source data set arryA={1,1000,2000.....} and the overlay data set arryB={1,1021,2023.....} are obtained.
[0025] Step 103: Overlay analysis is performed on the source data set and the overlay data set to obtain the spatial boundaries of the result data. The present application exemplarily adopts intersection overlay, union, identification overlay and erasure, and clipping overlay to respectively determine the source data boundaries and the overlay data boundaries of the source data set and the overlay data set, and respectively determine the minimum bounding rectangle and corner point coordinates of the source data set and the overlay data set according to the source data boundaries and the overlay data boundaries, and use the minimum bounding rectangle and corner point coordinates to determine the spatial boundaries of the intersection of the source data boundaries and the overlay data boundaries, and store the spatial boundaries as Evn{EXmin, EYmin, EXmax, EYmax}, which further reduces the amount of computational data to improve computational efficiency. Exemplarily, Figures 2 to 4 In the figure, the red rectangle and purple rectangle are the minimum bounding rectangles of the source data and the overlay data, respectively. Set the southwest corner coordinates of the source data to , the northeast corner coordinate is set to ; The southwest corner coordinates of the four ranges of the overlay data are set to , the northeast corner coordinate is set to . Starting from the southwest corner, go counterclockwise. To start, set the coordinates of the corner points of the minimum enclosing rectangle in sequence, as follows: , , , , , , , Among them, Figure 2 As shown, the area filled with oblique lines is the intersection and overlay area. For example, the largest corner point coordinates and the smallest corner point coordinates in the southwest corner coordinates of the source data boundary range and the overlay data boundary range are taken as the corner point coordinates of the main diagonal line of the spatial boundary range, that is, , , , , in order to find the coordinates of the southwest and northeast corners of the space four-dimensional range when the intersection is superimposed. Then, according to the coordinates of the corner points of the main diagonal, the coordinates of the corner points of the secondary diagonal are determined, and the coordinates of the northwest corner are obtained as , the southeast corner coordinates are , that is, to find the spatial boundaries when intersecting and superimposing.
[0026] According to the schematic diagram of the combination and logo superposition, Figure 3 As shown, the diagonal filled area is the combined and marked superposition area. Traverse the corner point coordinates of the source data boundary range and the superposition data boundary range, and remove the repeated corner point coordinates; take the boundary value endpoints of all adjusted corner point coordinates as the main and / or secondary diagonal corner point coordinates of the spatial boundary range, and obtain the spatial boundary range when combined and marked. Exemplarily, the northwest corner coordinates of the boundary value endpoints of all current corner point coordinates , , southeast corner coordinates , , and then determine the coordinates of the southwest corner of the joint and marked overlay area With northeast corner coordinates , that is, the spatial boundaries when the combination and identification are superimposed.
[0027] According to the schematic diagram of erasing, cutting and superposition, Figure 4 As shown, the area filled with diagonal lines is the overlay area of erasure and clipping. Erasure overlay includes erasing the intersection overlay area of the source data boundaries and the overlay data boundaries, and retaining the area outside the target erased area; clipping overlay retains the intersection overlay area of the source data boundaries and the overlay data boundaries, and obtains the spatial boundaries after erasure, clipping and overlay are merged. Exemplarily, the target erased area is set to the overlay data boundaries, and the intersection overlay area is as follows: Figure 2 As shown, the erased area is the range after the intersection and overlay area is removed from the four boundaries of the source data, and then the intersection and overlay area is restored by clipping and overlaying. At this time, the erased and clipped overlay area is the four boundaries of the source data.
[0028] Step 104: Grid the spatial range according to the pre-scaled grid to obtain the total number of rows and columns of the grid, and use the minimum value as the target number of rows and columns to perform secondary grid division on the spatial range to obtain a spatial range grid, and set a cell ID for the cell of the spatial range grid. In the embodiment of the present application, a grid is initially established with a fixed width. At this time, the grid cell is a square. The grid width d in the geographic coordinate system is , the grid width d in the projection plane coordinate system is 150 meters. Figure 5As shown, the southwest corner of the spatial range is taken as the starting point, and the spatial range is divided into regular grids with a total number of rows sumRow and a total number of columns sumCol from west to east and from south to north according to a fixed grid width. Then, grid coding is performed sequentially from 0 from west to east from the southwest corner of the grid from south to north according to the row order. For example, the specific creation process of the grid model is as follows.
[0029] ; In the formula, Indicates the width of the space. Indicates the height of the space. and They represent the coordinates of the projection plane along The maximum and minimum width in the axis direction, and They represent the coordinates of the projection plane along The maximum and minimum heights of the axis direction. By calculating the width and height of the four-dimensional range of the space, it is convenient to further determine the size of the grid model.
[0030] ; In the formula, Indicates rounding up. Represents the total number of columns in the original grid, Indicates the total number of rows in the original grid. indicates the grid width and / or height, Indicates the final number of grid rows and columns. The initial total number of grid rows and columns is divided according to the fixed grid width and height. The pre-scaled grid model is 7 rows and 9 columns. The smallest value in the total number of rows and columns is taken as the final number of grid rows and columns, and then the final grid unit width and height are calculated in reverse.
[0031] ; In the formula, Represents the recalculated grid width, Indicates the recalculated grid height.
[0032] like Figure 6 As shown, starting from the grid in the southwest corner, grid encoding is performed sequentially from south to north according to the row sorting and from west to east starting from 0 to obtain the cells of the spatial range grid and set the cell ID.
[0033] for(int row = 0; row <sumRCGrid;row++) { for(int col = 0;col <sumRCGrid;col++) { int numGrid = row sumRCGrid + col; listGrid.add(numGrid); } } Step 105: Determine the intersection of the starting ID of the overlay data set and the spatial boundaries to obtain the overlay intersection data, determine the overlay spatial boundaries of the overlay intersection data in the spatial boundaries, and construct the overlay association relationship between the overlay spatial boundaries and the spatial boundaries grid based on the overlay spatial boundaries and its corresponding cell ID. Exemplarily, create an index in a parallel computing manner to efficiently extract the spatial boundaries in the segmented data. Set the current spatial reference EPSG (a geographic coordinate system code system) to epsgCode to solve the problem of incompatibility between coordinate systems or projection planes. Set the starting ID to numD, and extract the data in the overlay data set arrB whose starting ID is located in the segmented data and is also located in the spatial boundaries. The segmented data extraction script is as follows: "SELECT id,st_extent(geom) FROM (SELECT id,geom FROM tableB where id>= numD ORDER BY id LIMIT 1000 OFFSET 0) sub where st_intersects(geom,st_geomfromtext('POLYGON((EXmin EYmax,EXmax EYmax,EXmax EYmin,EXmin EYmin,EXminEYmax)))', epsgCode)) GROUP BY id".
[0034] The traditional query method only queries according to the LIMIT and OFFSET clauses. In the embodiment of the present application, a conditional query statement that the data ID is greater than the starting ID value is added on this basis to improve the query efficiency of the data. The efficiency is significantly improved when the number of segments is large. For example, a table with 20.84 million data records is selected to query the data from 1001 to 2000. The query statement 1 is: "select from tableB where id>=1001 ORDER BY id LIMIT 2000OFFSET 0", query statement 2 is: "select from tableB ORDER BY id LIMIT 2000 OFFSET1001”, query statement 1 is nearly 40 times more efficient than query statement 2. For multiple experiments on query efficiency at the same time, see Table 1.
[0035] Table 1 Data query efficiency comparison table
[0036] Traverse the extracted superposition intersection data, combine the cell ID of the spatial boundary range, calculate the start and end row and column numbers covered by the current superposition spatial boundary range, and then reversely solve the cell IDs of all superposition spatial boundaries with the cell ID to establish a superposition association relationship. For example, let the current superposition spatial boundary range be dataEnv{ , , , }, the start and end row and column numbers of the coverage are as follows: ; In the formula, Indicates the row start code of the grid. Indicates the row termination code of the grid, Indicates the column start code, Indicates the column termination code, and Indicates the current superposition space range along the four sides The minimum and maximum values in the axis direction, and Indicates the current superposition space range along the four sides Minimum and maximum values along the axis.
[0037] The cell IDs corresponding to the four ranges of the superposition space constitute the superposition association relationship, as follows: for(int row = inRowStart;row<= inRowEnd;row++) { for(int col = inColStart;col<= inColEnd;col++) { int numGrid = row sumRCGrid + col; numGridList.t.emplace_back(numGrid); } } Step 106: Integrate all the superposition association relationships to form a grid index file. Exemplarily, the superposition association relationships are written into the index file in the format of "grid number: data id sequence; grid number: data id sequence; ...", and are collected into a grid index file dataIndexFile of superposition data.
[0038] Step 107: Determine the intersection of the starting ID of the source data set and the spatial boundaries to obtain source intersection data, determine the source spatial boundaries of the source intersection data in the spatial boundaries, and construct the source association relationship between the source spatial boundaries and the spatial boundaries grid based on the source spatial boundaries and the cell ID. Extract the data whose starting ID is located in the segmented data and is also located in the spatial boundaries in the source data set arrA. Traverse the extracted source intersection data, combine the cell ID of the spatial boundaries, calculate the starting and ending row and column numbers covered by the current source spatial boundaries, and then reversely solve the cell IDs of all source spatial boundaries in combination with the cell ID to establish a source association relationship. Exemplarily, if the superposition association relationship is {641,646}, then query the superposition data set {206,1812,2060} associated with cells 641 and 646 from the grid index file dataIndexFile of the superposition data according to the cell ID of the source spatial boundaries to obtain the source association relationship.
[0039] Step 108: Based on the source association relationship, the overlay data set is indexed in the grid index file, and the indexed overlay data set is overlaid with the source data set in the four-dimensional range of the source space to realize spatial overlay. The overlay results are merged using large geometric segmentation elements, and the complex large geometric figures are divided into blocks using a single outer ring binary recursive segmentation method, where the large geometric figure is a geometric figure with a total number of graphic nodes greater than 100,000. Figure 7As shown, the source data set and / or the overlay data set are taken as the original geometric elements, and the segmentation step is iteratively performed until the number of nodes of the original geometric elements is less than the preset demarcation value, and the preset demarcation value is set to 100,000, and it is determined whether the number of nodes of the original geometric elements exceeds the preset demarcation value. If the number of nodes of the original geometric elements exceeds the preset demarcation value, it is determined whether it is a multi-component element. If the original geometric element is a multi-component element, the multi-component element is opened to obtain multiple single-component elements. The single-component element is taken as the original geometric element and the segmentation step is performed. If the original geometric element is not a multi-component element, the original geometric element is segmented into multiple local geometric elements, and the local geometric elements are taken as the original geometric elements to perform the segmentation step. The direction of the segmentation is selected according to the width and height of the spatial boundaries of the geometric figure. If the width is greater than the height, the east-west segmentation figure is performed, and if the height is greater than the width, the north-south segmentation is performed. The source data after segmentation is used to perform spatial superposition with the overlay data graphics, and the overlay results are merged and stored in the result table, which greatly improves the efficiency of the overlay operation while ensuring the accuracy of the overlay results.
[0040] Although the present application provides method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in this embodiment is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in sequence or in parallel according to the method shown in this embodiment or the accompanying drawings (for example, in a parallel processor or multi-threaded processing environment).
[0041] like Figure 8 As shown, the embodiment of the present application also provides a device 800 for overlay analysis based on spatial big data. The device includes: a data storage module 801, a data segmentation module 802, a valid data range module 803, a grid model module 804, an index module 805 and an overlay calculation module 806, as follows.
[0042] A data storage module 801 is used to obtain source data and overlay data and store them in a source data table and an overlay data table respectively; The data segmentation module 802 is used to segment the source data table and the overlay data table according to the preset data amount to obtain segmented data, set a starting ID for the starting data of each segmented data, and store the segmented data and the starting ID in the corresponding source data set and overlay data set; The effective data range module 803 is used to perform overlay analysis on the source data set and the overlay data set to obtain the spatial extent of the result data; The grid model module 804 is used to grid the spatial boundaries according to the pre-scaled grid to obtain the total number of rows and columns of the grid, and to perform secondary grid division on the spatial boundaries with the minimum value as the target number of rows and columns to obtain the spatial range grid, and to set cell IDs for the cells of the spatial range grid; Index module 805, used to determine the intersection of the starting ID of the superimposed data set and the spatial boundaries to obtain superimposed intersection data, determine the superimposed spatial boundaries of the superimposed intersection data in the spatial boundaries, and construct the superimposed association relationship between the superimposed spatial boundaries and the spatial boundaries grid based on the superimposed spatial boundaries and the cell ID corresponding to the superimposed spatial boundaries; integrate all superimposed association relationships to form a grid index file; determine the intersection of the starting ID of the source data set and the spatial boundaries to obtain source intersection data, determine the source spatial boundaries of the source intersection data in the spatial boundaries, and construct the source association relationship between the source spatial boundaries and the spatial boundaries grid based on the source spatial boundaries and the cell ID; The overlay calculation module 806 is used to index the overlay data set in the grid index file based on the source association relationship, and perform overlay calculation on the indexed overlay data set with the source data set in the four boundaries of the source space to realize spatial overlay.
[0043] The devices or modules described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described in various modules according to their functions. When implementing this application, the functions of each module can be implemented in the same or multiple software and / or hardware. Of course, the module that implements a certain function can also be implemented by combining multiple sub-modules or sub-units.
[0044] The method, device or module in the present application can be implemented in the form of a computer-readable program code. The controller can be implemented in any appropriate manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing a computer-readable program code (such as software or firmware) that can be executed by the (micro)processor, a logic gate, a switch, an application-specific integrated circuit (English: Application Specific Integrated Circuit; Abbreviation: ASIC), a programmable logic controller and an embedded microcontroller. Examples of controllers include but are not limited to the following microcontrollers: ARC 625D, AtmelAT91SAM, Microchip PIC18F26K20 and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art also know that in addition to implementing the controller in a purely computer-readable program code, the controller can be implemented in the form of a logic gate, a switch, an application-specific integrated circuit, a programmable logic controller and an embedded microcontroller by logically programming the method steps. Therefore, this controller can be considered as a hardware component, and the devices included in it for implementing various functions can also be regarded as structures within the hardware component. Or even, the means for realizing various functions may be regarded as both a software module for realizing the method and a structure within a hardware component.
[0045] An embodiment of the present application also provides a device for an overlay analysis method based on spatial big data, the device comprising: a processor; a memory for storing processor executable instructions; when the processor executes the executable instructions, the method of the embodiment of the present application is implemented.
[0046] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist independently, or two or more modules may be integrated into one module.
[0047] It can be seen from the description of the above implementation methods that those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary hardware. Based on this understanding, the technical solution of the present application can be essentially or partly reflected in the prior art in the form of a software product, or it can be reflected in the implementation process of data migration. The computer software product can be stored in a storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a mobile terminal, a server, or a network device, etc.) to execute the methods described in the various embodiments of the present application or certain parts of the embodiments.
[0048] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. All or part of this application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, mobile communication terminals, multi-processor systems, microprocessor-based systems, programmable electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc.
[0049] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some or all of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the present application.
Claims
1. A superposition analysis method based on spatial big data, characterized in that: include: Obtaining source data and overlay data and storing them in a source data table and an overlay data table respectively; Segmenting the source data table and the overlay data table according to a preset data amount to obtain segmented data, setting a starting ID for the starting data of each segmented data, and storing the segmented data and the starting ID in the corresponding source data set and overlay data set; Performing overlay analysis on the source data set and the overlay data set to obtain the spatial boundaries of the result data; Gridding the spatial boundaries according to the pre-scaled grid to obtain the total number of rows and columns of the grid, taking the minimum value as the target number of rows and columns, secondary gridding the spatial boundaries to obtain a spatial range grid, and setting a cell ID for each cell of the spatial range grid; Determine the intersection of the starting ID of the superimposed data set and the spatial boundaries to obtain superimposed intersection data, determine the superimposed spatial boundaries of the superimposed intersection data in the spatial boundaries, and construct a superimposed association relationship between the superimposed spatial boundaries and the spatial range grid based on the superimposed spatial boundaries and the cell ID corresponding to the superimposed spatial boundaries; Integrate all the superimposed association relationships to form a grid index file; Determine the intersection of the starting ID of the source data set and the spatial boundaries to obtain source intersection data, determine the source spatial boundaries of the source intersection data in the spatial boundaries, and construct a source association relationship between the source spatial boundaries and the spatial range grid based on the source spatial boundaries and the cell ID; The overlay data set is indexed in the grid index file based on the source association relationship, and according to the indexed overlay data set, it is overlaid with the source data set in the four-dimensional range of the source space to achieve spatial overlay.
2. The method according to claim 1, characterized in that The spatial boundaries of the result data obtained by performing overlay analysis on the source data set and the overlay data set include: intersection overlay, union, mark overlay and erasure, and clip overlay.
3. The method according to claim 2, characterized in that The spatial extent of the result data obtained by performing the overlay analysis on the source data set and the overlay data set includes: Determine the source data boundaries and the overlay data boundaries of the source data set and the overlay data set respectively; Determine the minimum bounding rectangle and corner point coordinates of the source data set and the overlay data set respectively according to the four boundaries of the source data and the four boundaries of the overlay data; The spatial boundaries of the intersection of the source data boundaries and the overlay data boundaries are determined using the minimum circumscribed rectangle and the corner point coordinates.
4. The method according to claim 3, characterized in that The spatial boundaries of the intersection of the source data boundaries and the superimposed data boundaries are determined by using the minimum bounding rectangle and the corner point coordinates, including: When the overlay analysis is the intersection overlay, the largest corner point coordinates and the smallest corner point coordinates of the southwest corner coordinates of the four boundaries of the source data and the four boundaries of the overlay data are respectively taken as the corner point coordinates of the main diagonal of the four boundaries of the space; The coordinates of the corner points of the secondary diagonal are determined according to the coordinates of the corner points of the main diagonal, and the spatial boundaries during the intersection and superposition are obtained.
5. The method according to claim 3, characterized in that: The spatial boundaries of the intersection of the source data boundaries and the superimposed data boundaries are determined by using the minimum bounding rectangle and the corner point coordinates, including: When the overlay analysis is the combination and identification overlay, traverse the corner point coordinates of the four boundaries of the source data and the four boundaries of the overlay data, and remove the repeated corner point coordinates; The boundary value endpoints of all the adjusted corner point coordinates are respectively taken as the main and / or secondary diagonal corner point coordinates of the spatial boundaries to obtain the spatial boundaries when combined and marked.
6. The method according to claim 3, characterized in that The spatial boundaries of the intersection of the source data boundaries and the superimposed data boundaries are determined by using the minimum bounding rectangle and the corner point coordinates, including: When the overlay analysis is the erasing and clipping overlay, the erasing overlay includes erasing the intersection overlay area of the source data boundary range and the overlay data boundary range, and retaining the area outside the target erasing area; The clipping and superposition retains the intersection and superposition area of the source data boundaries and the superposition data boundaries, and obtains the spatial boundaries after the erasing, clipping and superposition are combined.
7. The method according to claim 1, characterized in that Before performing the superposition calculation on the source data set within the four ranges of the source space to complete the spatial superposition, the method further includes: Taking the source data set and / or the superimposed data set as original geometric elements, iteratively performing the segmentation step until the number of nodes of the original geometric elements is less than a preset threshold value; The segmentation step comprises: Determining whether the number of nodes of the original geometric element exceeds the preset threshold; If the number of nodes of the original geometric element exceeds the preset delimiter value, determining whether it is a multi-component element; If the original geometric element is the multi-component element, opening the multi-component element to obtain a plurality of single-component elements; Taking the single component element as the original geometric element, executing the segmentation step; If the original geometric element is not the multi-component element, the original geometric element is divided into a plurality of local geometric elements, and the local geometric elements are used as the original geometric elements to perform the division step.
8. The method according to claim 1, characterized in that After the source data set in the four-dimensional range of the source space is superimposed and calculated to realize spatial superposition, the method further includes: A result table is created to store the superposition results after the superposition calculation, and the result table is stored in a relational database.
9. A device for superposition analysis based on spatial big data, characterized in that: include: A data storage module is used to obtain source data and overlay data and store them in a source data table and an overlay data table respectively; A data segmentation module, used for segmenting the source data table and the overlay data table according to a preset data amount to obtain segmented data, setting a starting ID for the starting data of each segmented data, and storing the segmented data and the starting ID in the corresponding source data set and overlay data set; A valid data range module, used for performing overlay analysis on the source data set and the overlay data set to obtain the spatial extent of the result data; A grid model module is used to grid the spatial boundaries according to the pre-scaled grid to obtain the total number of rows and columns of the grid, and to perform secondary grid division on the spatial boundaries with the minimum value as the target number of rows and columns to obtain a spatial range grid, and to set a cell ID for each cell of the spatial range grid; An index module is used to determine the intersection of the starting ID of the superimposed data set and the spatial boundaries to obtain superimposed intersection data, determine the superimposed spatial boundaries of the superimposed intersection data in the spatial boundaries, and construct a superimposed association relationship between the superimposed spatial boundaries and the spatial range grid based on the superimposed spatial boundaries and the cell ID corresponding to the superimposed spatial boundaries; and integrate all the superimposed association relationships to form a grid index file; Determine the intersection of the starting ID of the source data set and the spatial boundaries to obtain source intersection data, determine the source spatial boundaries of the source intersection data in the spatial boundaries, and construct a source association relationship between the source spatial boundaries and the spatial range grid based on the source spatial boundaries and the cell ID; The overlay calculation module is used to index the overlay data set in the grid index file based on the source association relationship, and perform overlay calculation on the indexed overlay data set with the source data set in the four-dimensional range of the source space to realize spatial overlay.
10. A device for performing a method for overlay analysis of spatial big data, characterized in that: include: processor; a memory for storing processor-executable instructions; When the processor executes the executable instructions, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Microseism event scanning positioning method and device
CN104133246A
Rapid implementation method for space superposition analysis
CN111274335A
Distributed superposition analysis method and device based on space grid and storage medium
CN113704380A
Multi-layer space big data superposition and merging method and device, equipment and storage medium
CN114490899A
Meteorological grid and track grid superposition method based on four-dimensional data set
CN116030214A