Method, device and equipment for gridding planar vector data
Through the surface vector data gridding method, the surface coverage elements are obtained, the grid set is calculated, and the space is cut and divided. This solves the problems of low grid efficiency and repeated cutting of vector data in the existing technology, and achieves a more efficient gridding and precise analysis options.
Patent Information
- Application Number
- CN202410940898.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-15
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-15
AI Technical Summary
The existing gridding method for two-dimensional surface vector data is inefficient. Multi-scale cropping of the same element results in repeated cutting at the same position and lacks progression and inheritance.
Using the area vector data gridding method, by obtaining area coverage elements, calculating the grid set, constructing the element set of grid dividing lines, performing spatial cutting, extracting the outer and inner ring features, and dividing them into internal and External mesh and process it to improve meshing efficiency and avoid repeated cutting.
It improves the gridding efficiency of vector surface data, provides more diverse spatial analysis options, avoids the problem of repeated cutting at the same position, and achieves more accurate gridding.
Smart Images

Figure CN118467666B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of information data processing, and in particular to a method, device and equipment for gridding planar vector data. Background Art
[0002] As a spatial mapping method that conforms to the characteristics of spatiotemporal information data, geographic grids are widely used in data storage, data management, information association, and information exchange. In practical applications, geographic gridding is often used in the organization and management of geographic spatial data, and the vector and raster data of each administrative area are stored and scheduled according to multi-level geographic grids. In data retrieval, geographic coding is applied to the metadata information of spatiotemporal data in the form of arrays, relying on relational databases to achieve fast and efficient remote sensing data retrieval. Therefore, the use of geographic grids to achieve rapid gridding of spatial elements is of great significance for achieving a unified base, assigning unique identifiers, and carrying out multi-source data fusion in the planning field. However, the existing gridding methods for two-dimensional surface vector data still have great limitations. For example, by traversing the grid elements, clipping the selected polygonal elements one by one, and then obtaining the graphic area in each cell, a large number of spatial Boolean operations increase the cost of calculation; for example, in the traditional grid system, the multi-scale grid clipping work of the same element is not progressive and inherited, resulting in repeated cutting at the same location. Summary of the invention
[0003] The purpose of the embodiments of the present application is to provide a method, device and equipment for gridding planar vector data, so as to solve the problem that the existing vector data gridding methods have low gridding efficiency for vector surface data and the multi-scale grid clipping of the same element causes repeated cutting at the same position.
[0004] In a first aspect, an embodiment of the present application provides a method for gridding planar vector data, comprising:
[0005] Acquire the planar covering elements and calculate the grid set of the covering elements to obtain a high-level gridded element set;
[0006] Based on the grid generation rule, a grid generation line element set is constructed as a scan line element set;
[0007] Perform spatial cutting of the scan line feature set, and extract outer ring features and inner ring features from the obtained scan line cutting results;
[0008] According to the scan line cutting result, the scan line feature set is divided into an inner grid and an outer grid, and the outer grid and the inner grid are processed so as to mesh the outer grid and the inner grid.
[0009] In the above implementation process, the planar covering elements are obtained and the grid set of the covering elements is calculated to obtain a high-level gridded element set; based on the grid division rules, the element set of the grid division lines is constructed as the scan line element set; the scan line element set is spatially cut, and the outer ring features and the inner ring features are extracted from the obtained scan line cutting results; according to the scan line cutting results, the scan line element set is divided into an internal grid and an external grid, and the external grid and the internal grid are processed to grid the external grid and the internal grid; the gridding efficiency of vector surface data is improved, and by classifying the grids, more diverse options are provided for the spatial analysis of the gridded elements to avoid the problem of repeated cutting at the same position.
[0010] Furthermore, the step of obtaining planar covering elements and calculating a grid set of covering elements to obtain a high-level gridded element set includes:
[0011] Obtain the planar coverage elements and use Beidou geographic grid coding to calculate the grid set of coverage elements;
[0012] By performing spatial Boolean operations on the grid set covering the elements, a high-level gridded element set of the elements is obtained.
[0013] In the above implementation process, a high-level grid feature set is calculated to obtain the feature set so as to divide the feature set to construct scan lines and classify the grid.
[0014] Furthermore, the grid set of coverage elements calculated by using Beidou geographic grid coding includes:
[0015] According to the four-dimensional range of the coverage element of the geographic grid, read the coordinates of the four corner points and calculate the positions of the first-level grid where the coordinates of the four corner points are located;
[0016] The minimum rectangular range of the first-level Beidou geographic grid covering the element is calculated through Beidou geographic grid coding.
[0017] The intersection points are obtained according to the spatial Boolean operation, and the covering elements are divided into one or more primary grid sets to obtain the grid sets of the covering elements.
[0018] In the above implementation process, the grid set of covering elements is calculated, so as to further obtain a high-level gridded element set and realize more accurate vector surface data gridding.
[0019] Furthermore, the step of constructing a grid line element set as a scan line element set based on a grid division rule includes:
[0020] According to the division relationship from Beidou high-level grid to low-level grid in the east-west direction, a grid division line feature set is constructed as a scan line feature set;
[0021] The element set for constructing the grid division line includes:
[0022] According to the division relationship of Beidou from the upper grid to the lower grid in the longitude direction, the scanning interval is delineated, and according to the length limit of the upper grid in the latitude and longitude directions, the scanning area is constrained to construct the element set of the grid division line.
[0023] In the above implementation process, scanning lines are obtained to perform spatial cutting, thereby classifying the grids and avoiding the problem of repeated cutting at the same position.
[0024] Furthermore, the spatial cutting of the scan line feature set and the extraction of outer ring features and inner ring features from the obtained scan line cutting results include:
[0025] Perform spatial Boolean operations on high-level grid elements and scan line element sets to obtain the longitude direction cutting results of the grid elements of this level converted to the next level grid, which are called scan line cutting results;
[0026] The inner ring and outer ring are extracted from the scan line cutting result, and the line segments of the outer ring that overlap with the scan line are deleted, so that the outer ring is disconnected where it touches the scan line, and forms a ring line geometry set with the inner ring. The distribution of the ring line geometry set constitutes the outer ring features and inner ring features of the cutting result.
[0027] In the above implementation process, the outer ring features and inner ring features are extracted from the scan line cutting results to achieve accurate classification of the grid, providing more diverse options for the spatial analysis of grid elements.
[0028] Furthermore, after performing spatial cutting of the scan line feature set and extracting outer ring features and inner ring features from the obtained scan line cutting results, the method further includes:
[0029] Using the latitudinal coverage of the scan line cutting result, the number and position of the grids in the coverage area are calculated, and the grids in the coverage area are marked as element-related grids;
[0030] Traverse the loop geometry segments, calculate the coverage of its segments, and mark the coverage area grid.
[0031] In the above implementation process, the outer ring features and inner ring features of the scan line cutting result are marked according to the dimensional direction, so as to facilitate the subsequent meshing.
[0032] Furthermore, the scanning line element set is divided into an internal grid and an external grid according to the scanning line cutting result, including:
[0033] Determine whether the geographic grid is covered by the scan line cutting result, and divide it into elements involving grids and elements not involving grids. If the elements do not involve grids, no gridding is required. If the elements involve grids, the topological relationship between the grid and the elements is distinguished.
[0034] According to whether the grid is marked by the ring geometry, the grid involved in the feature is divided into internal grid and external grid. The area covered by the ring geometry is the external grid, the external grid involves the inner ring and the boundary ring, and the area not covered by the ring geometry is the internal grid.
[0035] In the above implementation process, the scan line feature set is divided into an inner grid and an outer grid, which facilitates further classification of the grids.
[0036] Further, the processing of the external grid and the internal grid to mesh the external grid and the internal grid includes:
[0037] Use spatial Boolean operations to mesh the external grid. If the next level of meshing is required, continue to construct the next level of scan lines;
[0038] Use string concatenation to grid the internal grid, use the coverage to calculate the position and four-axis coordinates of the corresponding grid to concatenate the string to grid the internal grid. If the next level of gridding is required, calculate the subdivision relationship from the upper level grid to the lower level grid, and perform hierarchical division.
[0039] In the above implementation process, the external grid and the internal grid are processed to grid the external grid and the internal grid, and the classification of the grid is realized, so as to provide more diverse choices for the spatial analysis of the gridded elements and improve the gridding efficiency of the vector surface data.
[0040] In a second aspect, an embodiment of the present application provides a planar vector data gridding device, comprising:
[0041] An element acquisition module is used to acquire planar covering elements and calculate a grid set of covering elements to obtain a high-level gridded element set;
[0042] A scanning element module is used to construct an element set of meshing lines as a scanning line element set based on meshing rules;
[0043] A feature extraction module is used to perform spatial cutting of the scan line feature set and extract outer ring features and inner ring features from the scan line cutting results;
[0044] The grid processing module is used for dividing the scan line feature set into an internal grid and an external grid according to the scan line cutting result, and processing the external grid and the internal grid to grid the external grid and the internal grid.
[0045] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0046] A processor, a memory and a bus, wherein the processor is connected to the memory via the bus, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement the planar vector data gridding method as described above.
[0047] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a server, the planar vector data gridding method as described above is implemented.
[0048] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein the computer program product comprises instructions, and when the instructions are executed by a computer, the computer implements the method as described above. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] 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 will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0050] Figure 1 A schematic diagram of a process of a planar vector data gridding method provided in an embodiment of the present application;
[0051] Figure 2 A schematic diagram of a flow chart of another planar vector data gridding method provided in an embodiment of the present application;
[0052] Figure 3 A schematic diagram of a flow chart of another planar vector data gridding method provided in an embodiment of the present application;
[0053] Figure 4 A schematic diagram of a flow chart of another planar vector data gridding method provided in an embodiment of the present application;
[0054] Figure 5 A schematic diagram of a process for determining multi-scale gridding of vector surface elements provided in an embodiment of the present application;
[0055] Figure 6 A schematic diagram of a flow chart of a grid coverage marking process provided in an embodiment of the present application;
[0056] Figure 7A schematic diagram of a process for extracting and cutting inner and outer ring features to classify meshes provided in an embodiment of the present application;
[0057] Figure 8 It is a structural schematic diagram of a planar vector data gridding device provided in an embodiment of the present application;
[0058] Fig. 9 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.
[0060] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0061] Please see Figure 1 , Figure 1 A schematic diagram of a process flow of a planar vector data gridding method provided in an embodiment of the present application. The planar vector data gridding method comprises:
[0062] 100. Acquire the planar covering elements and calculate the grid set of the covering elements to obtain a high-level gridded element set.
[0063] Specifically, the surface coverage element data is obtained, which is vector data, and the grid of the surface coverage element is calculated, and the high-level grid element set is further calculated. It should be noted that the high-level gridded element set is the highest level in the required gridding level. For example, if the element gridding level is Beidou geographic grid level one to level seven, it is necessary to first perform Boolean operation on the grid to obtain a first-level gridded element set.
[0064] In some embodiments, the method of obtaining planar covering elements and calculating a grid set of covering elements to obtain a high-level gridded element set includes: obtaining planar covering elements, calculating a grid set of covering elements using Beidou geographic grid coding; and obtaining a high-level gridded element set of elements by performing spatial Boolean operations on the grid set of covering elements.
[0065] In some embodiments, please refer to Figure 2 , the grid set for calculating coverage elements using Beidou geographic grid coding includes:
[0066] 110. According to the four boundaries of the coverage elements of the geographic grid, read the coordinates of the four corner points and calculate the positions of the first-level grid where the coordinates of the four corner points are located.
[0067] Specifically, read the coordinates of the four corner points of the covering element, that is, read the four coordinates of the upper left, lower left, upper right, and lower right.
[0068] 120. Calculate the minimum rectangular range of the first-level Beidou geographic grid covering the element through Beidou geographic grid coding.
[0069] 130. According to the spatial Boolean operation, the intersection points are obtained and the covering elements are divided into one or more primary grid sets to obtain the grid sets of the covering elements.
[0070] For example, to obtain the coverage grid set of a feature, it is necessary to calculate the number of grids between the four corner points (upper left, lower left, upper right, and lower right) of the face feature in the longitude and latitude directions. By default, the feature is divided from level 1 to level j grids, and the method for calculating the number of grids between the same level grids in the longitude and latitude directions is as follows:
[0071] The difference between the grid coefficients of two geographic grids in the longitude direction:
[0072] ;
[0073] The difference in grid coefficients of two geographic grids in the latitude direction:
[0074] ;
[0075] The number of grids between two geographic grids in longitude or latitude:
[0076] ;
[0077] in, is the grid coefficient vector in the longitude direction for the geographic grid code a, The coefficient vector for the geographic grid code b in the latitude direction; is the grid coefficient vector in the latitude direction for the geographic grid code a, The coefficient vector of geographic grid code b in the latitude direction. The lower grid converts the code into coefficients based on the upper grid. The first-level grid takes the prime meridian as the starting point of the longitude coefficient and the equator as the starting point of the latitude coefficient.
[0078] yes or The difference in grid coefficients at level i, It is the division relationship (ratio) from level i grid to level j grid in the longitude or latitude direction.
[0079] 200. Based on the grid generation rule, a grid generation line feature set is constructed as a scan line feature set.
[0080] In some embodiments, constructing a gridding line element set as a scan line element set based on a gridding rule includes:
[0081] 210. According to the division relationship from Beidou high-level grid to low-level grid in the east-west direction, a grid division line feature set is constructed as a scan line feature set.
[0082] The element set for constructing the grid division line includes:
[0083] 211. According to the division relationship of Beidou from the upper grid to the lower grid in the longitude direction, the scanning interval is delineated, and the scanning area is constrained according to the length limit of the upper grid in the latitude and longitude directions to construct the element set of the grid division line.
[0084] Exemplarily, the scanning interval is defined according to the division relationship between the Beidou upper-level grid and the lower-level grid in the longitude direction and the spatial range of the upper-level grid. For example, the second-level grid division needs to divide the 6°×4° area into 15×12 second-level grids. Therefore, each second-level grid corresponds to a 30′×30′ grid, and each scanning interval of the first-level grid corresponds to 12 6°×30′ scanning areas, which correspond to 13 scanning lines.
[0085] As described above, the scanning area is constrained according to the length limit of the upper grid in the latitudinal and longitudinal directions to ensure that the scanning area exists only within the grid, and no fine gaps or overlapping coverage will occur in the scanning area.
[0086] Among them, constructing the element set of grid subdivision lines includes: recording the geometric features of the meridians on the left and right sides of each scanning interval to construct a scanning line element set; traversing each scanning interval, cutting the elements in the first-level grid according to the left and right meridians of the scanning interval, and adding the cutting results to the cutting results according to the type of geometric elements.
[0087] For example, if the type of the cut geometric element is Polygon, it is directly added to the cutting result set. If the cutting result is MultiPolygon, it is necessary to separate the geometric elements according to their internal connectivity, divide the MultiPolygon into multiple Polygons, and then add them to the cutting result set.
[0088] 300. Perform spatial cutting of the scan line feature set, and extract outer ring features and inner ring features from the scan line cutting results.
[0089] In some embodiments, please refer to Figure 3The spatial cutting of the scan line feature set and the extraction of outer ring features and inner ring features from the scan line cutting results include:
[0090] 310. Perform spatial Boolean operations on high-level grid elements and scan line element sets to obtain the longitude direction cutting results of the transformation of the grid elements of this level to the grid of the next level, which are called scan line cutting results.
[0091] 320. Extract the inner ring and outer ring from the scan line cutting result, and delete the line segment where the outer ring overlaps with the scan line, so that the outer ring is disconnected where it contacts the scan line, and forms a ring line geometry set with the inner ring. The distribution of the ring line geometry set constitutes the outer ring feature and the inner ring feature of the cutting result.
[0092] 330. Using the latitudinal coverage of the scan line cutting result, calculate the number and position of the grids in the coverage area, and mark the grids in the coverage area as element-related grids.
[0093] 340. Traverse the loop geometry segments, calculate the coverage of the segments, and mark the coverage area grid.
[0094] Specifically, for any cutting result, the positions of the left and right meridians of the scanning interval and the range of the scanning interval in the latitude direction are recorded, the inner ring (geometry type: LineString) and outer ring (geometry type: LineString) in the cutting result are extracted, and the line segments on the outer ring that coincide with the scanning line segments are deleted, so that the outer ring is disconnected where it contacts the scanning line, and forms a ring line geometry set with the inner ring, and the inner and outer ring features of the cutting object are obtained. By calculating the minimum and maximum values of the cutting result in the latitude direction, the position and code of the grid covered by the cutting result in the scanning area in the latitude direction are obtained, and the grids in the covered area are marked as grids involved in the element; the ring line geometry segments are traversed, the coverage range of its segments is calculated, and the grids in the covered area are marked.
[0095] Optionally, the method for calculating the coverage range of a line segment includes: calculating the midpoint position of the longitude of the scan line in the scan interval, and recording the maximum latitude value and the minimum latitude value of the midpoint position of the line segment as a marking point, calculating the geographic grid code of the two points and calculating the number of grids between the two points in the latitude direction, and calculating the IDs of all grids, and using all grids between the two points as marking grids.
[0096] 400. According to the scan line cutting result, the scan line feature set is divided into an inner grid and an outer grid, and the outer grid and the inner grid are processed to mesh the outer grid and the inner grid.
[0097] In some embodiments, please refer to Figure 4, the scanning line feature set is divided into an internal grid and an external grid according to the scanning line cutting result, including:
[0098] 410. Determine whether the geographic grid is covered by the scan line cutting result, and divide it into the grid involved by the elements and the grid not involved by the elements. If the grid is not involved by the elements, gridding is not required. If the grid is involved by the elements, the topological relationship between the grid and the elements is distinguished.
[0099] 420. According to whether the grid is marked by the ring geometry, the grid involved in the element is divided into an internal grid and an external grid, where the area covered by the ring geometry is the external grid, the external grid involves the inner ring and the boundary ring, and the area not covered by the ring geometry is the internal grid.
[0100] 430. Use spatial Boolean operations to grid the external grid. If the next level of gridding is required, continue to construct the next level of scan lines.
[0101] Optionally, if you need to achieve the next level of gridding, you need to build the next level of scan lines, repeat scanning, cutting, and judgment, add the new external grid to the list of pending spatial operations, and use the coordinates of the four points of the new internal grid to complete the splicing of the grid geometry JSON.
[0102] 440. Use string concatenation to grid the internal grid, use the coverage to calculate the position and four-axis coordinates of the corresponding grid to concatenate the string to grid the internal grid. If the next level of gridding is required, calculate the subdivision relationship from the upper level grid to the lower level grid, and perform hierarchical division.
[0103] Optionally, use JSON string to implement gridding. Optionally, if you need to implement the next level of gridding, you only need to calculate the subdivision relationship from the upper grid to the lower grid, and subdivide it layer by layer until the gridding stops at the specified grid level.
[0104] If multi-scale gridding is required, based on the above work, the boundary grid is scanned and classified at the next level according to the new subdivision relationship, and the steps are the same as above. The internal grid creates a new JSON format string according to the new subdivision relationship, and the coordinates of the corner points of the four sides are determined according to the subdivision relationship, and the corresponding geocoding is calculated.
[0105] For example, please refer to Figure 5 , the embodiment of the present application provides an example of determining multi-scale gridding of vector surface elements:
[0106] 510. Get the geometry object of the i-level grid.
[0107] It should be noted that the embodiment of the present application uses Beidou 2D grid coding and adopts seven-level grid hierarchical cutting, and the i-level grid is any level grid greater than the 7-level grid. According to the level-by-level scanning and cutting of the previous level grid, the boundary grid is subjected to spatial operation cutting to obtain the geometric object of the i-level grid.
[0108] However, for the first-level grid elements that do not have a superior subdivision relationship, the boundaries of the elements are determined, the coverage of the elements is calculated through the geographic grid coding module, the first-level grid set corresponding to the elements is obtained, and the cutting is implemented.
[0109] 520. Perform i+1 level gridding process on i level grid.
[0110] It should be noted that the scanning lines and scanning intervals must be constructed through the division relationship from the i-level grid to the i+1-level grid, and the i-level grid elements are cut to obtain the cutting elements of each scanning interval.
[0111] Among them, the cut elements need to determine the covering grid and mark the grid. At the same time, the features of the inner and outer rings must be extracted to classify the internal and external grids.
[0112] If it is an internal grid, it needs to be added to the internal grid collection, and divided into lower-level grids according to the four corner points of the grid in JSON format, and the division continues until the level of the specified minimum grid is reached; if it is an external grid, the next step of scanning operation is required.
[0113] Among them, the scanning line cutting method for elements includes: spatial Boolean operations on two-dimensional surface elements and line elements, operations for extracting inner and outer rings of elements and finding intersections with the scanning line, and methods for decomposing elements into triangles and then performing spatial operations.
[0114] 530. Determine the covering grid of the cutting result.
[0115] It should be noted that the following Figure 5 As shown, determining the coverage grids of the cutting result only requires determining the grids covered by the cutting result in the latitude direction. By calculating the grid codes of the highest latitude point and the lowest latitude point of the cutting result, the number of grids covered between the grids can be calculated.
[0116] 540. Mark the cutting results in the latitude direction, calculate the four coordinates of the geometric body X, and mark the cut elements according to the number of divisions in the latitude direction of the current level grid, as follows Figure 6 As shown, the position mark of the geometric body X is obtained, and the marked position is classified into a set A, in which the red grid is the coverage grid of the geometric body X in the latitude direction, and the white grid represents the grid that is not covered.
[0117] 550. Extract the outer ring and inner ring contours of the cutting result.
[0118] 560. Extract the inner and outer ring features of the cutting result.
[0119] It should be noted that the inner and outer ring features of the geometric body include the outer ring and the inner ring. The operation of subtracting the left and right scan lines is performed on the outer ring to obtain the line segment geometric body Y. The position of the geometric body B is also recorded. The marked positions are classified into set B, as follows Figure 7 As shown, the red grid is the coverage grid of geometry Y in the latitude direction, that is, the boundary grid of geometry X, the white grid represents the grid that is not covered, and the green grid is the internal grid of geometry X.
[0120] 570. Classify the grid.
[0121] It should be noted that all meshes in set A and set B are considered boundary meshes, meshes in set A but not in set B are considered internal meshes, and meshes not in set A are non-object meshes, so no operation is performed. If it is a boundary mesh, a spatial intersection operation is performed. If it is an internal mesh, the spatial intersection operation is not performed, and the JSON strings of the four points of the mesh are concatenated.
[0122] In the above implementation process, the planar covering elements are obtained and the grid set of the covering elements is calculated to obtain a high-level gridded element set; based on the grid division rule, the element set of the grid division line is constructed as the scan line element set; the scan line element set is spatially cut, and the outer ring features and the inner ring features are extracted from the obtained scan line cutting results; according to the scan line cutting results, the scan line element set is divided into an internal grid and an external grid, and the external grid and the internal grid are processed to grid the external grid and the internal grid; the upper-level grid can undergo multiple scans and multiple classifications, and has the opportunity to be classified as an internal grid in the lower-level grid, and once it is identified as an internal grid, there is no need to perform spatial operations until the level to be minimum gridded, which improves the gridding efficiency compared to the traditional clipping method; by classifying the grids, more diverse options are provided for the spatial analysis of the gridded elements to avoid the problem of repeated cutting at the same position.
[0123] The above steps are not to be performed in a strict order as described in the numbers, but should be understood as an overall solution.
[0124] In the second aspect, based on the above embodiments, Figure 8 This is a schematic diagram of the structure of a planar vector data gridding device provided in an embodiment of the present application. Figure 8 The planar vector data gridding device provided in this embodiment specifically includes: an element acquisition module 801, a scanning element module 802, a feature extraction module 803 and a grid processing module 804.
[0125] Among them, the feature acquisition module 801 is used to obtain the planar covering features and calculate the grid set of the covering features to obtain a high-level gridded feature set; the scanning feature module 802 is used to construct an element set of grid division lines as a scanning line feature set based on the grid division rules; the feature extraction module 803 is used to perform spatial cutting of the scanning line feature set, and extract the outer ring features and the inner ring features of the obtained scanning line cutting results; the grid processing module 804 is used to divide the scanning line feature set into an internal grid and an external grid according to the scanning line cutting results, and process the external grid and the internal grid to grid the external grid and the internal grid.
[0126] As described above, the embodiment of the present application obtains planar covering elements and calculates the grid set of covering elements to obtain a high-level gridded element set; based on the grid division rules, constructs an element set of grid division lines as a scan line element set; performs spatial cutting of the scan line element set, and extracts outer ring features and inner ring features from the obtained scan line cutting results; according to the scan line cutting results, divides the scan line element set into an internal grid and an external grid, and processes the external grid and the internal grid to grid the external grid and the internal grid; improves the gridding efficiency of vector surface data, and provides more diverse options for spatial analysis of gridded elements by classifying grids, avoiding the problem of repeated cutting at the same position.
[0127] The planar vector data gridding device provided in the embodiment of the present application can be used to execute the planar vector data gridding method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0128] In a third aspect, an embodiment of the present application further provides an electronic device that can integrate the planar vector data gridding device provided in an embodiment of the present application. Fig. 9 Schematic diagram of the structure of an electronic device provided by an embodiment of the present application. Fig. 9 The electronic device includes: an input device 93, an output device 94, a memory 92 and one or more processors 91; the memory 92 is used to store one or more programs; when the one or more programs are executed by the one or more processors 41, the one or more processors 91 implement the planar vector data gridding method provided in the above embodiment. The input device 93, the output device 94, the memory 92 and the processor 91 can be connected by a bus or other means. Fig. 9 The example of connecting through bus is taken in the following.
[0129] The processor 91 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 92, that is, realizes the above-mentioned planar vector data gridding method.
[0130] The electronic device provided above can be used to execute the planar vector data gridding method provided in the above embodiment, and has corresponding functions and beneficial effects.
[0131] In a fourth aspect, an embodiment of the present application also provides a computer-readable storage medium, which includes a stored computer program; wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the planar vector data gridding method as described above, and can achieve the same beneficial effects.
[0132] Of course, the storage medium containing computer executable instructions provided in an embodiment of the present application, whose computer executable instructions are not limited to the planar vector data gridding method described above, can also execute related operations in the planar vector data gridding method provided in any embodiment of the present application.
[0133] In a fifth aspect, the embodiments of the present application also provide a computer program product, and the methods described in the various embodiments of the present application can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the processes or functions described in the various embodiments of the present application are executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer grid, a grid device, a user device, a core network device, an OAM (Open Application Model) or other programmable device.
[0134] The computer program or instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid-state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0135] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0136] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0137] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling an electronic device (which can be a personal computer, server, or grid device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, and other media that can store program codes.
[0138] The above description is only an embodiment of the present application and is not intended to limit the scope of protection of the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the scope of protection of the present application. It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0140] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
Claims
1. A method for gridding planar vector data, characterized in that: include: Acquire the planar covering elements and calculate the grid set of the covering elements to obtain a high-level gridded element set; Based on the grid generation rule, a grid generation line element set is constructed as a scan line element set; Perform spatial cutting of the scan line feature set, and extract outer ring features and inner ring features from the obtained scan line cutting results; According to the scan line cutting result, the scan line feature set is divided into an inner grid and an outer grid, and the outer grid and the inner grid are processed so as to mesh the outer grid and the inner grid; The step of performing spatial cutting of the scan line feature set and extracting outer ring features and inner ring features from the obtained scan line cutting results includes: Perform spatial Boolean operations on high-level grid elements and scan line element sets to obtain the longitude direction cutting results of the grid elements of this level converted to the next level grid, which are called scan line cutting results; Extract the inner ring and outer ring from the scan line cutting result, and delete the line segment where the outer ring overlaps with the scan line, so that the outer ring is disconnected where it touches the scan line, and forms a ring line geometry set with the inner ring. The distribution of the ring line geometry set constitutes the outer ring feature and inner ring feature of the cutting result; The meshing of the external mesh and the internal mesh comprises: The outer mesh is meshed using spatial Boolean operations, and the inner mesh is meshed using string concatenation.
2. The planar vector data gridding method according to claim 1, characterized in that: The method of obtaining planar covering elements and calculating a grid set of covering elements to obtain a high-level gridded element set includes: Obtain the planar coverage elements and use Beidou geographic grid coding to calculate the grid set of coverage elements; By performing spatial Boolean operations on the grid set covering the elements, a high-level gridded element set of the elements is obtained.
3. The planar vector data gridding method according to claim 2, characterized in that: The grid set for calculating coverage elements using Beidou geographic grid coding includes: According to the four-dimensional range of the coverage element of the geographic grid, read the coordinates of the four corner points and calculate the positions of the first-level grid where the coordinates of the four corner points are located; Calculate the minimum rectangular range of the first-level Beidou geographic grid covering the element through Beidou geographic grid coding; The intersection points are obtained according to the spatial Boolean operation, and the covering elements are divided into one or more primary grid sets to obtain the grid sets of the covering elements.
4. The planar vector data gridding method according to claim 1, characterized in that: The step of constructing a grid line element set as a scan line element set based on a grid generation rule includes: According to the division relationship from Beidou high-level grid to low-level grid in the east-west direction, a grid division line feature set is constructed as a scan line feature set; The element set for constructing the grid division line includes: According to the division relationship of Beidou from the upper grid to the lower grid in the longitude direction, the scanning interval is delineated, and according to the length limit of the upper grid in the latitude and longitude directions, the scanning area is constrained to construct the element set of the grid division line.
5. The planar vector data gridding method according to claim 1, characterized in that: After performing spatial cutting of the scan line feature set and extracting outer ring features and inner ring features from the obtained scan line cutting results, the method further includes: Using the latitudinal coverage of the scan line cutting result, the number and position of the grids in the coverage area are calculated, and the grids in the coverage area are marked as element-related grids; Traverse the loop geometry segments, calculate the coverage of its segments, and mark the coverage area grid.
6. The planar vector data gridding method according to claim 5, characterized in that: The scanning line element set is divided into an internal grid and an external grid according to the scanning line cutting result, including: Determine whether the geographic grid is covered by the scan line cutting result, and divide it into elements involving grids and elements not involving grids. If the elements do not involve grids, no gridding is required. If the elements involve grids, the topological relationship between the grid and the elements is distinguished. According to whether the grid is marked by the ring geometry, the grid involved in the feature is divided into internal grid and external grid. The area covered by the ring geometry is the external grid, the external grid involves the inner ring and the boundary ring, and the area not covered by the ring geometry is the internal grid.
7. The planar vector data gridding method according to claim 6, characterized in that: The processing of the external mesh and the internal mesh to mesh the external mesh and the internal mesh comprises: After meshing the external grid using spatial Boolean operations, if the next level of meshing is required, the next level of scan lines will continue to be constructed; The coverage range is used to calculate the position and four-axis coordinates of the corresponding grid to concatenate the character string to grid the internal grid. If the next level of gridding is required, the subdivision relationship from the upper grid to the lower grid is calculated and hierarchical division is performed.
8. A planar vector data gridding device, characterized in that: include: An element acquisition module is used to acquire planar covering elements and calculate a grid set of covering elements to obtain a high-level gridded element set; A scanning element module is used to construct an element set of meshing lines as a scanning line element set based on meshing rules; A feature extraction module is used to perform spatial cutting of the scan line feature set and extract outer ring features and inner ring features from the scan line cutting results; A mesh processing module is used for dividing the scan line feature set into an internal mesh and an external mesh according to the scan line cutting result, and processing the external mesh and the internal mesh to mesh the external mesh and the internal mesh; The step of performing spatial cutting of the scan line feature set and extracting outer ring features and inner ring features from the obtained scan line cutting results includes: Perform spatial Boolean operations on high-level grid elements and scan line element sets to obtain the longitude direction cutting results of the grid elements of this level converted to the next level grid, which are called scan line cutting results; Extract the inner ring and outer ring from the scan line cutting result, and delete the line segment where the outer ring overlaps with the scan line, so that the outer ring is disconnected where it touches the scan line, and forms a ring line geometry set with the inner ring. The distribution of the ring line geometry set constitutes the outer ring feature and inner ring feature of the cutting result; The meshing of the external mesh and the internal mesh comprises: The outer mesh is meshed using spatial Boolean operations, and the inner mesh is meshed using string concatenation.
9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the processor is connected to the memory via the bus, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, they are used to implement the planar vector data gridding method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the server, the planar vector data gridding method according to any one of claims 1 to 7 is implemented.
11. A computer program product, characterized in that The computer program product comprises instructions, which, when executed by a computer, enable the computer to implement the planar vector data gridding method according to any one of claims 1 to 7.
