Contour line-based building site and road generation method, equipment and medium

By using a contour-based method for generating building sites and roads, feasible regions are automatically generated using contour data, and precise calculations of cut and fill are performed. This enables iterative optimization of building sites and access roads, improves the rationality of the design and the feasibility of the project, provides quantitative scores for multiple optimal solutions, and solves the problem of traditional methods relying on manual experience.

CN121072003APending Publication Date: 2025-12-05HEFEI LIANGZHEN CONSTR TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511246700.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-02
Publication Date
2025-12-05

AI Technical Summary

Technical Problem

Existing technologies rely on the human experience of designers in mountainous building site and road design, which is inefficient, makes it difficult to quickly generate multiple alternative solutions, lacks a unified scoring system, is highly subjective, and results in unstable design quality.

Method used

The contour-based building site and road generation method receives user input of the building site layout area, extracts terrain layer data, calculates elevation, contour density and road distance scores, uses cluster analysis to determine orientation, and generates road combinations through a pathfinding algorithm to achieve automated design.

Benefits of technology

It enables intelligent design of building sites and roads, quickly generates multiple optimized solutions, improves design efficiency and scientific rigor, reduces the blindness and reliance on experience in manual selection, and provides quantitative scoring to support decision-making.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121072003A_ABST
    Figure CN121072003A_ABST
Patent Text Reader

Abstract

The invention discloses a construction site and road generation method and device based on contour lines and a medium, and relates to the technical field of path design. The method comprises the following steps: receiving a to-be-arranged area, and extracting vector data of a ground feature layer, an elevation contour line layer and an existing road layer to obtain a to-be-arranged area; dividing a to-be-arranged area into grids, and calculating an elevation score, a contour density score and a road distance score based on the elevation contour map layer and the existing road map layer so as to screen out a plurality of candidate building site center points; determining the orientation of the building site through clustering analysis according to the trend of the peripheral contour line of the central point of the candidate building site; and according to the road starting point facing the preset building site, searching connection points meeting the gradient requirement on the existing road, and generating a road combination of the connection points through a way-finding algorithm. According to the method, a plurality of optimal schemes are output in batches and are quantitatively scored, and the efficiency of early-stage design work is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of path design, and particularly relates to a building site and road generation method based on contour lines, equipment and medium. BACKGROUND

[0002] In the early design of small buildings in mountainous areas, the traditional technical route is as follows: a designer first obtains a topographic map, manually reads elevation points or contour lines, and determines a plurality of possible building site positions on a drawing according to experience; for each candidate site, the designer manually calculates or estimates the amount of excavation and filling by using a simple CAD tool, and determines the site orientation, surrounding object retreat distance, drainage and other factors according to experience; after the site is roughly determined, the designer manually measures the longitudinal slope in sections according to the starting point of the existing road and the topographic trend, and repeatedly adjusts the route to control the slope and balance the excavation and filling; the entire process is expressed in two-dimensional plan and profile drawings, and the advantages and disadvantages of each scheme are determined according to experience.

[0003] However, the site and road design is greatly affected by the experience of the designer and the complexity of the terrain, and the design quality is unstable; the number of generated schemes is limited, time-consuming and laborious, and it is difficult to exhaust potential better solutions; there is a lack of a unified scoring system, and it is highly subjective and relies on personal experience; when the terrain or boundary conditions are changed, the designer needs to manually re-derive, and the work is repetitive.

[0004] Through the above analysis, the problems and defects of the prior art are as follows:

[0005] In the design of building sites and roads in mountainous areas in the prior art, the traditional method relies on the manual experience of the designer, is low in efficiency, is highly subjective, and is difficult to quickly generate candidate schemes. SUMMARY

[0006] The embodiments of the present application provide a building site and road generation method based on contour lines, equipment and medium, which can solve the problem in the prior art that the traditional method relies on the manual experience of the designer, is low in efficiency, is highly subjective, and is difficult to quickly generate a plurality of candidate schemes in the design of building sites and roads in mountainous areas.

[0007] In a first aspect, the embodiments of the present application provide a contour-based building site and road generation method, which comprises: receiving a to-be-laid region of a building site framed by a user in a topographic map, and extracting vector data of a ground feature layer, an elevation contour layer and an existing road layer in the topographic map; obtaining an un-layable region from the ground feature layer, and deducting the un-layable region from the to-be-laid region to obtain a to-be-laid region; dividing the to-be-laid region into grids, calculating an elevation score, a contour density score and a road distance score based on the elevation contour layer and the existing road layer, and screening a plurality of candidate building site center points; determining an orientation of the building site according to a peripheral contour direction of the candidate building site center point through cluster analysis; and finding a connecting point on the existing road that meets the slope requirement according to a road starting point of the preset building site, and generating a road combination of the connecting point through a pathfinding algorithm.

[0008] In an implementation manner of the present application, the un-layable region of the building site is obtained from the ground feature layer, specifically comprising: identifying a closed region and a non-closed ground feature in the ground feature layer, and directly taking the closed region as the un-layable region; for the non-closed ground feature, generating a concave hull through a rolling ball algorithm, and expanding the ground feature boundary outward by a preset retreat distance range as the un-layable region.

[0009] In an implementation manner of the present application, the elevation score, the contour density score and the road distance score are calculated based on the elevation contour layer and the existing road layer to screen a plurality of candidate building site center points, specifically comprising: obtaining an elevation value of the contour line closest to the grid center point as the elevation of the grid; sorting the elevations, and excluding the highest and lowest preset proportion of grids; calculating the contour density score by weighting based on the number of contours in the grid and the total length of the contours; obtaining the road distance score by normalizing the minimum distance from the grid center point to the nearest road; and obtaining the grid comprehensive score by weighted summation of the elevation score, the contour density score and the road distance score, and sorting the grid comprehensive score to obtain the plurality of candidate building site center points.

[0010] In an implementation manner of the present application, the peripheral contour direction of the candidate building site center point specifically comprises: extracting a starting point and an ending point of each contour in the grid, and calculating an included angle based on the north as a reference; and obtaining the direction angle of the grid by weighted average of the included angle with the contour length as the weight.

[0011] In an implementation manner of the present application, the orientation of the building site is determined according to the peripheral contour direction of the candidate building site center point through cluster analysis, specifically comprising: performing K-means clustering on the direction angle of the grid to obtain a cluster center; taking the cluster center as a candidate orientation, respectively trying to arrange the building site blocks, and calculating the average value of the density score in a preset range; and selecting the orientation with the highest density score as the recommended orientation.

[0012] In an implementation form of the present application, a candidate connecting point on the existing road is found within a preset radius range with the starting point of the preset road in the construction site as the center, specifically including: extracting the intersection of the existing road edge line and the contour line, and performing elevation interpolation on the existing road edge line; finding a point on the interpolated existing road edge line that meets the slope requirement as the candidate connecting point.

[0013] In an implementation form of the present application, the connecting point on the existing road that meets the slope requirement is found, and the road combination of the connecting point is generated through a pathfinding algorithm, specifically including: Manhattan distance is used to calculate the distance cost; the absolute value of the elevation difference of adjacent grids on the path is summed to obtain the elevation change cost; the distance cost and the elevation change cost are weighted and summed to obtain the total cost of the path, and the path with the minimum total cost is selected as the optimal road path from the starting point to the connecting point.

[0014] In an implementation form of the present application, after the road combination of the connecting point is generated through the pathfinding algorithm, the method further includes: performing round corner processing on the polyline of the road path to generate a smooth curve; and offsetting the smooth curve to both sides by a preset distance to generate two parallel road edge lines.

[0015] In a second aspect, the embodiments of the present application also provide a building site and road generation device based on contour lines, the device comprising at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to: receive a to-be-laid area of a building site framed by a user in a topographic map, and extract vector data of a ground feature layer, an elevation contour line layer and an existing road layer in the topographic map; obtain an un-layable area according to the ground feature layer, and subtract the un-layable area from the to-be-laid area to obtain a to-be-laid area; divide the to-be-laid area into a grid, calculate an elevation score, a contour line density score and a road distance score based on the elevation contour line layer and the existing road layer, and select a plurality of candidate building site center points; determine the orientation of the building site through cluster analysis according to the peripheral contour line direction of the candidate building site center point; and find a connecting point on the existing road that meets the slope requirement according to the road starting point of the preset building site, and generate a road combination of the connecting point through a pathfinding algorithm.

[0016] In a third aspect, the embodiments of the present application further provide a non-volatile computer storage medium for building site and road generation based on contour lines, which stores computer executable instructions, and the computer executable instructions are configured to: receive a to-be-laid area of a building site framed by a user in a topographic map, extract vector data of a ground object layer, an elevation contour line layer and an existing road layer in the topographic map; obtain an un-layable area according to the ground object layer, and subtract the un-layable area from the to-be-laid area to obtain a to-be-laid area; divide the to-be-laid area into grids, calculate elevation scores, contour line density scores and road distance scores based on the elevation contour line layer and the existing road layer, and select a plurality of candidate building site center points; determine an orientation of the building site according to a peripheral contour line direction of the candidate building site center point through clustering analysis; and preset a road starting point of the building site, find a connecting point on the existing road that meets a slope requirement, and generate a road combination of the connecting point through a pathfinding algorithm.

[0017] The method, device and medium for building site and road generation based on contour lines provided by the embodiments of the present application automatically generate a building site feasible region and an algorithm for accurate calculation of cut and fill, an iterative optimization mechanism of a building site and an access road, a multi-objective scoring model for cut and fill balance, slope compliance, ground object avoidance and quantitative scoring, and a system architecture for batch presentation of multiple schemes in a graphic-data integrated manner in a CAD environment and supporting interactive comparison and selection. The CAD plug-in completes site preliminary selection and road wiring in one key, improves design efficiency, comprehensively considers multiple factors such as terrain, ground object avoidance and new road length, and makes the advantages and disadvantages of a scheme obvious at a glance, can output multiple feasible schemes at a time, significantly expands the comparison and selection space, and can refresh the scheme set in seconds when the design boundary, road starting point or terrain data changes. The method realizes intelligent and quantitative evaluation of building site selection and road planning. Through grid scoring and screening based on multiple factors such as contour line density, elevation and road distance, multiple optimal candidate sites are quickly locked, and the blindness and experience dependence of manual selection are overcome. Secondly, the building orientation most consistent with the terrain direction is automatically determined by using clustering analysis, and a road path meeting the slope requirement is generated based on an improved A* pathfinding algorithm, which significantly improves the rationality and engineering feasibility of the design. Finally, the method can batch output multiple optimal schemes and perform quantitative scoring, providing intuitive and comprehensive comparison and selection basis for decision makers, and greatly improving the efficiency, objectivity and scientificity of the preliminary design work. BRIEF DESCRIPTION OF DRAWINGS

[0018] The accompanying drawings, which are included to provide a further understanding of the present application and are incorporated in and constitute a part of this application, illustrate embodiments of the present application and serve to explain the present application. In the drawings:

[0019] Figure 1A flow chart of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0020] Figure 2 A user operation flowchart of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0021] Figure 3 An initial interface diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0022] Figure 4 A selected layout area diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0023] Figure 5 A picked complete layer diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0024] Figure 6 A determined non-layable area diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0025] Figure 7 A rolling ball algorithm diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0026] Figure 8 A new chord finding diagram of a rolling ball algorithm of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0027] Figure 9 A diagram of a rolling ball algorithm of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0028] Figure 10 A loop chord finding diagram of a rolling ball algorithm of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0029] Figure 11 A multi-concave package generation diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0030] Figure 12 A non-layable range diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0031] Figure 13 A gridization diagram of a proposed layout area of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0032] Figure 14 A grid elevation screening schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0033] Figure 15 A grid contour line number example schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0034] Figure 16 A pre-drilling platform CAD block schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0035] Figure 17 A road starting point determination schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0036] Figure 18 A road end schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0037] Figure 19 A contour line subdivision schematic diagram of an existing road of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0038] Figure 20 A path search area grid division schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0039] Figure 21 A path search cost calculation example diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0040] Figure 22 A path search path backtracking schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0041] Figure 23 A road edge line generation schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0042] Figure 24 A display scheme schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0043] Figure 25 An opening scheme schematic diagram of a building site and road generation method based on contour lines provided by an embodiment of the present application;

[0044] Figure 26A building site and road generation device internal structure schematic diagram based on contour lines is provided for the embodiments of the present application. DETAILED DESCRIPTION

[0045] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in conjunction with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0046] The embodiments of the present application provide a building site and road generation method, device and medium based on contour lines, which solves the problem in the prior art that in mountain building site and road design, the traditional method relies on the manual experience of designers, is inefficient, is highly subjective and is difficult to quickly generate multiple selected schemes.

[0047] The technical solutions proposed by the embodiments of the present application will be described in detail below with reference to the drawings.

[0048] Figure 1 A building site and road generation method flowchart based on contour lines is provided for the embodiments of the present application. As shown in Figure 1 and Figure 2 The building site and road generation method based on contour lines provided by the embodiments of the present application specifically includes the following steps:

[0049] Step 10: receiving a building site to be arranged region framed by a user in a topographic map, and extracting vector data of a ground object layer, an elevation contour line layer and an existing road layer in the topographic map;

[0050] Firstly, it can be understood that in a small mountain building design scene, the influence of surrounding ground objects, topographic features and excavation and filling amount need to be considered in the early design stage, multiple schemes are formed and the position and angle of the building site are selected. Then, combined with the approach direction of the building site and the position of the existing road, as well as the influence of the topography on the road slope, multiple schemes are formed and the path of the road is selected. The present application is based on the function developed by CAD, which automatically processes the above content. After the user inputs the topographic map and circumscribes the approximate arrangement range in the topographic map, the function is executed. The function will output multiple design schemes containing building sites and approach roads, and perform scoring for the user to compare and select.

[0051] The present application is currently developed for the design of the building site and approach road of the oil drilling platform. In the following text, the oil drilling platform is taken as an example, but this function can be used as a general tool and extended to various small mountain buildings.

[0052] In this step, first for the function before running, show the user initial interface, such as Figure 3 As shown in the figure, trigger the pop-up display logic of the user interface; the user selects the well site layout area, such as Figure 4 As shown in the figure, listen to the click event of the "well site layout area" selection button, activate the topographic map range selection mode, and receive the user's box selection coordinate range on the topographic map; then the user picks up the layer, such as Figure 5 As shown in the figure, listen to the click event of the layer picking button, and sequentially perform picking operations on each layer to obtain the vector data of the corresponding elevation contour layer, civil building layer, water body layer and existing road layer in the topographic map.

[0053] Step 20: Obtain the non-layable area from the ground object layer, and subtract it from the to-be-laid area to obtain the to-be-laid area;

[0054] As an optional embodiment, the non-layable building site area obtained from the ground object layer can specifically include: step 201: identifying the closed area and non-closed ground object in the ground object layer, and directly taking the closed area as the non-layable area;

[0055] In this step, the non-layable building site area is: within the water body range; within 100m of the residential house, which is taken as an example here, and can be replaced by high-voltage lines, gas stations and other ground objects that require a setback distance in other scenarios. The closed figure composed of lines in the water body layer can be directly taken as the non-layable area, as shown in Figure 6 .

[0056] Step 202: For non-closed ground objects, generate a concave hull through a rolling ball algorithm, and expand the ground object boundary outward by a preset setback distance range to serve as the non-layable area.

[0057] In this step, the residential house layer is obtained, which often cannot form a closed figure and needs the following further processing; for the figure composed of lines in the residential house layer, a concave hull is obtained through a rolling ball algorithm, the endpoints of all lines in the figure are obtained, and a coordinate system is established for the figure: a point with the smallest Y value (if the Y values are the same, take the maximum X) is calculated as the initial point A, which must be on the concave hull, the rolling ball radius R = 50, which is half of the setback distance 100m, as shown in Figure 7 .

[0058] Further, starting from the starting point A, the next one is AB, and the chord must start from A and connect to a point B within the R field of A; the following principles can be used to find B: first, sort the points in the R field of A in polar coordinates with A as the center and BO vector as the reference, and then establish a circle with ABi as the chord and R as the diameter for B0~BN in the R field, and then check whether it contains other points, if not, then ABi is the new chord, and the loop is exited, as shown in Figure 8 ,Figure 9 , Figure 10 As shown, the process loops to find the next string, and so on, until no new string can be found or a point that has already been used as a string is encountered.

[0059] Furthermore, such as Figure 11 , Figure 12 , Figure 13 As shown, after the algorithm is applied, it may generate a concave shape, points inside the concave, and points outside the concave. If points exist outside the concave, the rolling ball algorithm is applied repeatedly to generate multiple concave shapes until all points are inside the concave. The corner points of all generated concave shapes are obtained. Circles are drawn with the corner points as centers and a radius of 100m. The union of all circles represents the undesirable area.

[0060] Step 30: Divide the proposed layout area into a grid, and calculate the elevation score, contour density score and road distance score based on the elevation contour layer and the existing road layer to select multiple candidate building site center points;

[0061] In this step, the undesirable areas are subtracted from the proposed layout area, resulting in a new proposed layout area; a 5×5m grid system is constructed within the proposed layout area, with each grid cell denoted as a Cell. Figure 14 As shown.

[0062] As an optional embodiment, based on the elevation contour line layer and the existing road layer, the elevation score, contour line density score and road distance score are calculated to filter out multiple candidate building site center points. Specifically, it may include: Step 301: Obtain the elevation value of the contour line closest to the center point of the grid as the elevation of the grid; Step 302: Sort the elevations and exclude the grids with the highest and lowest preset proportions.

[0063] In this step, the contour line closest to the center point of the cell is obtained. The elevation of this contour line, i.e., the elevation score H of the cell, is then sorted from highest to lowest. These H values ​​are then filtered, discarding the highest 15% and the lowest 15%, retaining the middle 70%. When the center of the building site lies at either the lowest or highest elevation, it will result in unbalanced cut and fill operations, which must be avoided. The filtered cell center points are then passed to the trial arrangement list. Figure 15 As shown.

[0064] Step 303: Based on the number of contour lines within the grid and the total length of the contour lines, calculate the contour line density score using a weighted average.

[0065] In this step, the number of cells within the study area is denoted as n. Within a single cell, the number of contour lines is calculated, denoted as N. The larger N is, the greater the contour line density. Based on N and L, a density score is calculated for each cell. The score of N is standardized as follows: average value Average number of contours in each Cell; standard deviation For example, n = 4, Figure 16 In each Cell, the sum of the lengths of the contours is calculated and denoted as L. The greater L is, the greater the contour density is. The fraction of L is normalized: Average value (sum of the lengths of the contours in the study area divided by n), standard deviation The greater the contour density is, the lower the density score is. The total score of the density score is 100, in which the weight of H is 0.7 and the weight of L is 0.3. The density score D is: wherein when there is no contour in the Cell, the density score D = null, i.e. the angle of the pre-drilling platform is not affected.

[0066] Step 304: based on the minimum distance from the center point of the grid to the nearest road, and normalized, the road distance score is obtained; step 305: the elevation score, the contour density score and the road distance score are weighted and summed to obtain the grid comprehensive score, and the grid comprehensive score is sorted to obtain a plurality of candidate building site center points.

[0067] In this step, the road line closest to the center point of the Cell is obtained, and the minimum distance from the center point of the Cell to the road line is calculated. The road distance score R of the Cell is calculated. The minimum distances Rn of all the center points of the Cells to the road line are taken as an array (R1, R2, …, Rn), wherein the maximum value is max, the minimum value is min, and the total number is n. The score range of the road distance score R is 1-100. The total score of each Cell is calculated = D + R. The total score is sorted from high to low. The elevation score H of the Cell corresponding to the total score is obtained. The five elevation scores Ha, Ha1, Hb, Hb1 and Hc approximately located at 30%, 40%, 50%, 60% and 70% of the elevation score H are extracted. The Cells are divided into 5 groups according to Ha', Ha1', Hb', Hc' and Hb1', and the highest total score in each group is taken to generate 5 building site center test results.

[0068] Step 40: according to the peripheral contour trend of the candidate building site center point, the orientation of the building site is determined through cluster analysis;

[0069] ​As an optional embodiment, the orientation of the construction site is determined by cluster analysis according to the contour lines around the center point of the candidate construction site, and specifically can include: step 401: extracting the starting point and the ending point of each contour line in the grid, and calculating the included angle based on the north as the reference; step 402: obtaining the orientation angle of the grid by weighted average of the included angle with the length of the contour line as the weight.

[0070] In this step, in a single Cell, the number of contour lines is calculated, denoted as n, and the length of a single contour line is denoted as L n . L1, L2, … calculate the orientation angle of a single contour line in the Cell. Obtain the starting point and the ending point of the contour line in the Cell, and connect them with a straight line, denoted as line, and calculate the angle between the line and the X-axis of the grid system, denoted as a n . a1, a2, … calculate the orientation angle An of the entire Cell. The angle a n of the n lines is calculated by weighted calculation to obtain A n , and the weighting coefficient is L n .

[0071]

[0072] When there is no contour line in the Cell, the orientation angle A = null, that is, it does not affect the angle of the drilling platform. Each type of construction site corresponds to a CAD block. The block should be included by default in the function; as Figure 17 shown, taking the drilling platform of a three-wellhead as an example, the drilling platform wellhead base point: the layer is the original of the “wellhead”, and the center of the circle is the wellhead base point, that is, the axis of the drilling platform rotation. Drilling platform edge: four edges are represented by different layers, respectively X1, X2, Y1, Y2; when the function is extended to a general scenario, a parameter-driven dynamic block can be used to represent the construction site to adapt to the flexible change of the construction site size.

[0073] As an optional embodiment, the method can further include: step 403: performing K-means clustering on the orientation angle of the grid to obtain the cluster center; step 404: taking the cluster center as a candidate orientation, respectively trying to arrange the construction site block, and calculating the average value of the density score in the preset range; step 405: selecting the orientation with the highest density score as the recommended orientation.

[0074] In this step, when the angles of most Cells are parallel, the density score in the rectangular region of the drilling platform is as high as possible. For the five construction site center schemes, the angle is tried to arrange respectively. A n is clustered by K-means clustering as an array, and k values are obtained. Among them, (k-1) = floor (n / k), i.e. the data will be divided into k clusters. Randomly pick k data in A as initial centroids. Denoted as A centroid 1, A centroid 2, …, A centroid k; for each data Ai, calculate its distance to each centroid. For example: for A1, the distance to centroid 1 is d1 = |A1-A centroid 1|, the distance to centroid 2 is d2 = |A1-A centroid 2|, …, the distance to centroid k is dk = |A1-A centroid k|; take the minimum value of d1, d2, …, dk, and assign data Ai to the cluster where the nearest centroid is located, i.e. A centroid k; recalculate the centroid of each cluster, which is the average value of all data points in the cluster. Repeat the steps until the centroid no longer changes or the maximum number of iterations is reached. One by one, arrange the pre-drilling platform tiles according to the test arrangement angle, so that the long side X of the pre-drilling platform tile is parallel to the test arrangement angle. Calculate the average value of the density score D of the Cell within the range of the pre-drilling platform tile. Take the scheme with the highest angle score to generate 5 well site layout schemes.

[0075] Step 50: According to the road starting point towards the preset building site, find the connection point on the existing road that meets the slope requirement, and generate the road combination of the connection point through the pathfinding algorithm.

[0076] As an optional embodiment, according to the road starting point towards the preset building site, find the connection point on the existing road that meets the slope requirement, and generate the road combination of the connection point through the pathfinding algorithm, which can specifically include: step 501: extracting the intersection of the existing road boundary line and the contour line, and performing elevation interpolation on the existing road boundary line; step 502: finding a point on the interpolated existing road boundary line that meets the slope requirement as a candidate connection point.

[0077] In this step, the road starting point is a point in the wellhead tile, as shown in Figure 18 , denoted as Ps: located at the midpoint of the short side, and the short side is away from the equipment (the layer of the equipment is A-Anno-Note), and a circle is made with Ps as the center and 300 as the radius. Obtain the existing road boundary line in the circle, and calculate the shortest distance from Ps to each existing road boundary line one by one, obtain the minimum value in each shortest distance, denoted as PsPe, wherein Pe refers to the terminal point of the PsPe line segment on the existing road boundary line, as shown in Figure 19 .

[0078] Obtain the contour line intersecting the existing road boundary line, and the intersection points are denoted as Rh1, Rh2, …, Rhn, and the elevation value of Rh1, Rh2, …, Rhn is the elevation value of the intersecting contour line, as shown in Figure 20The elevation of each point on the existing road edge line is subdivided, and the existing road edge line is segmented by Rh1, Rh2,... Rhn. The length of the Rh1-Rh2 polyline segment is L12. A plurality of new points a1, a2,... aj are arranged on the Rh1-Rh2 polyline segment with a maximum interval of 1. The distance of the new point aj from the end point Rh1 is lj, and the distance ratio is t = lj / L12. The elevation of the new point aj is equal to the elevation of Rh1 + t x (the elevation of Rh2 - the elevation of Rh1). The above steps are sequentially performed to complete the elevation subdivision of Rh1-Rh2 to Rhn-1-Rhn. The nearest point Rhn to Pe is obtained. The elevation of Pe is equal to the elevation of the point Rhn. The elevation and distance between Ps and Pe are calculated, and it is determined whether the maximum slope 8% is satisfied. If the above formula is not satisfied, the point with the shortest distance to Pe and the lowest elevation on the existing road edge line is found, and the point with the elevation closer to the elevation of the starting point of the road is selected as a new Pe. The maximum slope is determined again. If the above formula is satisfied, the point Pe and the length Ps-Pe are obtained. If no Pe satisfying the requirements can be found on the existing road, the solution is abandoned, and the scheme is abandoned.

[0079] As an optional embodiment, the method can further include: step 503, calculating the distance cost by using Manhattan distance; step 504, summing the absolute value of the elevation difference of adjacent grids on the path to obtain the elevation change cost; and step 505, weightedly summing the distance cost and the elevation change cost to obtain the total cost of the path, and selecting the path with the minimum total cost as the optimal road path from the starting point to the connection point.

[0080] In this step, the road should pass through as few contour lines as possible; if the number of contour lines to be passed through is certain, the change in road elevation should be as uniform as possible. A circle with Ps-Pe as the diameter is drawn, and the circumscribed rectangle of the circle is obtained. A grid Cell is established in the circumscribed rectangle, and the grid Cell is 5*5. The contour line closest to the center point of the Cell is obtained, and the elevation of the contour line is the elevation score H of the Cell. By a method similar to the A* pathfinding algorithm, the path of the road is generated.

[0081] Two sets are established, openlis and closelist, openlis is used to record all the points that have been traversed, these points can be repeatedly traversed and the distance cost is updated; closelist is used to record the point with the minimum distance cost among all the traversed points at the current position (derived from the closelist set), and the point put into the closelist set is no longer repeatedly traversed and updated. The cost function f(x) = g(x) + h(x). g(x) = the distance cost (calculated by Manhattan distance) from the starting point to the intermediate point + the elevation change cost h(x) = the distance cost (calculated by Manhattan distance) from the intermediate point to the terminal point + the elevation change cost; the distance cost: 1 for each movement of 1 grid in the orthogonal direction or at an angle of 45°; the elevation change cost: the sum of the absolute values of all adjacent elevation differences, that is, ∑|Hn-1-Hn| (n = 1, 2, 3, …, i), the number in the grid is regarded as the elevation score H of the cell, the starting point Ps and the terminal point Pe are determined, as shown in Figure 21 .

[0082] The eight points in the neighborhood of the starting point Ps are traversed (only five in the example due to the position of the starting point), and the distance cost of each point in the neighborhood is calculated by the cost function f(x) = g(x) + h(x).

[0083] In each calculation formula, g(x) is in the first bracket, and h(x) is in the second bracket. The different paths result in different elevation change costs, so h(x) can have two values. The smaller value is taken. The point with the minimum distance cost in this round is 20, which is put into closelist, as shown in Figure 22 . The neighborhood around the point in the last closelist is continuously traversed, and the distance cost of each point in the neighborhood is calculated by the cost function. 6. The above steps are looped until the Pe point is found. According to the record in closelist, the shortest path is found by backtracking from the target point to the starting point, which is the yellow line of connection. Figure 23 .

[0084] As an optional embodiment, after the road combination connecting the points is generated by the routing algorithm, the method can further include: rounding the broken line of the road path to generate a smooth curve; offsetting the smooth curve to both sides by a preset distance to generate two parallel road side lines.

[0085] In this step, the generated broken line is rounded to generate a smooth curve, the smooth curve is offset to both sides once respectively, the offset distance is 2, the two curves after offset are retained, and the curve before offset is deleted.

[0086] The density score corresponding to the construction site is taken as the construction site score; the longer the road length, the lower the score. The total score is 0-100, the maximum length is 200, and higher than 200 is 0 points. The minimum length is 0, and at this time, 100 points. Road score = max(0, 100-(road length / 200 x 100)), after the function runs-show the generated multiple schemes, as shown in Figure 24 After the function runs, the user opens the generated scheme, as shown in Figure 25

[0087] The above is the method embodiment of the present application. Based on the same inventive concept, the embodiments of the present application also provide a building site and road generation device based on contour lines, the structure of which is shown in Figure 26

[0088] Figure 26 The internal structure of a building site and road generation device based on contour lines provided by the embodiments of the present application is shown in Figure 26 The device comprises:

[0089] at least one processor 2601;

[0090] and a memory 2602 in communication connection with the at least one processor;

[0091] The memory 2602 stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor 2601 to enable the at least one processor 2601 to: receive a to-be-arranged area of a construction site framed by a user in a topographic map, extract vector data of a ground object layer, an elevation contour line layer and an existing road layer in the topographic map; obtain an unarrangeable area according to the ground object layer, and subtract the unarrangeable area from the to-be-arranged area to obtain a to-be-arranged area; divide the to-be-arranged area into a grid, calculate an elevation score, a contour line density score and a road distance score based on the elevation contour line layer and the existing road layer, to screen out multiple candidate construction site center points; determine the orientation of the construction site through cluster analysis according to the peripheral contour line direction of the candidate construction site center point; and according to the road starting point of the preset construction site, find a connecting point on the existing road that meets the slope requirement, and generate a road combination of the connecting point through a pathfinding algorithm.

[0092] Some embodiments of the present application provide a corresponding Figure 1 ​​The nonvolatile computer storage medium of a contour-based building site and road generation, which stores computer executable instructions, is configured to: receive a to-be-laid region of a building site framed by a user in a topographic map, extract vector data of a ground object layer, an elevation contour layer and an existing road layer in the topographic map; obtain an un-layable region according to the ground object layer, and deduct the to-be-laid region to obtain a to-be-laid region; divide the to-be-laid region into a grid, calculate an elevation score, a contour density score and a road distance score based on the elevation contour layer and the existing road layer, to screen a plurality of candidate building site center points; determine the orientation of the building site according to the peripheral contour direction of the candidate building site center point through cluster analysis; preset a road starting point of the building site, find a connecting point meeting the slope requirement on the existing road, and generate a road combination of the connecting point through a pathfinding algorithm.

[0093] The various embodiments in the present application are described in a progressive manner, and the same or similar parts of each embodiment can be referred to each other. Each embodiment focuses on the difference from other embodiments. In particular, the IoT device and medium embodiments are basically similar to the method embodiments, and thus are described simply. The relevant parts can be referred to the description of the method embodiments.

[0094] The system and medium provided by the embodiments of the present application are one-to-one corresponding to the method, and thus the system and medium also have similar beneficial technical effects to the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the system and medium will not be described here.

[0095] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0096] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks, can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions described in the flowcharts and / or block diagrams.Figure 1 apparatuses that perform the functions recited in block Figure 1

[0097] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the Figure 1 apparatuses that perform the functions recited in block Figure 1

[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the Figure 1 apparatuses that perform the functions recited in block Figure 1

[0099] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0100] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) and / or cache memory. The memory can also include non-volatile memory, such as read-only memory (ROM), electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or non-volatile random access memory (NVRAM). The memory is an example of computer readable media.

[0101] Computer readable media includes permanent and non-permanent, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0102] ​​​It should also be noted that the terms "comprising," "including," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can also include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises a... " does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0103] The above description is merely illustrative of the application, and not restrictive. Various modifications and changes can become apparent to those skilled in the art. Incorporating any modification, equivalent substitution, improvement, etc. within the spirit and principle of the application, shall be included in the scope of the claims of the application.

Claims

1. A contour-based building site and road generation method, characterized by, The method comprises: receiving a to-be-laid area of a building site framed by a user in a topographic map, and extracting vector data of a ground object layer, an elevation contour line layer and an existing road layer in the topographic map; obtaining an un-layable area according to the ground object layer, and deducting the un-layable area from the to-be-laid area to obtain a to-be-laid area; dividing the to-be-laid area into grids, calculating an elevation score, a contour line density score and a road distance score based on the elevation contour line layer and the existing road layer, and screening a plurality of candidate building site center points; determining an orientation of the building site according to a peripheral contour line direction of the candidate building site center point through cluster analysis; presetting a road starting point of the building site according to the orientation, searching for a connection point meeting a slope requirement on the existing road, and generating a road combination of the connection point through a pathfinding algorithm.

2. The contour-based building site and road generation method according to claim 1, wherein, The method further comprises: identifying a closed area and a non-closed ground object in the ground object layer, and directly taking the closed area as an un-layable area; for the non-closed ground object, generating a concave hull through a rolling ball algorithm, and expanding the ground object boundary outward by a preset retreat distance range to obtain the un-layable area.

3. The contour-based building site and road generation method of claim 1, wherein, The method further comprises: obtaining an elevation value of the contour line closest to the grid center point as the elevation of the grid; sorting the elevations, and excluding grids with a highest and lowest preset proportion; calculating the contour line density score based on the number of contour lines in the grid and the total length of the contour lines; normalizing the minimum distance from the grid center point to the nearest road to obtain the road distance score; weighting and summing the elevation score, the contour line density score and the road distance score to obtain a grid comprehensive score, and sorting the grid comprehensive score to obtain the plurality of candidate building site center points.

4. The contour-based building site and road generation method of claim 1, wherein, The method further comprises: extracting a starting point and an ending point of each contour line in the grid, and calculating an included angle based on the north direction; weighting and averaging the included angles to obtain a direction angle of the grid based on the length of the contour line.

5. The contour-based building site and road generation method according to claim 4, wherein The method further comprises: performing K-means clustering on the direction angle of the grid to obtain a cluster center; taking the cluster center as a candidate orientation, respectively trying to arrange a building site block, and calculating an average value of a density score in a preset range; selecting an orientation with the highest density score as a recommended orientation.

6. The contour-based building site and road generation method of claim 1, wherein, The method further comprises: extracting an intersection of the existing road boundary line and the contour line, and performing elevation interpolation on the existing road boundary line; finding a point meeting the slope requirement on the interpolated existing road boundary line as a candidate connection point.

7. The contour-based building site and road generation method according to claim 6, wherein The method further comprises: calculating a distance cost by using Manhattan distance. Summing up absolute values of height differences of adjacent grids on the path, a height change cost is obtained; Weighted sum of the distance cost and the height change cost, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path is obtained, the total cost of the path 8. The contour-based building site and road generation method of claim 1, wherein, ​ ​ ​ 9. An apparatus, comprising: ​ ​ ​ ​ ​ ​ ​ ​ ​ 10. A non-transitory computer storage medium storing computer-executable instructions that, when executed, cause a computer to perform a method comprising: ​ ​ ​ ​ ​ ​