A method of dispensing fence gap filling
Patent Information
- Application Number
- CN202410104221.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-25
- Publication Date
- 2026-08-18
- Estimated Expiration
- 2044-01-25
AI Technical Summary
[0003]当前ArcGIS提供的多边形缝隙填充方法存在几个缺点:一是用户有时很难发现细长缝隙,容易产生疏漏;二是交互操作烦索,增加人工操作成本;三是处理效率不高
[0031]本发明针对物流末端配送围栏之间缝隙严重影响揽投准确性和效率问题,设计了一种基于Voronoi图的配送围栏缝隙填充方法。本发明能够将围栏之间的缝隙近似平均地分配到邻接围栏中,相较于已有的地理信息系统处理工具,具有算法简单、易于实现等优点,而且能够有效避免围栏缝隙简单归并到其中一个邻接围栏带来的局陷性,更能够适应物流管理的业务需求,实用性强。
Smart Images

Figure CN117933845B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of delivery business management and spatial data processing, and in particular relates to a method for filling gaps in delivery fences. Background Technology
[0002] In the field of spatial data analysis and application, the topological relationships and rules between polygons play a crucial role. In last-mile delivery management, a delivery department's area is often divided into several delivery routes, each covering a certain spatial range. Each spatial range forms a delivery geofence (or delivery fence), thus dividing the delivery department's jurisdiction into a series of polygons. Theoretically, these delivery fences seamlessly cover the entire delivery department area. However, because delivery fences are often drawn manually by delivery department managers, many gaps frequently remain between the fences. When the delivery department assigns delivery tasks to each route based on spatial location, some customers located in the gaps cannot be correctly assigned to the appropriate delivery fence, severely impacting the accuracy and efficiency of delivery. Currently, geographic information system (GIS) software is widely used in logistics management to manage delivery fences. Although some GIS software provides polygon topology tools that can fill gaps, these methods are mostly handled manually, and the processing method simply merges the gap areas into adjacent polygons. For example, ArcGIS software developed by ESRI provides an interactive polygon gap-filling tool, but users need to locate the gaps between polygons and then perform a series of operations.
[0003] The current polygon gap-filling method provided by ArcGIS has several drawbacks: first, users sometimes find it difficult to spot narrow gaps, leading to oversights; second, the interactive operation is cumbersome, increasing manual operation costs; and third, the processing efficiency is low. Although ArcGIS also provides Python scripts to batch fill gaps between polygons, this method simply merges the gaps into neighboring polygons instead of distributing them evenly. In last-mile delivery logistics, simply merging gaps between fences into one fence also presents problems. For example, since delivery fences often follow roads, fence gaps usually exist in and around roads. Simply merging gaps into one fence could result in customers on both sides of the road being placed under the same delivery fence, increasing transportation costs for delivery personnel and reducing delivery efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a method for filling gaps in delivery fences to solve the problems existing in the prior art.
[0005] To achieve the above objectives, the present invention provides a method for filling gaps in a delivery fence, comprising:
[0006] Input the polygon of the delivery department work area and the delivery fence dataset, and calculate the fence gap polygon by subtracting the polygon of the delivery department work area and the delivery fence dataset.
[0007] Extract the boundary lines of the polygonal gaps in the fence, and construct interpolation points on the boundary lines based on a preset spacing;
[0008] Based on the inclusion relationship between the delivery fence micro-buffer and the interpolation point, the delivery fence number is assigned to the interpolation point, and a Voronoi polygon is constructed for the interpolation point;
[0009] Based on the inclusion relationship between the Voronoi polygon and the interpolation point, the fence number of the interpolation point is assigned to the Voronoi polygon containing the interpolation point;
[0010] The Voronoi polygon is cut using the gap polygon to obtain the Voronoi polygon portion region in the fence gap;
[0011] The Voronoi polygonal regions in the fence gaps are merged into fences with the same number to obtain the fence polygons after filling the gaps.
[0012] Preferably, the expression for the polygon of the fence gap is obtained by subtracting the polygon of the delivery department's working area from the delivery fence dataset:
[0013]
[0014] Where G is the set of polygons representing gaps between fences, S is the polygon of the delivery department's working area, g represents a gap in G, F is the set of delivery fences represented as a polygon set, and f represents a fence in F.
[0015] Preferably, the expression for extracting the boundary line of the polygonal gap in the fence is:
[0016]
[0017] Where B is the set of boundary lines of the gap polygon, and st_boundary is the polygon boundary line calculation function.
[0018] Preferably, the expression for assigning the delivery fence number to the interpolation point based on the inclusion relationship between the delivery fence micro-buffer zone and the interpolation point is as follows:
[0019]
[0020] Where id is the fence number of the interpolation point p or fence f, ε is the radius of all fences, st_within is the spatial calculation function within it, and st_buffer is the buffer calculation function.
[0021] Preferably, the expression for assigning the fence number to the Voronoi polygon is:
[0022]
[0023] Where V is the Voronoi polygon set.
[0024] Preferably, the expression for obtaining the Voronoi polygon portion region within the fence gap by performing gap trimming on the Voronoi polygon is:
[0025]
[0026] Where intersection is the function for calculating the overlapping area of two geometric figures, and V' is the set of Voronoi polygons after clipping.
[0027] Preferably, the expression for the obtained fence polygon after grouting is:
[0028]
[0029] Where F' is the delivery fence after grouting, and st_union is the geometric merging function.
[0030] The technical effects of this invention are as follows:
[0031] This invention addresses the problem of severe gaps between fences in last-mile delivery systems negatively impacting pickup and delivery accuracy and efficiency. It proposes a gap-filling method based on Voronoi diagrams. This invention can approximately evenly distribute gaps between fences among adjacent fences. Compared to existing geographic information system (GIS) processing tools, it offers advantages such as simple algorithm and ease of implementation. Furthermore, it effectively avoids the limitation of simply merging fence gaps into one adjacent fence, making it more adaptable to the business needs of logistics management and highly practical. Attached Figure Description
[0032] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0033] Figure 1 This is a diagram showing the current status of the last-mile delivery fence in a certain urban area according to an embodiment of the present invention;
[0034] Figure 2This is a polygonal diagram of fence gaps obtained from example data in an embodiment of the present invention;
[0035] Figure 3 This is a sample data extraction diagram of the gap polygon boundary line in an embodiment of the present invention;
[0036] Figure 4 This is an interpolation point diagram of the gap boundary line for example data in an embodiment of the present invention;
[0037] Figure 5 This is a flowchart illustrating the fence gap filling calculation method in an embodiment of the present invention.
[0038] Figure 6 This is a schematic diagram of buffering in an embodiment of the present invention, wherein (a) is a point buffer diagram, (b) is a line buffer diagram, and (c) is a surface buffer diagram. Detailed Implementation
[0039] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0040] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0041] Example 1
[0042] like Figure 5 As shown, this embodiment provides a method for filling gaps in a delivery fence, including:
[0043] Step 1: Subtract all fence polygons from the polygon of the delivery department's work area to obtain the polygon of the fence gap;
[0044] Step 2: Extract the boundary lines of all gap polygons, and construct interpolation points on the boundary lines at certain intervals;
[0045] Step 3: Based on the inclusion relationship between the fence micro-buffer and the interpolation point, assign the fence number to the interpolation point contained in the fence micro-buffer, that is, assign a fence number to each interpolation point;
[0046] Step 4: Construct Voronoi polygons for all interpolation points, and assign the fence number of the interpolation point to the Voronoi polygon in which it is located. Then, cut all Voronoi polygons with gaps to obtain the Voronoi polygon part area in the fence gaps.
[0047] Step 5: Merge the cut Voronoi polygons into the fences with the same number to obtain the fence polygons after filling the gaps.
[0048] Further implementation of this plan includes:
[0049] Step 1: Use `st_difference(S,st_union(f))` to calculate the polygons of the gaps between the fences, where `S` is the polygon of the delivery station's working area, `f` is the fence polygon, `st_difference(g1,g2)` is the function to subtract `g2` from geometry `g1`, and `st_union(f)` is the set operation function to merge all fences. After merging all fences in this step, subtract the merged fence shape from the polygon of the delivery station's working area to obtain the set of fence gap polygons `G`.
[0050] Step 2: Call the `st_boundary(g)` function to calculate the boundary line of each slit polygon, and then call the `st_LineInterpolatePoints(l, △d)` function to construct interpolation points with an interval of △d on the boundary line `l`, obtaining the point set P. Here, `g` is the slit polygon, `l` is the boundary line of the slit polygon, and △d is the interpolation interval.
[0051] Step 3: Call the function `st_within(p,st_buffer(f,ε))` to determine if a point in `p` is within the ε-buffer of the fence `f`. If it is, assign the fence number of `f` to `p`, i.e., `p.id = f.id`. Here, `st_within(g1,g2)` is the function to calculate the spatial relationship between geometry `g1` and `g2`, `st_buffer(f,ε)` calculates the buffer polygon of geometry `f` with radius ε, and `id` is the fence number attribute.
[0052] Step 4: Call ST_VoronoiPolygons(P,ε) to generate Voronoi polygons for the point set P, resulting in a Voronoi polygon set V. Then, assign the fence number containing the interpolation points to each Voronoi polygon, i.e., v.id = p.id. Here, ST_VoronoiPolygons is the function to calculate the Voronoi polygons for the point set P, the ε parameter controls the spacing between the calculated points (points with a spacing smaller than ε are ignored), and v is one of the Voronoi polygons.
[0053] Step 5: For all polygons v in V and polygons g in G, call the st_intersection(g,v) function to calculate the overlapping area of g and v, and obtain the polygons that g cuts v. The cut polygons form a set V'.
[0054] Step 6: Call the function st_union(f,v') to merge the polygon v' in V' into the fence f with the same fence number, and get the delivery fence F' after filling the gap.
[0055] The calculation process in this embodiment is as follows:
[0056] This invention addresses the problem of gaps between delivery fences affecting pickup and delivery efficiency by proposing a Voronoi-based method for filling these gaps, thereby ensuring that the gaps between fences are approximately evenly distributed within adjacent fences. The following is an example... Figure 1 Example data (the delivery fence set is represented by a polygon set F, and the delivery department's responsible area is represented by a polygon S) is used as an example.
[0057] (1) Subtract all fence polygons from the polygon S of the delivery area to obtain the set of gap polygons G between the fences. The calculation formula is shown in equation (1), where f represents a fence of F and g represents a gap of G. The calculation results of the gap polygons for the example data are as follows. Figure 2 As shown.
[0058]
[0059] (2) Extract the boundary lines of each gap polygon in G to obtain the gap polygon boundary line set B. The calculation formula is shown in equation (2), where st_boundary is the polygon boundary line calculation function. The gap polygon boundary extraction results are as follows: Figure 3 As shown.
[0060]
[0061] (3) For all gap boundary lines, construct a linear interpolation point set P according to the Δd distance interval. Figure 3 Interpolation points of the boundary line, such as Figure 4 As shown.
[0062] (4) Calculate the buffer zone with radius ε (small distance, such as 0.01m) for all fences, and assign the number of each fence to the interpolation point contained in the fence buffer zone. The calculation process can be expressed as Equation (3).
[0063]
[0064] Here, st_within is the space calculation function within it, and st_buffer is the buffer calculation function.
[0065] (5) Calculate the Voronoi polygons of all interpolation points to obtain the Voronoi polygon set V; then assign the fence number of the interpolation points contained in the Voronoi polygon to the Voronoi polygon. The calculation process can be expressed as Equation (4).
[0066]
[0067] (6) Trim each polygon in V using each polygon in G to obtain the trimmed Voronoi polygon set V'. The calculation formula is shown in equation (5), where intersection is the function for calculating the overlapping area of the two geometric figures.
[0068]
[0069] (7) Based on the fence number of each polygon in V', merge it into the fence with the corresponding number to obtain the delivery fence F' after filling. The calculation process can be expressed as equation (6), where st_union is the merging function of the geometric figures.
[0070]
[0071] To further optimize this scheme, the aforementioned last-mile delivery fence refers to the area defined by the delivery department as a subordinate delivery route in last-mile logistics management. Geographically, it is represented by a closed polygon, i.e., a last-mile delivery fence. The delivery department refers to the basic management organization established by the logistics department to collect and deliver customer items within a certain spatial range. The gap refers to the blank area between all last-mile delivery fences within a delivery department's work area. The filling is the process of approximately evenly distributing the blank areas between fences to adjacent delivery fences.
[0072] To further optimize the scheme, the subtraction operation described in step 1 is a spatial operation in which one geometric shape removes another geometric shape.
[0073] To further optimize the scheme, the linear construction interpolation points mentioned in step 2 are a series of points obtained at certain intervals on a specified line.
[0074] To further optimize this scheme, the buffer is a set of spatial points (i.e., polygons) located at a distance from the target graphic that is less than or equal to a specified radius. The buffer for point features is a circle, while the buffer for line and polygon features is a polygon, as shown below. Figure 6 As shown.
[0075] To further optimize the scheme, the Voronoi polygon mentioned in step 4 is also called a Tessellation polygon, which means that the distance from any point in each polygon to the control point of the polygon is less than the distance to other control points.
[0076] The above description is merely a preferred embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for filling gaps in a delivery fence, characterized in that, Includes the following steps: Input the polygon of the delivery department work area and the delivery fence dataset, and calculate the fence gap polygon by subtracting the polygon of the delivery department work area and the delivery fence dataset. Extract the boundary lines of the polygonal gaps in the fence, and construct interpolation points on the boundary lines based on a preset spacing; Based on the inclusion relationship between the delivery fence micro-buffer and the interpolation point, the delivery fence number is assigned to the interpolation point, and a Voronoi polygon is constructed for the interpolation point; Based on the inclusion relationship between the Voronoi polygon and the interpolation point, the fence number of the interpolation point is assigned to the Voronoi polygon containing the interpolation point; The Voronoi polygon is cut using the gap polygon to obtain the Voronoi polygon portion region in the fence gap; The Voronoi polygon portion of the fence gap is merged into the fence with the same number to obtain the fence polygon after filling the gap. The expression for assigning the delivery fence number to the interpolation point based on the inclusion relationship between the delivery fence micro-buffer and the interpolation point is as follows: ; in, id Interpolation point p or fence f The fence number, where ε is the radius of all fences. st_within To compute functions in the space within it, st_buffer The function is calculated for the buffer. P Let F be a set of points, and let F be a set of delivery fences, represented as a set of polygons. The expression for assigning the fence number to the Voronoi polygon is: ; in, V For Voronoi polygon set, st_within Let v be a Voronoi polygon, where v is a spatial computation function.
2. The method for filling gaps in delivery fences according to claim 1, characterized in that, The expression for the polygon of the fence gap is obtained by subtracting the polygon of the delivery department's working area from the delivery fence dataset: ; in, G For the set of polygons representing the gaps between fences, The delivery department's work area is a polygon. g express G A gap, f represents F A fence.
3. The method for filling gaps in delivery fences according to claim 2, characterized in that, The expression for extracting the boundary line of the polygonal gap in the fence is: ; in, B For the set of boundary lines of the gap polygon, st_boundary This is a function for calculating polygon boundary lines.
4. The method for filling gaps in delivery fences according to claim 3, characterized in that, The expression for obtaining the Voronoi polygon portion within the fence gap by performing gap trimming on the Voronoi polygon is as follows: ; in, st_intersection A function to calculate the overlapping region of two geometric figures. V' This is the set of Voronoi polygons after clipping.
5. The method for filling gaps in delivery fences according to claim 4, characterized in that, The expression for the polygon of the fence after grouting is: ; in, F' For the delivery fence after the gaps are filled, st_union This is a function for merging geometric figures.
Citation Information
Patent Citations
Contour processing method and device of electronic map and electronic equipment
CN112215864A