A superposition analysis method and device based on spatial big data
By using data segmentation, grid model and parallel computing methods in large-scale spatial data overlay analysis, the problem of inefficient superposition calculation in the existing technology is solved, efficient and real-time superposition calculation results are achieved, and users are provided with a better data processing experience.
Patent Information
- Application Number
- CN202411943781.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-06-27
- 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.
By dividing the segmented sets in data segments, the four to ranges of valid data are calculated, the grid model and spatial index are created, and the correlation between source data and superimposed data is established using parallel calculations and superimposed calculations are performed. The superimposed results are merged and stored in the result table.
It effectively solves the problem of inefficient superposition calculation, and realizes the efficient and real-time superposition calculation results for users when processing large-scale complex spatial data, improving the efficiency and accuracy of superposition calculation.
Smart Images

Figure CN119357201B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of spatial data analysis in geographic information, and in particular, to an overlay analysis method and device based on spatial big data. Background Art
[0002] With the rapid development of society and the sharp increase in the demand for the full digitalization of the physical world, currently, in the field of geographic information, with the help of geographic information systems (GIS) and remote sensing technology, through processing methods such as spatial overlay analysis, 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 fields such as urban planning, environmental protection, and resource management.
[0003] With the explosive growth of spatial data, in terms of data storage, for data volumes in the millions, the database is given the ability to perform spatial analysis by splitting data, adding optimized indexes, etc., and spatial indexes are usually completed through search trees. The existing serial data overlay analysis method is inefficient in the spatial data operations of point and surface, line and surface, and surface and surface, and the complexity of the operation is relatively high, and there is still much room for improvement in practical applications.
[0004] In addition, although the graphic processing method and sequential calculation method of traditional GIS software platforms can achieve the merging, difference analysis, and data splitting of multiple layers, due to the randomness and unevenness of the distribution of spatial data, the existing technology has a unified size of the divided grid cells and a simple division rule, resulting in low efficiency and being unable to meet the user's requirements for efficient and real-time overlay analysis when processing a large amount of spatial data. Summary of the Invention
[0005] Embodiments of this application provide an overlay analysis method and device based on spatial big data, which solve the problem of low efficiency in overlay calculation for large-scale spatial data in the prior art. The method uses data segmentation to divide the segmentation set, calculates the four boundaries of the valid data, creates a grid model and a spatial index, establishes the association between the source data and the overlay data through a parallel calculation method and performs overlay calculation, and merges the overlay results into the result table. The overall process of overlay analysis is optimized, effectively solving the problem of low efficiency in overlay calculation.
[0006] In a first aspect, an embodiment of the present application provides a superposition analysis method based on spatial big data, including: obtaining source data and superposition data and storing them in a source data table and a superposition data table respectively; segmenting the source data table and the superposition data table according to a preset data volume to obtain segmented data, setting a starting ID for the starting data of each piece of segmented data, and storing the segmented data and the starting ID in corresponding source data sets and superposition data sets; performing superposition analysis on the source data sets and the superposition data sets to obtain the spatial four boundaries of the result data; dividing the spatial four boundaries according to a pre-set grid scale to obtain the total number of rows and columns of the grid, and performing secondary grid division on the spatial four 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 the cells of the spatial range grid; determining the intersection of the starting ID of the superposition data set and the spatial four boundaries to obtain superposition intersection data, determining the superposition spatial four boundaries of the superposition intersection data in the spatial four boundaries, and constructing a superposition association relationship between the superposition spatial four boundaries and the spatial range grid based on the superposition spatial four boundaries and their corresponding cell IDs; 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 four boundaries to obtain source intersection data, determining the source spatial four boundaries of the source intersection data in the spatial four boundaries, and constructing a source association relationship between the source spatial four boundaries and the spatial range grid based on the source spatial four boundaries and the cell IDs; indexing the superposition data set in the grid index file based on the source association relationship, and performing superposition calculation on the source data set in the source spatial four boundaries with the indexed superposition data set to achieve spatial superposition.
[0007] In a possible implementation manner, the performing superposition analysis on the source data sets and the superposition data sets to obtain the spatial four boundaries of the result data includes: intersection superposition, union, identity superposition and erase, and clip superposition.
[0008] In a possible implementation manner, the performing superposition analysis on the source data sets and the superposition data sets to obtain the spatial four boundaries of the result data includes: respectively determining the source data four boundaries and the superposition data four boundaries of the source data sets and the superposition data sets; respectively determining the minimum bounding rectangles and corner coordinates of the source data sets and the superposition data sets according to the source data four boundaries and the superposition data four boundaries; using the minimum bounding rectangles and corner coordinates to determine the spatial four boundaries of the intersection of the source data four boundaries and the superposition data four boundaries.
[0009] In a possible implementation manner, the determining the spatial extent of the intersection of the four boundaries of the source data and the four boundaries of the overlay data by using the minimum bounding rectangle and the corner coordinates includes: when the overlay analysis is the intersection overlay, respectively taking the maximum corner coordinate among the southwest corner coordinates of the four boundaries of the source data and the four boundaries of the overlay data and the minimum corner coordinate among the northeast corner coordinates, and using them as the corner coordinates of the main diagonal of the spatial extent; determining the corner coordinates of the secondary diagonal according to the corner coordinates of the main diagonal, so as to obtain the spatial extent in the case of the intersection overlay.
[0010] In a possible implementation manner, the determining the spatial extent of the intersection of the four boundaries of the source data and the four boundaries of the overlay data by using the minimum bounding rectangle and the corner coordinates includes: when the overlay analysis is the union or identity overlay, traversing the corner coordinates of the four boundaries of the source data and the four boundaries of the overlay data, and removing the duplicate corner coordinates among them; respectively taking the boundary value endpoints among all the adjusted corner coordinates as the corner coordinates of the main and / or secondary diagonal of the spatial extent, so as to obtain the spatial extent in the case of the union or identity overlay.
[0011] In a possible implementation manner, the determining the spatial extent of the intersection of the four boundaries of the source data and the four boundaries of the overlay data by using the minimum bounding rectangle and the corner coordinates includes: when the overlay analysis is the erase or clip overlay, the erase overlay includes erasing the intersection overlay area of the four boundaries of the source data and the four boundaries of the overlay data, and retaining the area outside the target erase area; the clip overlay retains the intersection overlay area of the four boundaries of the source data and the four boundaries of the overlay data, so as to obtain the spatial extent after the combination of the erase and clip overlays.
[0012] In a possible implementation, before performing the superposition calculation by superposing it with the source data set within the source space extent, the method further includes: using the source data set and / or the superposition data set as original geometric elements, and iteratively performing a splitting step until the number of nodes of the original geometric elements is less than a preset demarcation value; the splitting step includes: determining 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, determining whether it is a multi-part element; if the original geometric element is the multi-part element, opening the multi-part element to obtain a plurality of single-part elements; respectively using the single-part elements as the original geometric elements and performing the splitting step; if the original geometric element is not the multi-part element, splitting the original geometric element into a plurality of local geometric elements, using the local geometric elements as the original geometric elements, and performing the splitting step.
[0013] In a possible implementation, after performing the superposition calculation by superposing it with the source data set within the source space extent to achieve spatial superposition, the method further includes: creating a result table for storing the superposition result after the superposition calculation, and storing the result table in a relational database.
[0014] In a second aspect, an apparatus for overlay analysis based on spatial big data according to an embodiment of the present application includes: a data storage module configured 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 configured to segment the source data table and the overlay data table according to a preset data volume to obtain segmented data, set a start ID for the start data of each piece of segmented data, and store the segmented data and the start ID in corresponding source data sets and overlay data sets; an effective data range module configured to perform overlay analysis on the source data set and the overlay data set to obtain the spatial four boundaries of the result data; a grid model module configured to divide the spatial four boundaries according to a pre-defined grid scale to obtain the total number of rows and the total number of columns of the grid, perform secondary grid division on the spatial four 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 cells of the spatial range grid; an index module configured to determine the intersection of the start ID of the overlay data set and the spatial four boundaries to obtain overlay intersection data, determine the overlay spatial four boundaries of the overlay intersection data in the spatial four boundaries, and construct an overlay association relationship between the overlay spatial four boundaries and the spatial range grid based on the overlay spatial four boundaries and their corresponding cell IDs; integrate all the overlay association relationships to form a grid index file; determine the intersection of the start ID of the source data set and the spatial four boundaries to obtain source intersection data, determine the source spatial four boundaries of the source intersection data in the spatial four boundaries, and construct a source association relationship between the source spatial four boundaries and the spatial range grid based on the source spatial four boundaries and the cell ID; an overlay calculation module configured to index the overlay data set in the grid index file based on the source association relationship, and perform overlay calculation on the source data set in the source spatial four boundaries with the indexed overlay data set to achieve spatial overlay.
[0015] In a third aspect, an apparatus for a method of overlay analysis based on spatial big data according to an embodiment of the present application includes: a processor; a memory for storing processor-executable instructions; when the processor executes the executable instructions, the method as described in the first aspect or any one of the possible implementation manners of the first aspect is implemented.
[0016] One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
[0017] Embodiments of the present application adopt a superposition analysis method and device based on spatial big data. By creating different data tables, data is classified and stored in segments for subsequent superposition analysis and calculation. The spatial extent of the source data and the superposition data is determined using intersection, union and identification, erasure and clipping superposition analysis. Then, through further grid division, an index is constructed using parallel computing to establish the association relationship between the data and the grid. The graphic elements are segmented using the large geometric element processing method to facilitate superposition calculation. This effectively solves the problem of low efficiency in performing large-scale spatial data superposition analysis, and further realizes providing users with efficient and real-time superposition calculation results when processing large-scale complex spatial data, improving the efficiency and accuracy of superposition calculation. Description of the Drawings
[0018] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments of the present application or the description of the prior art. Obviously, the following-described drawings are some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0019] Figure 1 Flowchart of a superposition analysis method based on spatial big data provided by an embodiment of the present application;
[0020] Figure 2 Schematic diagram of intersection superposition provided by an embodiment of the present application;
[0021] Figure 3 Schematic diagram of union and identification superposition provided by an embodiment of the present application;
[0022] Figure 4 Schematic diagram of erasure and clipping superposition provided by an embodiment of the present application;
[0023] Figure 5 Schematic diagram of a pre-optimized grid model provided by an embodiment of the present application;
[0024] Figure 6 Schematic diagram of a spatial range grid model provided by an embodiment of the present application;
[0025] Figure 7 Flowchart of large geometric element segmentation provided by an embodiment of the present application;
[0026] Figure 8 Schematic diagram of the structure of a superposition analysis device based on spatial big data provided by an embodiment of the present application. Detailed Embodiments
[0027] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying 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. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without creative efforts shall fall within the scope of protection of the present application.
[0028] The following explanations are made for some technologies related to the embodiments of the present application to facilitate understanding. It should be considered that they are merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can 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.
[0029] A superposition analysis method and device based on spatial big data proposed in the embodiments of the present application create and store source data and superposition data in a relational database, perform spatial permission operations using the GDLA (an open-source raster spatial data conversion library) tool, encapsulate the JNI (a protocol for JAVA and C++ language interaction) interface through C++ coding, and interfaceize 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 superposition calculation, optimize the entire spatial big data processing process, and obtain the result after superposition processing.
[0030] Figure 1 It is a flowchart of a superposition analysis method based on spatial big data provided by the embodiments of the present application, including steps 101 to 108. Figure 1 It is only an execution order shown in the embodiments of the present application and does not represent the only execution order of the superposition analysis method based on spatial big data. Under the condition that the final result can be achieved, Figure 1 The steps shown can be executed in parallel or reversed, as follows.
[0031] Step 101: Obtain the source data and the superposition data and store them in the source data table and the superposition data table respectively. In the embodiments of the present application, the PostgreSQL relational database is used, and the PostGIS (an open-source spatial database extension) module is extended to facilitate the spatial storage of the source data and the superposition data and subsequent spatial data query and analysis. Exemplarily, the source data table is marked as Table A, and the superposition data table is marked as Table B.
[0032] Step 102: Segment the source data table and the overlay data table by a 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 overlay data set. In the embodiment of the present application, the source data table and the overlay data table stored in the PostgreSQL database are segmented by a certain data volume in the order of table data records, and the ID of the first data in each segment is set as the starting ID. Exemplarily, segment the data by 1000 data records to obtain the corresponding source data set arryA = {1, 1000, 2000.....} and the overlay data set arryB = {1, 1021, 2023.....}.
[0033] Step 103: Perform an overlay analysis on the source data set and the overlay data set to obtain the spatial extent of the result data. In the present application, intersection overlay, union, identity overlay and erase, and clip overlay are exemplarily adopted to respectively determine the source data extent and the overlay data extent of the source data set and the overlay data set, determine the minimum bounding rectangle and the corner coordinates of the source data set and the overlay data set according to the source data extent and the overlay data extent, use the minimum bounding rectangle and the corner coordinates to determine the spatial extent of the intersection of the source data extent and the overlay data extent, and store the spatial extent as Evn{EXmin, EYmin, EXmax, EYmax}, further reducing the amount of operation data to improve the operation efficiency. Exemplarily, Figures 2 to 4 in, the red rectangular area and the purple area are respectively the minimum bounding rectangles of the source data extent and the overlay data extent. Set the southwest corner coordinates of the source data extent as , and the northeast corner coordinates as ; set the southwest corner coordinates of the overlay data extent as , and the northeast corner coordinates as . Starting from the southwest corner coordinates, set the corner coordinates of the minimum bounding rectangle in a counterclockwise direction with as the starting point in turn, specifically as follows: , , , , , , , . Among them, as Figure 2 shown, the hatched area is the intersection overlay area. Exemplarily, take the maximum corner coordinates among the southwest corner coordinates of the source data extent and the overlay data extent and the minimum corner coordinates among the northeast corner coordinates, and use them as the corner coordinates of the main diagonal of the spatial extent, that is , , , , for the southwest corner and northeast corner coordinates of the spatial four - corner range during intersection and superposition. Then, determine the corner coordinates of the secondary diagonal based on the corner coordinates of the main diagonal, and obtain the northwest corner coordinate as , and the southeast corner coordinate as , that is, the spatial four - corner range during intersection and superposition.
[0034] According to the schematic diagram of union and identification superposition as Figure 3 shown, the slant - filled area is the superposition area of union and identification. Traverse the corner coordinates of the four - corner range of the source data and the four - corner range of the superposition data, and remove the duplicate corner coordinates; respectively take the boundary value endpoints among all the adjusted corner coordinates as the main and / or secondary diagonal corner coordinates of the spatial four - corner range, and obtain the spatial four - corner range during union and identification superposition. Exemplarily, among the boundary value endpoints of all the current corner coordinates, the northwest corner coordinate , , the southeast corner coordinate , , and further determine the southwest corner point coordinate and the northeast corner coordinate of the union and identification superposition area, that is, the spatial four - corner range during union and identification superposition.
[0035] According to the schematic diagram of erasure and clipping superposition as Figure 4 shown, the slant - filled area is the superposition area of erasure and clipping. The erasure superposition includes erasing the intersection and superposition area of the four - corner range of the source data and the four - corner range of the superposition data, and retaining the area outside the target erasure area; the clipping superposition retains the intersection and superposition area of the four - corner range of the source data and the four - corner range of the superposition data, and obtains the spatial four - corner range after combining erasure and clipping superposition. Exemplarily, set the target erasure area as the four - corner range of the superposition data, and the intersection and superposition area is as Figure 2 shown. The area after erasure is the range of the four - corner range of the source data after removing the intersection and superposition area. Then, through clipping superposition, the intersection and superposition area is restored. At this time, the superposition area of erasure and clipping is the four - corner range of the source data.
[0036] Step 104: Divide the spatial four - corner range according to the pre - defined grid scale to obtain the total number of rows and total number of columns of the grid. Take the minimum value as the target number of rows and columns to perform a secondary grid division on the spatial four - corner range to obtain a spatial range grid, and set a cell ID for the cells of the spatial range grid. In the embodiments of the present application, first initially establish a grid with a fixed width. At this time, the grid cells are square. In the geographic coordinate system, the grid width d is , and in the projected plane coordinate system, the grid width d is 150 meters. As Figure 5As shown, starting from the southwest corner point of the spatial four - boundary range, the spatial four - boundary range is divided into a regular grid 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. Among them, starting from the grid in the southwest corner, the grid encoding is sequentially carried out from 0 from west to east in the order of row sorting from south to north. Exemplarily, the specific creation process of the grid model is as follows.
[0037] ;
[0038] In the formula, represents the width of the spatial four - boundary range, represents the height of the spatial four - boundary range, and respectively represent the maximum and minimum widths in the direction of the axis in the projected plane coordinate system, and respectively represent the maximum height and minimum height in the direction of the axis in the projected plane coordinate system. Among them, by calculating the width and height of the spatial four - boundary range, it is convenient to further determine the size of the grid model later.
[0039] ;
[0040] In the formula, represents rounding up, represents the original total number of grid columns, represents the original total number of grid rows, represents the grid width and / or height, represents the final number of grid rows and columns. Among them, the preliminary total number of grid rows and columns is divided according to a fixed grid width and height. The pre - processed grid model is 7 rows and 9 columns, and then the smaller value of the total number of rows and columns is taken as the final number of grid rows and columns, and then the width and height of the final grid cells are calculated inversely.
[0041] ;
[0042] In the formula, represents the recalculated grid width, represents the recalculated grid height.
[0043] As Figure 6 shown, starting from the grid in the southwest corner, the grid encoding is sequentially carried out from 0 from west to east in the order of row sorting from south to north, obtaining the grid cells of the spatial range grid and setting the cell ID.
[0044] for(int row = 0;row<sumRCGrid;row++)
[0045] {
[0046] for (int col = 0; col < sumRCGrid; col++)
[0047] {
[0048] int numGrid = row sumRCGrid + col;
[0049] listGrid.add(numGrid);
[0050] }
[0051] }
[0052] Step 105: Determine the intersection of the starting ID of the superimposed data set and the spatial four-boundary range to obtain the superimposed intersection data, determine the superimposed spatial four-boundary range of the superimposed intersection data in the spatial four-boundary range, and construct a superimposed association relationship between the superimposed spatial four-boundary range and the spatial range grid based on the superimposed spatial four-boundary range and its corresponding cell ID. Exemplarily, create an index in a parallel computing manner to efficiently extract the spatial four-boundary range within the segmented data. Let the current spatial reference EPSG (a geographic coordinate system code system) be epsgCode to solve the problem of incompatibility between coordinate systems or projection planes. The starting ID is set to numD, and extract the data in the superimposed data set arrB whose starting ID is within the segmented data and also within the spatial four-boundary range. The extraction script for the segmented data is as follows:
[0053] "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".
[0054] Traditional query methods only query according to the LIMIT and OFFSET clauses. In the embodiments of the present application, on this basis, a conditional query statement with the data ID greater than the starting ID value is added to improve the query efficiency of the data, and the efficiency is significantly improved in the case of a large number of segments. Exemplarily, select a table with 20.84 million data records, query the data from the 1001st to the 2000th, and the query statement 1 is: "select from tableB where id>=1001 ORDER BY id LIMIT 2000 OFFSET 0”, the query statement 2 is: “select from tableB ORDER BY id LIMIT 2000 OFFSET 1001”. The efficiency of query statement 1 is nearly 40 times higher than that of query statement 2. For the efficiency experiment of multiple queries at the same time, see Table 1.
[0055] Table 1 Data Query Efficiency Comparison Table
[0056]
[0057] Traverse the extracted superimposed intersection data, combine with the cell IDs within the spatial extent, calculate the starting and ending row and column numbers covered by the current superimposed spatial extent, and then reverse-solve the cell IDs of all superimposed spatial extents in combination with the cell IDs to establish a superimposed association relationship. Exemplarily, assume that the current superimposed spatial extent is dataEnv{ , , , }, then the starting and ending row and column numbers covered are as follows:
[0058] ;
[0059] In the formula, represents the starting row code of the grid, represents the ending row code of the grid, represents the starting column code, represents the ending column code, and represent the minimum and maximum values of the current superimposed spatial extent along the axis direction, and represent the minimum and maximum values of the current superimposed spatial extent along the axis direction.
[0060] The cell IDs corresponding to the superimposed spatial extent form a superimposed association relationship, specifically as follows:
[0061] for(int row = inRowStart; row <= inRowEnd; row++)
[0062] {
[0063] for(int col = inColStart; col <= inColEnd; col++)
[0064] {
[0065] int numGrid = row sumRCGrid + col;
[0066] numGridList.t.emplace_back(numGrid);
[0067] }
[0068] }
[0069] Step 106: Integrate all the superposition correlation relationships to form a grid index file. Exemplarily, write the superposition correlation relationships into the index file in the format of "grid number: data id sequence; grid number: data id sequence;...", and collect them into a grid index file dataIndexFile of the superposed data.
[0070] Step 107: Determine the source intersection data by finding the intersection of the starting ID of the source data set and the spatial extent, determine the source spatial extent of the source intersection data in the spatial extent, and build the source correlation relationship between the source spatial extent and the spatial range grid based on the source spatial extent and the cell ID. Extract the data in the source data set arrA whose starting ID is within the segmented data and also within the spatial extent. Traverse the extracted source intersection data, combine the cell ID of the spatial extent, calculate the starting and ending row and column numbers covered by the current source spatial extent, and then inversely solve the cell IDs of all source spatial extents in combination with the cell ID to establish the source correlation relationship. Exemplarily, if the superposition correlation relationship is {641, 646}, then query the superposed data set {206, 1812, 2060} associated with cells 641 and 646 from the grid index file dataIndexFile of the superposed data according to the cell IDs of the source spatial extent to obtain the source correlation relationship.
[0071] Step 108: Index the superposed data set in the grid index file based on the source correlation relationship, and perform superposition calculation with the source data set in the source spatial extent according to the indexed superposed data set to achieve spatial superposition. Use the large geometric segmentation elements to merge the superposition results, and use the single outer ring binary recursive segmentation method to divide the complex large geometric figure into blocks, where the large geometric figure is a geometric figure with the total number of figure nodes greater than 100,000. For example Figure 7As shown, the source data set and / or the overlay data set are used as the original geometric elements. The segmentation step is iteratively executed until the number of nodes of the original geometric elements is less than a preset demarcation value, which is set to 100,000. It is judged 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 judged whether it is a multi-part element. If the original geometric element is a multi-part element, the multi-part element is opened to obtain multiple single-part elements. The single-part elements are used as the original geometric elements, and the segmentation step is executed. If the original geometric element is not a multi-part element, the original geometric element is segmented into multiple local geometric elements, and the local geometric elements are used as the original geometric elements, and the segmentation step is executed. The segmentation direction is selected according to the width and height of the spatial extent of the geometric figure. If the width is greater than the height, the figure is segmented east-west; if the height is greater than the width, the figure is segmented north-south. The source data after segmentation processing is spatially overlaid with the overlay data figure, and the overlay result is merged and stored in the result table, which greatly improves the overlay operation efficiency and also ensures the accuracy of the overlay result.
[0072] Although the present application provides the method operation steps as described in the embodiments or flowcharts, based on routine or non-creative labor, there may be more or fewer operation steps. The step sequence listed in this embodiment is only one way among the execution sequences of numerous steps and does not represent the only execution sequence. When the actual device or client product is executed, it can be executed in the method sequence shown in this embodiment or the drawings or in parallel (for example, in an environment of parallel processors or multi-threaded processing).
[0073] As 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, which are specifically as follows.
[0074] The data storage module 801 is used to obtain the source data and the overlay data and store them in the source data table and the overlay data table respectively;
[0075] The data segmentation module 802 is used to segment the source data table and the overlay data table according to a 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 overlay data set;
[0076] The valid 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;
[0077] The grid model module 804 is used to divide the spatial four - corner range into a grid according to a pre - defined grid scale to obtain the total number of rows and columns of the grid, and then perform a secondary grid division on the spatial four - corner range 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 cells of the spatial range grid;
[0078] The index module 805 is used to determine the intersection of the starting ID of the overlay data set and the spatial four - corner range to obtain overlay intersection data, determine the overlay spatial four - corner range of the overlay intersection data in the spatial four - corner range, and construct an overlay association relationship between the overlay spatial four - corner range and the spatial range grid based on the overlay spatial four - corner range and its corresponding cell ID; integrate all overlay association relationships to form a grid index file; determine the intersection of the starting ID of the source data set and the spatial four - corner range to obtain source intersection data, determine the source spatial four - corner range of the source intersection data in the spatial four - corner range, and construct a source association relationship between the source spatial four - corner range and the spatial range grid based on the source spatial four - corner range and the cell ID;
[0079] 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 an overlay calculation on the indexed overlay data set and the source data set in the source spatial four - corner range to achieve spatial overlay.
[0080] The devices or modules illustrated in the above embodiments can be specifically implemented by computer chips or entities, or by products with certain functions. For the convenience of description, the above devices are described by dividing them into various modules according to functions. When implementing the present 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.
[0081] The methods, apparatuses, or modules in this application can be implemented in the form of computer-readable program code. The controller can be implemented in any suitable manner. For example, the controller can take the form of, for example, a microprocessor or a processor, and a computer-readable medium that stores computer-readable program code (such as software or firmware) executable by the (micro)processor, logic gates, switches, application specific integrated circuit (ASIC), programmable logic controller, and embedded microcontroller. Examples of the controller include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, 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 the form of pure computer-readable program code, the method steps can be logically programmed to enable the controller to be implemented in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, and embedded microcontrollers to achieve the same function. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be regarded as the structures within the hardware component. Or even, the devices for implementing various functions can be regarded as either software modules for implementing the method or structures within the hardware component.
[0082] The embodiments of this application also provide a device for the overlay analysis method based on spatial big data. The device includes: a processor; a memory for storing instructions executable by the processor; when the processor executes the executable instructions, the method as described in the embodiments of this application is implemented.
[0083] In addition, in each embodiment of this application, the various functional modules can be integrated into one processing module, or each module can exist independently, or two or more modules can be integrated into one module.
[0084] From the description of the above embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary hardware. Based on such an understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, or can also be reflected in the implementation process of data migration. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions for causing a computer device (which can be a personal computer, mobile terminal, server, or network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application.
[0085] The various embodiments in this specification are described in a progressive manner. For the same or similar parts among the various embodiments, reference can be made to each other. 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 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, and so on.
[0086] The above embodiments are only used to illustrate the technical solutions of this application, rather than limiting this application; although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of this 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
Weather alarm method and device for sailing route, electronic equipment and storage medium
CN117388952A
A method and system for range query processing of complex geometric data
EP4336377A1