Multi-level surface element cutting method and device based on graphic attributes and subordination relationships

The method addresses data integrity and efficiency issues in multi-layer geospatial cutting by using geometric attributes and hierarchical relationships to encode and process geographic entities, ensuring data association and adaptability to complex changes.

CN119988517BActive Publication Date: 2025-07-15THREE-BODY SMART NETWORK TECH (SUZHOU) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510484954.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-17
Publication Date
2025-07-15
Estimated Expiration
2045-04-17

AI Technical Summary

Technical Problem

It is difficult for the prior art to realize the correlation and integrity of data between multiple layers, especially in the process of cutting statistical units, where geographical entities are divided into multiple elements, and traditional methods cannot guarantee the correlation and integrity of data before and after cutting.

Method used

Through a multi-level polygon feature cutting method based on graphic attributes and subordinate relationships, using the encoding of the shp file and the wkb format, an overlaps hash table is built, the spatial relationship between high-level and low-level graphic features is checked, the deletion, addition and attribute inheritance lists are generated, layer cutting and data format conversion are performed, and the result data set is generated.

Benefits of technology

The data correlation and integrity of multi-level polygon feature cutting is realized, multi-level synchronous update is supported, and manual intervention is significantly reduced. It is suitable for complex and high-frequency multi-layer management scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119988517B_ABST
    Figure CN119988517B_ABST
Patent Text Reader

Abstract

The present application discloses a multi-level surface element cutting method and device based on graphic attributes and subordination relationships, which relates to the field of geographic information. The method includes: encoding graphic elements according to the subordination relationships of each layer; traversing all layers in a double loop, checking the spatial relationships of graphic elements between the high-level layer and the low-level layer with subordination relationships, constructing an overlaps hash table and an attribute change list, and obtaining a deletion element list from the overlaps hash table; traversing the overlaps hash table, screening the graphic elements of the low-level layer that overlap with multiple high-level layers, and obtaining a new element list; performing element deletion, element addition, and attribute inheritance operations on the layers. Through attribute inheritance and relationship maintenance, the present invention can ensure data relevance and integrity, while supporting multi-level synchronous update, significantly reducing manual intervention. Therefore, the surface element cutting method disclosed by the present invention has dynamic adaptability and can be applied to complex and high-frequency changing multi-layer management scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of geographic information technology, and particularly to a multi-level surface element cutting method and device based on graphic attributes and subordinate relationships. Background Art

[0002] Geographic information is the general term for numbers, texts, images, graphics, etc. that express the quantity, quality, distribution characteristics, interrelationships, and change laws of various elements of a geographic system. Simply put, it is information about natural and human geographic phenomena on the earth. Geographic information includes geographic entities, which refer to natural or artificial features with relatively stable spatial ranges or boundaries, with or without clear identification, and with independent monitoring and statistical analysis significance, such as rivers, roads, urban comprehensive functional units, development zones, nature reserves, etc.

[0003] Geographic entities are stored and expressed in the form of points, lines, and surfaces according to their respective collection requirements. Geographic entities are continuous and complete in the objective world, but in the process of data collection and statistics, they need to rely on certain statistical units for expression and organization. There are a large number of geographic entities that are cut by statistical units, and problems are likely to occur in the statistical process. The current geographic entity statistical method relies on GIS statistical software, uses the basic statistical unit (such as the county-level administrative boundary) as the statistical scope, and directly calculates the quantity indicators such as the number, length, and area of natural resource survey and monitoring geographic entities according to their respective statistical models, and then summarizes them level by level to form statistical results at different levels. In the statistical process, taking the statistical unit as the physical storage scope of the data source to be statistically analyzed, there is a common situation where continuous natural resource geographic entities are cut at the boundary. For example, a nature reserve straddles two counties and is divided into two statistical units.

[0004] However, when the same geographic entity is divided into multiple elements, the traditional method only cuts based on the graphic attributes of the elements, making it difficult to ensure the relevance and integrity of the data before and after cutting. In addition, the traditional method can only achieve cutting between two layers and cannot perform layer-by-layer cutting for multiple layers at one time. Summary of the Invention

[0005] Based on this, in view of the above technical problems, it is necessary to provide a multi-level surface element cutting method and device based on graphic attributes and subordinate relationships, which can ensure the cutting efficiency and the data quality after cutting.

[0006] In a first aspect, the present application provides a multi-level surface element cutting method based on graphic attributes and subordinate relationships. The method includes:

[0007] Encoding graphic elements according to the subordinate relationships of each layer in the shp file, and converting the shp file containing the encoding information into the wkb format;

[0008] Traverse all layers in a double - layer loop based on the WKB format, check the spatial relationship of graphic elements between the high - level layer and the low - level layer with a subordinate relationship, construct an overlaps hash table for the overlapping high - level layer and low - level layer according to the spatial relationship, obtain a list of elements to be deleted from the overlaps hash table, and construct a list of attribute changes for the high - level layer and low - level layer that contain each other according to the spatial relationship;

[0009] Traverse the overlaps hash table, filter the graphic elements of the low - level layer that overlap with multiple high - level layers, and obtain a list of new elements;

[0010] Perform operations of element deletion, element addition, and attribute inheritance on the layer according to the list of elements to be deleted, the list of attribute changes, and the list of new elements, and generate a result data set;

[0011] Perform data format conversion on the result data set and export the shp file after cutting the complete - surface elements.

[0012] In one embodiment, encode the graphic elements according to the subordinate relationship of each layer in the shp file, including:

[0013] Sort out the subordinate relationship between each layer;

[0014] Encode the surface elements on each layer to obtain an initial number;

[0015] Encode the surface elements in combination with the subordinate relationship between the layers to obtain an element number;

[0016] Among them, the element number corresponding to the surface element of the current layer is composed of the concatenation of the element number of the upper layer and the initial number of the current layer.

[0017] In one embodiment, traverse all layers in a double - layer loop, and check the spatial relationship of graphic elements between the high - level layer and the low - level layer with a subordinate relationship, including:

[0018] Traverse all graphic elements of the high - level layer to obtain the first geometric data corresponding to the graphic elements of the high - level layer;

[0019] Traverse all graphic elements of the low - level layer to obtain the second geometric data corresponding to the graphic elements of the low - level layer;

[0020] Check the spatial relationship of graphic elements between the high - level layer and the low - level layer according to the first geometric data and the second geometric data.

[0021] In one embodiment, construct an overlaps hash table for the overlapping high - level layer and low - level layer according to the spatial relationship, and obtain a list of elements to be deleted from the overlaps hash table, including:

[0022] Create an overlaps hash table, define the key as the graphic elements of the lower-level layer and the value as a list of graphic elements of the higher-level layer;

[0023] In each loop, when the graphic elements of the higher-level layer and the lower-level layer are in an overlapping relationship, record the graphic elements of the higher-level layer as the value under the corresponding key of the graphic elements of the lower-level layer, and update the overlaps hash table;

[0024] After traversing all layers through a double loop, obtain the list of elements to be deleted according to the set of keys in the current overlaps hash table.

[0025] In one embodiment, obtaining the list of newly added elements includes:

[0026] Take the graphic elements of the lower-level layer that overlap with multiple higher-level layers as target elements, obtain the corresponding wkb geometric data of the target elements and convert them into JTS Geometry objects;

[0027] Traverse all the graphic elements of the higher-level layer that overlap with the target elements, obtain the geometric intersection with the target elements, and generate a list of newly added elements.

[0028] In one embodiment, the method further includes:

[0029] Traverse the geometric bodies in the list of newly added elements, filter out the geometric bodies with an area smaller than the threshold, and update the list of newly added elements.

[0030] In a second aspect, the present application also provides a multi-level surface element cutting device based on graphic attributes and subordination relationships. The device includes:

[0031] An encoding module for encoding graphic elements according to the subordination relationships of each layer in the shp file and converting the shp file containing encoding information into the wkb format;

[0032] A cutting and attribute inheritance module for traversing all layers in a double loop based on the wkb format, checking the spatial relationships of graphic elements between the higher-level layer and the lower-level layer with subordination relationships, constructing an overlaps hash table for the overlapping higher-level layer and lower-level layer according to the spatial relationships, obtaining the list of elements to be deleted from the overlaps hash table, and constructing a list of attribute changes for the included higher-level layer and lower-level layer according to the spatial relationships;

[0033] A new addition module for traversing the overlaps hash table, screening the graphic elements of the lower-level layer that overlap with multiple higher-level layers, and obtaining the list of newly added elements;

[0034] An execution module, configured to perform element deletion, element addition, and attribute inheritance operations on a layer according to a deletion element list, an attribute change list, and a new element list, and generate a result data set;

[0035] An output module, configured to perform data format conversion on the result data set and export a shp file for cutting completed surface elements.

[0036] In a third aspect, the present application also provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps in the above-mentioned multi-level surface element cutting method based on graphic attributes and subordination relationships are implemented.

[0037] In a fourth aspect, the present application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned multi-level surface element cutting method based on graphic attributes and subordination relationships are implemented.

[0038] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned multi-level surface element cutting method based on graphic attributes and subordination relationships are implemented.

[0039] The above-mentioned multi-level surface element cutting method and device encode graphic elements according to the subordination relationships of each layer in the shp file, convert the shp file containing encoding information into the wkb format; traverse all layers in a double loop based on the wkb format, check the spatial relationships of graphic elements between high-level layers and low-level layers with subordination relationships, construct an overlaps hash table for overlapping high-level layers and low-level layers according to the spatial relationships, and obtain a deletion element list from the overlaps hash table, construct an attribute change list for high-level layers and low-level layers that contain according to the spatial relationships; traverse the overlaps hash table, filter the graphic elements of low-level layers that overlap with multiple high-level layers, and obtain a new element list; perform element deletion, element addition, and attribute inheritance operations on the layer according to the deletion element list, the attribute change list, and the new element list to generate a result data set; perform data format conversion on the result data set and export a shp file for cutting completed surface elements. Through attribute inheritance and relationship maintenance, the present invention can ensure data relevance and integrity, and at the same time support multi-level synchronous update, significantly reducing manual intervention. Therefore, the surface element cutting method disclosed by the present invention has dynamic adaptability and can be applied to complex and frequently changing multi-layer management scenarios. Description of the Drawings

[0040] Figure 1Flow schematic of the multi - level surface feature cutting method based on graphic attributes and subordinate relationships in an embodiment Figure 1 ;

[0041] Figure 2 Flow schematic of the multi - level surface feature cutting method based on graphic attributes and subordinate relationships in an embodiment Figure 2 。 Detailed implementation manners

[0042] In order to make the objectives, technical solutions and advantages of the present application clearer and more understandable, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] The embodiment of the present application provides a multi - level surface feature cutting method based on graphic attributes and subordinate relationships, aiming to make the operation more convenient and achieve automation when maintaining multi - level surface features and facing the need for layer - by - layer synchronous update of subordinate features when the boundary of the superior surface feature changes.

[0044] As Figure 1 shown, the method includes the following steps:

[0045] Step 102, encode the graphic features according to the subordinate relationships of each layer in the shp file, and convert the shp file containing the encoding information into the wkb format.

[0046] Among them, the shp file (Shapefile) is a commonly used vector data storage format in geographic information systems and is a file set composed of multiple files. Among them, the main file (.shp), the index file (.shx) and the attribute file (.dbf) are three essential files, which together constitute the core of the shp file. The main file stores the geometric graphic data of geographic features, such as points, lines, polygons, etc. The index file stores the index information of the geometric graphic data in the main file for quickly locating and accessing records in the main file; the attribute file stores the attribute information of geographic features in the dBase format, such as name, area, population, etc.

[0047] The wkb format (Well - Known Binary) is a binary encoding specification for representing geographic spatial objects. The binary encoding avoids the precision loss problem that may occur during parsing of the text format and can represent geographic objects more precisely.

[0048] A layer is an important concept in a Geographic Information System (GIS), used to store and display geographical information of different types or themes separately. For example, the GIS data of a city may include a road layer, a building layer, a water system layer, etc., and each layer contains specific types of geographical features. Usually, a shp file can be regarded as the data source of a layer, containing the geometries (such as points, lines, polygons) in the shp file and the associated attribute information.

[0049] Graphic features are the actual geographical entities in a shp file, which consist of geometries and related attributes. Geometries describe the spatial location and shape of the features. Graphic features are divided into three types: point features, line features, and polygon features. Point features represent geographical entities with specific locations, having only location without area and length, such as street lamps and weather observation stations in a city. Line features are used to represent linear geographical entities, such as roads and rivers. Line features are composed of a series of sequentially connected coordinate points and have length but no area. Polygon features represent geographical entities with a certain area, such as lakes and administrative regions. Polygon features are composed of a set of closed coordinate points, forming a closed figure. The cutting method proposed in this embodiment mainly targets the polygon features among the graphic features.

[0050] In this embodiment, the graphic features are encoded according to the subordinate relationship of each layer, that is, the encoded graphic features carry the subordinate relationship information between layers. With such information, subsequent operations such as format conversion are carried out, which is more conducive to relationship maintenance and attribute inheritance.

[0051] In one embodiment, a table is created for each layer. Each piece of data in the table represents a graphic feature, and the fields include FID (the ID of the graphic feature), the graphic feature code, GEOM, and other graphic feature attributes. The table is converted into the wkb format. FID does not contain the subordinate relationship information between layers and is a unique identifier to distinguish it from other graphic features. The graphic feature code contains the subordinate relationship information between layers.

[0052] Step 104: Traverse all layers in a double-layer loop based on the wkb format, check the spatial relationship of graphic features between the upper-layer and lower-layer with subordinate relationships, construct an overlaps hash table for the overlapping upper-layer and lower-layer graphic features according to the spatial relationship, obtain the list of elements to be deleted from the overlaps hash table, and construct a list of attribute changes for the upper-layer and lower-layer graphic features with inclusion relationships according to the spatial relationship.

[0053] In a geographic information system, the vertical relationship of layers refers to the stacking order of multiple layers when displayed on a map, and this order directly affects the visual effect and information expression of the map. For two layers with a subordinate relationship, the layer that will cause changes to another layer is regarded as the high-level layer (also referred to as the upper layer in this invention), and the layer that changes due to the change of another layer is regarded as the low-level layer (also referred to as the lower layer in this invention). For example, in terms of administrative region division, after the change of the municipal region, the corresponding district and county divisions will also change, while the re-division of areas between districts will not affect the municipal region division. At this time, the municipal layer is the high-level layer, and the layers of lower administrative levels such as districts and counties are low-level layers. The high-level layer and the low-level layer are in a relative relationship. For a certain layer, when facing other layers with different subordinate relationships, its identity will change. For example, the district layer is a low-level layer relative to the municipal layer and a high-level layer relative to the street layer.

[0054] Through the encoding of graphic elements, the subordinate relationship between layers can be accurately located in the WKB format, so as to subsequently check the spatial relationship of graphic elements between the high-level layer and the low-level layer. Double-layer loop traversal means that for a graphic element of the high-level layer, the spatial relationship between all elements of the low-level layer and this graphic element is checked in turn; then for another graphic element of the high-level layer, the spatial relationship between all graphic elements of the low-level layer and this graphic element is checked in turn; until all graphic elements of the high-level layer are traversed.

[0055] The spatial relationship includes the overlapping relationship and the inclusion relationship. Among them, the overlapping relationship means that a certain graphic element on the low-level layer is partially covered by a graphic element of the high-level layer, and the remaining part is covered by other graphic elements of the high-level layer, that is, it is covered by multiple graphic elements of the high-level layer at the same time. The inclusion relationship means that a certain graphic element on the low-level layer is completely covered by a certain graphic element of the high-level layer.

[0056] By comparing the geometric data between each graphic element of the high-level layer and the low-level layer, the spatial relationship between the graphic elements can be clarified. The geometric data here refers to the GEOM field corresponding to the graphic element.

[0057] When the spatial relationship of the graphic element is overlapping, record the high-level layer FID into the overlaps hash table under the corresponding low-level layer FID. One low-level layer FID may correspond to multiple high-level layer FIDs. Taking administrative region division as an example, normally, the relationship between a city and its subordinate counties should be an inclusion relationship, but if a county is covered by multiple cities, then the polygon element of the county, which is the low-level layer, needs to be cut. This polygon element is regarded as the graphic element that needs to be cut. Through the overlaps hash table, all graphic elements of the low-level layer that need to be cut can be found, so as to obtain the deletion element list removeList.

[0058] When the spatial relationship is inclusion, fill the attributes of the high-level layer into the low-level layer and add them to the attribute change list changeList, which is the basis for attribute inheritance.

[0059] Step 106: Traverse the overlaps hash table, filter the graphic elements of the low-level layer that overlap with multiple high-level layers, and obtain the new element list.

[0060] By performing geometric calculations on the low-level layer and the relevant high-level layers, the new surface elements after cutting can be determined, and the new element list clipList is generated.

[0061] Step 108: Perform element deletion, element addition, and attribute inheritance operations on the layer according to the deleted element list, attribute change list, and new element list to generate the result data set.

[0062] The graphic elements of the original low-level layer are cut according to the boundaries of the graphic elements of the high-level layer. The cutting includes deleting the cut graphic elements and adding the new graphic elements. The cut graphic elements inherit the attribute information of the high-level layer parent element according to the changeList obtained in Step 104, realizing attribute inheritance and relationship maintenance, and ensuring the relevance and integrity of the data.

[0063] In this embodiment, Steps 104 to 108 can be applied to all high-level and low-level layers with a subordinate relationship, so it supports batch linkage operations and multi-level synchronous updates, significantly reducing manual intervention, further ensuring data relevance and integrity, and improving the segmentation efficiency. Attention should be paid to the sequence when dealing with multiple levels. For example, there are 3 levels in total. If the first level changes, two operations are required: first, complete the cutting and attribute inheritance processing between the first and second levels, and then complete the cutting and attribute inheritance processing between the second and third levels.

[0064] Step 110: Convert the data format of the result data set and export the shp file that has completed the cutting of the surface elements.

[0065] Convert the result data set in wkb format into a shp file so that the geographical data in the shp file can be displayed in the form of a map to achieve data visualization.

[0066] In one embodiment, as Figure 2 shown, the multi-level surface element cutting method based on graphic attributes and subordinate relationships includes:

[0067] S1. Sort out the subordinate relationships of the shp layers and encode each graphic element.

[0068] S11. According to the subordinate relationships between the layers, define the surface layer from top to bottom as: the first layer, the second layer,..., the nth layer, the n + 1th layer,....

[0069] S22. Add a subordinate field - element number, abbreviated as ATTR_CODE in this embodiment, to the layer file (shp file) corresponding to each surface element. The coding rules of ATTR_CODE are as follows:

[0070] (1) Each element contained in each layer has a number, here called the initial number. The initial number consists of 4 digits, such as 0001, 0002, 0003... In the same layer file, the element numbers are not repeated.

[0071] (2) ATTR_CODE is composed of the ATTR_CODE of the upper layer and the initial number of the current layer concatenated. For example, if the ATTR_CODE of the upper layer is 0001 and the element numbers of the current layer are 0001, 0002, 0003..., then the values of the ATTR_CODE fields corresponding to the current level are 00010001, 00010002, 00010003... If the current layer is the top layer (without a superior), then ATTR_CODE is equal to the initial number, that is, 0001, 0002, 0003...

[0072] (3) The length of ATTR_CODE is 4*n, where n is a positive integer.

[0073] (4) ATTR_CODE can represent the subordinate relationship of layer elements. For example, if the ATTR_CODE of an element is 000100020003, it can be known that its parent element is the element with ATTR_CODE 00010002 (hereinafter referred to as the first-level subordinate relationship), and its grandfather element is the element with ATTR_CODE 0001.

[0074] S2. Convert the format of the shp file and store it in the database.

[0075] S21. Create a table for each layer. Each piece of data represents a graphic element, and the fields include FID, element code, and other attribute fields.

[0076] S22. Convert the graphic data of the shp file to the wkb format.

[0077] S23. Import the data into the database.

[0078] S3. Process the cutting of upper-layer elements to lower-layer elements and attribute inheritance

[0079] S31. Initialize overlap records: Create an overlaps hash table to record which high-level elements cover each low-level element (key = low-level FID, value = list of high-level FIDs). The set of keys in the overlaps hash table forms the removeLis, and the removeList is a set of polygon elements converted into Geometry objects.

[0080] S32. Double-loop to check geometric relationships.

[0081] S321. Traverse all graphic elements in the high-level layer to obtain the first geometric data of each polygon element.

[0082] S322. Traverse all graphic elements in the low-level layer.

[0083] S3221. Obtain the second geometric data of the low-level layer polygon element. Among them, both the first geometric data and the second geometric data are GEOM fields.

[0084] S3222. Spatial relationship check of elements: If it is an overlap relationship, record the high-level FID under the corresponding low-level FID in the overlaps hash table. The spatial relationship check here is based on geometric data. Only need to judge whether there is an overlap, without precise element boundaries. Therefore, using geometric data for spatial relationship check can reduce additional overhead and can flexibly customize the algorithm according to requirements. If it is a containment relationship, generate a changeList to record the attributes that need to be filled from the high-level to the low-level.

[0085] S33. Process the elements that need to be cut. Traverse the overlaps, filter out the low-level elements covered by multiple high-levels, that is, the target elements, and perform actual cutting on each target element.

[0086] For example, there is a polygon element in the low-level with FID = 1. S32 checks that it has a geometric intersection with the two polygons with FID = 101 and FID = 102 in the high-level (that is, FID = 1 is covered by FID = 101 and FID = 102). There is a record in the overlaps hash table as {"1": ["101", "102"]}. Based on this record, this step cuts FID = 1 with FID = 101 and FID = 102.

[0087] S331. Geometrically parse the second geometric data of the target element and convert it into a JTS Geometry object.

[0088] S332. Traverse all high-level graphic elements related to the target element, geometrically parse the first geometric data of each high-level graphic element, and convert it into a JTS Geometry object.

[0089] S333. Calculate the geometric intersections of each high-level graphic element and the target element based on the Geometry object, divide the target element into several graphic elements, and finally generate clipList, which is a set of surface elements in the Geometry format. During the graphic element cutting process, it is necessary to convert the set data into a Geometry object. For complex graphics, such as irregular polygons, curves, etc., it can accurately process information such as their boundaries and topologies. At the same time, the library where the Geometry object is located will handle possible abnormal situations, such as numerical overflow, boundary conditions, etc. Through a reasonable exception handling mechanism, the stability of the analysis process and the reliability of the results can be ensured.

[0090] S334. Traverse all geometries in the geometric intersection, filter out valid polygons, and filter out invalid geometries with too small an area and remove them from clipList. Since the cut geographical elements are not necessarily surfaces, they may be a set of geographical elements containing points, lines, and surfaces. Therefore, in this step, the surface elements are separately screened out from the set of geographical elements, and the points and lines are only elements generated during the operation process and need to be discarded in this step.

[0091] S335. Conduct a spatial check of the graphic elements again. If it contains, add it to changeList, and its elements are the corresponding attributes of the surface elements in the Geometry format.

[0092] S336. Integrate changeList, reomoveList, clipList, and the data of the original low-level layer (perform addition, deletion, and modification based on the original low-level data) to generate resultList. resultList records all the graphic elements and corresponding attributes of the low-level layer after cutting and attribute inheritance. For example, the surface with FID = 1 is cut into two surface elements in clipList (FID = 10001, 10002). These two surface elements are newly added surface elements, and the original surface element removeList (FID = 1) needs to be deleted. The newly added surface elements can trace back to the high-level layer parent element through the corresponding element numbers of the graphic elements with FID = 1 and inherit attributes from the high-level layer parent element.

[0093] S34. Convert the Geometry object in resultList to the wkb format.

[0094] S4. Create a new result table in the database and store the corresponding resultList of each layer in the result table.

[0095] S5. Convert the format of the data in the result table and export the shp file.

[0096] In the present invention, the spatial relationship check and the computational geometry intersection can be implemented by using the geotools dependency toolkit in Java.

[0097] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the indications of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limitation, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same moment, but can be executed at different moments. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps or stages in other steps.

[0098] Based on the same inventive concept, the embodiments of the present application also provide a multi-level surface feature cutting device based on graphic attributes and subordination relationships for implementing the above-mentioned multi-level surface feature cutting method based on graphic attributes and subordination relationships. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the multi-level surface feature cutting device based on graphic attributes and subordination relationships provided below can refer to the limitations on the multi-level surface feature cutting method based on graphic attributes and subordination relationships in the above text, and will not be repeated here.

[0099] In one embodiment, a multi-level surface feature cutting device based on graphic attributes and subordination relationships is provided, including:

[0100] An encoding module for encoding graphic elements according to the subordination relationships of each layer in the shp file and converting the shp file containing encoding information into the wkb format;

[0101] A cutting and attribute inheritance module for traversing all layers in a double-layer loop based on the wkb format, checking the spatial relationship of graphic elements between the high-level layer and the low-level layer with subordination relationships, constructing an overlaps hash table for the overlapping high-level layer and low-level layer according to the spatial relationship, obtaining a list of elements to be deleted from the overlaps hash table, and constructing a list of attribute changes for the high-level layer and low-level layer containing the spatial relationship;

[0102] An adding module for traversing the overlaps hash table, screening the graphic elements of the low-level layer that overlap with multiple high-level layers, and obtaining a list of newly added elements;

[0103] An execution module, configured to perform element deletion, element addition, and attribute inheritance operations on a layer according to a deletion element list, an attribute change list, and an added element list, and generate a result data set;

[0104] An output module, configured to perform data format conversion on the result data set and export a shp file that has completed surface element cutting.

[0105] In one embodiment, the encoding module is further configured to sort out the subordinate relationships between each layer; encode the surface elements on each layer to obtain an initial number; combine the subordinate relationships between the layers to encode the surface elements to obtain element numbers; wherein, the element numbers corresponding to the surface elements of the current layer are composed of the element numbers of the upper layer and the initial numbers of the current layer spliced together.

[0106] In one embodiment, the cutting and attribute inheritance module is further configured to traverse all graphic elements of the high-level layer to obtain first geometric data corresponding to the graphic elements of the high-level layer; traverse all graphic elements of the low-level layer to obtain second geometric data corresponding to the graphic elements of the low-level layer; check the spatial relationship between the high-level layer and the low-level layer regarding the graphic elements according to the first geometric data and the second geometric data.

[0107] In one embodiment, the cutting and attribute inheritance module is further configured to create an overlaps hash table, define the key as the graphic elements of the low-level layer, and the value as a list of graphic elements of the high-level layer; in each loop, when the graphic elements of the high-level layer and the graphic elements of the low-level layer are in an overlapping relationship, record the graphic elements of the high-level layer as the value under the key corresponding to the graphic elements of the low-level layer, and update the overlaps hash table; after traversing all layers in a double loop, obtain a deletion element list according to the set of keys in the current overlaps hash table.

[0108] In one embodiment, the addition module is further configured to use the graphic elements of the low-level layer that overlap with multiple high-level layers as target elements, obtain the wkb geometric data corresponding to the target elements and convert them into Geometry objects of JTS; traverse all graphic elements of the high-level layer that overlap with the target elements to obtain the geometric intersection with the target elements, and generate an added element list.

[0109] In one embodiment, the addition module is further configured to traverse the geometries in the added element list, filter out geometries with an area smaller than a threshold, and update the added element list.

[0110] Each module in the above multi-level surface element cutting device based on graphic attributes and subordination relationships can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or stored in a memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each of the above modules.

[0111] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in all the above method embodiments are implemented.

[0112] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in all the above method embodiments are implemented.

[0113] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in all the above method embodiments are implemented.

[0114] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Moreover, the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions.

[0115] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0116] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0117] The above-described embodiments only represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A multi-level surface element cutting method based on graphic attributes and subordinate relationships, characterized in that The method includes: encoding graphic elements according to the subordination relationship of each layer in the shp file, and converting the shp file containing the encoding information into the wkb format; Using geotools to traverse all layers in a double-layer loop based on the wkb format, checking the spatial relationship of graphic elements between the high-level layer and the low-level layer with a subordination relationship, constructing an overlaps hash table for the overlapping high-level layer and low-level layer according to the spatial relationship, obtaining a list of elements to be deleted from the overlaps hash table, and constructing a list of attribute changes for the high-level layer and low-level layer that contain each other according to the spatial relationship; among them, obtaining the list of elements to be deleted includes: creating an overlaps hash table, defining the key as the graphic elements of the low-level layer, and the value as the list of graphic elements of the high-level layer; In each loop, when the graphic elements of the high-level layer and the graphic elements of the low-level layer are in an overlapping relationship, record the graphic elements of the high-level layer as the value under the key corresponding to the graphic elements of the low-level layer, and update the overlaps hash table; After traversing all layers in a double-layer loop, obtain the list of elements to be deleted according to the set of keys in the current overlaps hash table; Traverse the overlaps hash table, filter the graphic elements of the low-level layer that overlap with multiple high-level layers, and obtain a list of new elements; among them, obtaining the list of new elements includes: taking the graphic elements of the low-level layer that overlap with multiple high-level layers as the target elements, and converting the wkb geometric data corresponding to the target elements into a Geometry object of JTS; Traverse all the graphic elements of the high-level layer that overlap with the target element, respectively obtain the geometric intersection with the target element, and generate a list of new elements containing several graphic elements; Perform element deletion, element addition, and attribute inheritance operations on the layer according to the list of elements to be deleted, the list of attribute changes, and the list of new elements, and generate a result data set; Perform data format conversion on the result data set and export the shp file after cutting the finished surface elements; Encoding graphic elements according to the subordination relationship of each layer in the shp file includes: sorting out the subordination relationship between each layer in the shp file; Encoding the surface elements on each layer to obtain an initial number; Encoding the surface elements in combination with the subordination relationship between the layers to obtain an element number; Among them, the element number corresponding to the surface element of the current layer is composed of the element number of the upper layer and the initial number of the current layer spliced together.

2. The method according to claim 1, wherein Traverse all layers in a double-layer loop, and check the spatial relationship of graphic elements between the high-level layer and the low-level layer with a subordination relationship, including: traversing all graphic elements of the high-level layer to obtain the first geometric data corresponding to the graphic elements of the high-level layer; Traverse all graphic elements of the low-level layer to obtain the second geometric data corresponding to the graphic elements of the low-level layer; Check the spatial relationship of graphic elements between the high-level layer and the low-level layer according to the first geometric data and the second geometric data.

3. The method according to claim 1, characterized in that, The method further includes: traversing the graphic elements in the list of new elements, filtering out the graphic elements with an area smaller than the threshold, and updating the list of new elements.

4. A multi-level surface element cutting device based on graphic attributes and subordination relationships, characterized in that The device includes: an encoding module, which is used to encode graphic elements according to the subordinate relationship of each layer in the shp file and convert the shp file containing encoding information into the wkb format; A cutting and attribute inheritance module, which is used to traverse all layers in a double-layer loop based on the wkb format by using geotools, check the spatial relationship of graphic elements between the high-level layer and the low-level layer with a subordinate relationship, construct an overlaps hash table for the overlapping high-level layer and low-level layer according to the spatial relationship, obtain a list of elements to be deleted from the overlaps hash table, and construct a list of attribute changes for the high-level layer and low-level layer included according to the spatial relationship; among them, obtaining the list of elements to be deleted includes: creating an overlaps hash table, defining the key as the graphic elements of the low-level layer, and the value as the list of graphic elements of the high-level layer; In each loop, when the graphic elements of the high-level layer and the graphic elements of the low-level layer are in an overlapping relationship, record the graphic elements of the high-level layer as the value under the key corresponding to the graphic elements of the low-level layer, and update the overlaps hash table; After traversing all layers in a double-layer loop, obtain the list of elements to be deleted according to the set of keys in the current overlaps hash table; An adding module, which is used to traverse the overlaps hash table, filter the graphic elements of the low-level layer that overlap with multiple high-level layers, and obtain a list of added elements; among them, obtaining the list of added elements includes: taking the graphic elements of the low-level layer that overlap with multiple high-level layers as target elements, and converting the wkb geometric data corresponding to the target elements into a Geometry object of JTS; Traverse the graphic elements of all high-level layers that overlap with the target elements, respectively obtain the geometric intersections with the target elements, and generate a list of added elements containing several graphic elements; An execution module, which is used to perform element deletion, element addition, and attribute inheritance operations on the layers according to the list of elements to be deleted, the list of attribute changes, and the list of added elements, and generate a result data set; An output module, which is used to convert the data format of the result data set and export the shp file that completes the cutting of the surface elements; Encoding the graphic elements according to the subordinate relationship of each layer in the shp file includes: sorting out the subordinate relationship between each layer in the shp file; Encoding the surface elements on each layer to obtain an initial number; Encoding the surface elements in combination with the subordinate relationship between the layers to obtain an element number; Among them, the element number corresponding to the surface elements of the current layer is composed of the concatenation of the element numbers of the upper layer and the initial number of the current layer.

5. A computer device, comprising a memory and a processor, the memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 3.

7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Cascade updating method based on multi-scale space vector data

    CN113721969A