Feature Description
During data production and processing, small and useless polygons, known as shard polygons, are often generated. This tool simplifies data by merging shard polygons with specified IDs to adjacent polygons with the largest area or longest common boundary.
Application Scenarios
Operations such as intersection, identification, update, and raster-to-vector conversion may result in many small patches in the result data, which do not meet the mapping area requirements. In such cases, the 【Shard Polygons Merge for Specific Objects】 tool can be used to merge small patches that meet specific conditions to adjacent large patches. The specific steps are as follows:
First, use the 【Extract Object ID】 tool to query the IDs of eligible shard polygons; then, pass the queried IDs to the 【Shard Polygons Merge for Specific Objects】 tool via connection, and upon execution completion, the specified shard polygons will be merged to adjacent polygons with the largest area or longest common boundary.
Parameter description
| Parameter Name | parameter interpretation | parameter type |
|---|---|---|
| source dataset | Input vector surface dataset. | DatasetVector |
| ID of Small Polygons to be Merged | Specifies the IDs of shard polygons to be merged. If eligible adjacent objects are found, merge these shard polygons to the adjacent objects. | Integer |
| Specifies the ID of the polygon to be excluded (Optional) |
Specifies the IDs of polygons that do not participate in the merge operation. | Integer |
| group field (Optional) |
Specifies the grouping field. Geometries with the same field value will be grouped together, and only polygons with the same field value can be merged. | String |
| priority field of the merged object (Optional) |
Priority field of the merged object, effective when the group field is not empty. One or more priority fields can be specified. 1. When multiple priority fields are specified, compare them in order. If the field values are equal, they are considered matching objects. If there is no unique matching object for the highest priority field, continue comparing the next highest priority field. This process continues until all fields are compared, and finally merge with the adjacent object that uniquely matches the priority fields. 2. If the priority field is empty or there is no unique matching object, merge based on the largest area principle, i.e., merge the shard polygons to the adjacent largest polygon. |
String |
| whether to merge objects at the maximum boundary (Optional) |
If checked, the specified shard polygons will be merged to the adjacent polygon with the longest common boundary; otherwise, they will be merged to the adjacent polygon with the largest area. | Boolean |
| Tolerance | Specifies a fuzzy value, whose unit must be consistent with the source dataset unit. During the merge process, if the distance between two nodes is less than the set tolerance value, they will be automatically merged into one. The tolerance value should be greater than or equal to 0; specifying a value less than 0 will cause an exception during execution. | Double |
Output Result
| Parameter Name | parameter interpretation | parameter type |
|---|---|---|
| result dataset | Supports directly modifying the source dataset or creating and outputting a new result dataset. | DatasetVector |
Notes
Shard polygons typically refer to polygons whose area is much smaller than other polygon objects in the dataset, generally considered to be between one millionth and one ten-thousandth of the area of the largest polygon in the dataset. However, in practical operations, it is necessary to set an appropriate minimum polygon tolerance value based on actual requirements.