Disclosure of Invention
The invention provides an underground pipeline distribution analysis method and system, aiming at the problems that the efficiency is low and the accurate underground pipeline distribution condition cannot be obtained by excavating or manually analyzing according to the existing underground pipeline data in the prior art.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows: an underground pipeline distribution analysis method is characterized by comprising the following steps:
defining a point P and a point Q as two points on the earth surface selected by a user respectively, defining a point O as the sphere center of the earth, and defining a plane OPQ as a section to be analyzed;
defining a surrounding ball, wherein the diameter of the surrounding ball is the distance between a point P and a point Q, and the center O1 of the surrounding ball is the midpoint of a line segment between the point P and the point Q;
the underground pipeline distribution analysis method comprises the following steps:
a step (A): determining a pipeline area to be analyzed according to the positions of the points P and Q;
step (B): constructing a bounding box with a cuboid shape according to the starting point coordinates and the end point coordinates of each pipeline in the pipeline area to be analyzed, so that all pipelines in the pipeline area to be analyzed are in the range of the bounding box;
step (C): constructing an octree object in the bounding box, dividing the bounding box into 8 first nodes, and defining areas corresponding to the divided nodes in the bounding box as sub-bounding boxes with cuboid shapes corresponding to the nodes;
the pipeline is accommodated in the corresponding first node by judging whether the first characteristic point on the pipeline is positioned in the sub-surrounding box corresponding to the first node;
if the number of pipelines accommodated by the first node exceeds N, adding 1 to the recursion depth of the octree, and dividing the first node into 8 second nodes;
the pipeline is accommodated in the corresponding second node by judging whether the first characteristic point on the pipeline is positioned in the sub-surrounding box corresponding to the second node;
analogizing in sequence until the number of pipelines contained by each node in the bounding box does not exceed N, so that each pipeline in the bounding box is contained in each node of the bounding box;
step (D): judging whether the bounding volume and the bounding box have an overlapping area;
if the judgment result is negative, the plane OPQ is not intersected with each pipeline in the bounding box;
if so, judging whether the surrounding ball has an overlapping area with each sub surrounding box corresponding to each first node;
if the surrounding ball is judged to have an overlapping area with the sub-surrounding box corresponding to the first node, judging whether the first node is divided into 8 second nodes or not;
if the judgment result is negative, taking each pipeline contained in the first node as a pipeline to be analyzed;
if the judgment result is yes, judging whether the surrounding ball has an overlapping area with each sub surrounding box corresponding to each second node;
if the subspacer boxes corresponding to the bounding balls and the second nodes are judged to have the overlapping areas, whether the second nodes are divided into 8 third nodes is judged;
if the judgment result is negative, taking each pipeline contained in the second node as a pipeline to be analyzed;
if the judgment result is yes, judging whether the surrounding ball has an overlapping area with each sub surrounding box corresponding to each third node;
repeating the steps until the judgment results are negative;
a step (E): and (D) judging whether each pipeline to be analyzed obtained in the step (D) is intersected with the plane OPQ or not, so as to obtain the pipeline distribution on the plane OPQ.
In the invention, the pipeline distribution on the required section is analyzed according to two points which are selected by a user and need to be analyzed. To facilitate building the octree model in a bounding box, the position of the first feature point on the pipeline in space is used to determine in which sub-bounding box the pipeline is. The upper limit N of the number of pipelines accommodated in each node is limited, and when the number of pipelines accommodated in each node exceeds the upper limit, the node is continuously divided into 8 nodes, so that the problem that excessive pipelines are accommodated in one node is avoided, and when the sub-bounding box corresponding to the node and the bounding ball have an overlapping range, the number of pipelines passing through the cross section is not too large, so that the algorithm is simplified. By judging whether the larger sub-bounding box has an overlapping area with the bounding ball or not, the pipeline in the sub-bounding box which is not overlapped with the bounding ball is quickly eliminated, and the range is quickly reduced. When a large sub bounding box and a bounding ball have an overlapping region, whether the sub bounding ball is continuously divided into 8 smaller sub bounding balls or not is judged (namely whether the nodes are further divided into 8 nodes or not), if not, pipelines in the sub bounding ball are brought into a range to be analyzed, if the sub bounding ball is continuously divided, whether the smaller sub bounding box and the bounding ball have the overlapping region or not is continuously judged, and the like.
In the above technical solution, the step (B) is replaced with the following step (B1):
step (B1): constructing an ith bounding box in a cuboid shape according to the start point coordinates and the end point coordinates of each pipeline belonging to the ith batch in the pipeline area to be analyzed, so that each pipeline belonging to the ith batch is in the range of the ith bounding box; the underground pipeline distribution analysis method further comprises the following steps: for each bounding box, steps (C) - (E) are performed.
The applicant finds, during research, that if a large number of pipelines belong to different batches (constructed at different times) in a region to be analyzed, if all pipelines are constructed in the same bounding box, the volume of the bounding box is large, and the pipelines need to be disassembled into multiple layers of nodes in the follow-up process, each layer of nodes needs to be divided into multiple sub bounding boxes, whether overlapping regions exist between each sub bounding box and a bounding ball needs to be judged, the divided sub bounding boxes are in a cubic shape, and the pipelines of the same sub bounding box may belong to different batches, so that the algorithm efficiency is low, and the batches of pipelines which are mainly on a section to be analyzed cannot be quickly judged.
In a further development of the invention, the bounding box for each batch of pipelines can be constructed separately. Because the distance of pipelines in the same batch is close, the construction of bounding boxes corresponding to pipelines in the same batch is convenient, the volume of each bounding box can be in a proper size range, and only the fact that whether the bounding box corresponding to the bounding ball and each batch has an overlapping region needs to be judged respectively, if the bounding box does not have the overlapping region with the bounding box, the bounding box does not need to be considered, and only a small number of bounding boxes having the overlapping region with the bounding ball need to be considered, so that the algorithm efficiency is high.
In the above technical solution, the first characteristic point on the pipeline is a point on the pipeline between the pipeline start point and the pipeline end point;
the underground pipeline distribution analysis method further comprises the following steps:
obtaining the corresponding relation between the coordinates of the starting point and the ending point of each pipeline and each node in the step (C) by judging whether the coordinates of the starting point and the ending point of each pipeline are positioned in the sub surrounding boxes corresponding to each node obtained by division in the step (C);
for each pipeline, judging whether the node corresponding to the pipeline starting point coordinate, the node corresponding to the pipeline end point coordinate and the node where the pipeline is located in the step (C) are the same node or not;
if the judgment result is negative, judging whether the pipeline is intersected with the plane OPQ;
if the pipeline is judged to intersect with the plane OPQ, updating the pipeline distribution obtained in the step (E).
The applicant has found during research that in order to facilitate the construction of octrees in bounding boxes, the first characteristic point on a pipeline is selected to represent the position of the pipeline. However, when an octree is constructed, if a cube is divided into eight smaller cubes (sub bounding boxes), there may be a case where the first feature point on the pipeline is in a certain sub bounding box, but the start point and the end point on the pipeline are in other sub bounding boxes, and if it is determined subsequently whether there is an overlapping region between the sub bounding box and the bounding ball, there may be a case where there is no overlapping region between the bounding ball and the sub bounding box where the first feature point on the pipeline is located, but there is an overlapping region between the bounding ball and the sub bounding box where the start point or the end point on the pipeline is located, that is, the pipeline is actually on the section to be analyzed, and there is a possibility of erroneous determination in such a manner that the first feature point on the pipeline represents the location of the pipeline.
In a further improvement of the present invention, each pipeline starting point coordinate and each pipeline ending point coordinate correspond to each node in step (C), that is, if there is only a first node in a certain area in step (C), but the first node is not divided into 8 second nodes, and the pipeline starting point coordinate is in the area corresponding to the first node, the pipeline starting point coordinate corresponds to the first node. If a certain area is divided into at most third nodes in the step (C) and the pipeline starting point coordinate is in the area corresponding to the third node, corresponding the pipeline starting point coordinate to the third node. Through the further improvement scheme, whether the node where the pipeline is located in the step (C) (namely the node where the pipeline is drawn in according to the first characteristic point on the pipeline in the step (C)), the node corresponding to the coordinates of the starting point of the pipeline and the node corresponding to the coordinates of the terminal point of the pipeline are the same node can be judged, if the node is not the same node, the misjudgment is caused, namely the pipeline with an overlapping area with the surrounding ball is omitted, the pipeline can be considered, whether the pipeline is intersected with the plane OPQ is judged, and therefore the misjudgment is avoided.
In the above technical solution, the definition: d is the distance between the center O2 of the bounding box and the center O1 of the bounding sphere, d1 is the distance between the center O2 of the bounding box and the corner point of the bounding box, d2 is the minimum value of the distance between the center O2 of the bounding box and each surface of the bounding box, and r is the radius of the bounding sphere;
judging whether the bounding balls and the bounding boxes have overlapping regions or not, and judging whether the sub bounding balls and the sub bounding boxes have overlapping regions or not by adopting the same method;
in the step (D), the method of determining whether there is an overlapping area between the bounding volume and the bounding box includes:
step (D1): judging whether d is greater than or equal to d1+ r, and if so, judging that the bounding box and the bounding box have no overlapping area; judging whether d < d2+ r is true or not, and if so, judging that the bounding box and the bounding box have an overlapping region; if D is not less than D1+ r and D is less than D2+ r, executing the step (D2);
step (D2): determining a point M closest to the center O1 of the bounding box on each surface of the bounding box, judging whether the distance between the M and the O1 is smaller than r, if so, judging that the bounding box has an overlapping area with the bounding box, otherwise, judging that the bounding box has no overlapping area with the bounding box.
In the research of the applicant, it is found that whether the bounding box and the bounding box have an overlapping region is generally judged whether the distance from the point on the bounding box closest to the center of the bounding box is greater than the radius of the bounding box, but a certain time is required for finding the point on the bounding box closest to the center of the bounding box in the first step. In the invention, whether d is more than or equal to d1+ r and d is less than d2+ r is judged, so that the bounding box which has no overlapping region with the bounding ball obviously (namely, d is more than or equal to d1+ r) or the bounding box which has an overlapping region obviously (namely, d is less than d2+ r) can be found out quickly, and the complexity of the algorithm is reduced.
In the above technical solution, in the pipeline length direction, the range of the distance between the first characteristic point on the pipeline and the pipeline end is [ L/3,2L/3], and L is the pipeline length.
In a preferred embodiment, the first characteristic point on the pipeline is a midpoint in the length direction of the pipeline. The end of the pipeline refers to the end of the pipeline in the length direction.
The applicant finds that, in research, by selecting the first characteristic point on the pipeline as the midpoint in the length direction of the pipeline, the position of the pipeline can be better represented in the bounding box, and the construction of the octree in the bounding box is facilitated.
In the above technical solution, if the point P and the point Q are located in the same administrative area, the pipeline area to be analyzed is the pipeline area corresponding to the administrative area.
In a preferred embodiment, the administrative area is one of a local administrative district, a county administrative district, and a rural administrative district.
In the above technical scheme, the plane OPQ is a road cross section or a road vertical section.
In the above technical solution, the distance between the point P and the point Q and the size of h are compared, and if the distance between the point P and the point Q is smaller than h, the diameter of the enclosing ball is adjusted to h, where h is the maximum burial depth of each pipeline in the pipeline region to be analyzed.
According to the invention, the bounding box is easy to construct and convenient to analyze through the arrangement.
In the above technical solution, the pipeline includes a built pipeline and/or a designed and unfinished pipeline.
In the present invention, when analyzing the distribution of pipelines on the cross section, only the built pipelines, or only the designed and non-built pipelines can be analyzed, or the distribution of the built pipelines and the designed and non-built pipelines can be analyzed at the same time.
The invention also provides an underground pipeline distribution analysis system, which comprises computer equipment;
the computer device is configured or programmed to perform the steps of any of the underground utility distribution analysis methods described above.
The invention has the advantages and positive effects that: the invention relates to a method for analyzing a cross section by utilizing a space bounding box octree index and a space bounding sphere algorithm of a pipeline; the method can be applied to the applications of large data volume of three-dimensional scenes of digital cities and smart cities.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
At present, the cross section analysis function of the three-dimensional urban underground pipeline is not realized by the Cesium packaged based on a Cesium open source library or SuperMap WebGL and the like, and the three-dimensional cross section analysis has important guiding significance in three-dimensional underground application, so that a cross section analysis method based on box model cutting is urgently needed.
The invention aims to provide a method for determining the distribution of pipelines on a cross section by constructing a space bounding box by using two three-dimensional points in a three-dimensional space and judging the inclusion and intersection relationship between the bounding box and the three-dimensional pipeline based on the model data of the three-dimensional pipeline. In the actual municipal road construction, under the condition that pipelines do not need to be excavated on site, an underground pipeline cross section analysis map is directly generated according to two three-dimensional points randomly selected by a mouse in a three-dimensional scene (the points selected by the mouse are generally positioned on a model such as oblique photography, and the three-dimensional points selected by the mouse correspond to actual three-dimensional geographic coordinates, namely longitude, latitude, elevation of one position on the earth), the mutual positions of all pipelines in the horizontal direction and the underground burying condition are analyzed and reflected, and information such as pipeline materials, buried depth, pipe diameter, length, historical years, pipeline spacing and the like in the position are checked from a main view, so that the method has important significance for exploring the spatial distribution of the underground three-dimensional pipelines so as to guide actual engineering construction excavation and the like.
As shown in fig. 3, the present invention provides an underground pipeline distribution analysis method, where a point P and a point Q are defined as two points on the earth surface selected by a user in a three-dimensional scene. The point O is defined as the center of the earth, and the plane OPQ is defined as the cross-section to be analyzed (i.e. the plane of the three-dimensional space formed by the center of the earth ellipsoid and two points on the earth's surface), as shown in fig. 2. The plane OPQ may be a cross-section of a road or a longitudinal section of a road.
A bounding sphere is defined, the diameter of the bounding sphere is the distance between the points P and Q, and the sphere center O1 of the bounding sphere is the midpoint of the line segment between the points P and Q, as shown in fig. 1.
Underground pipelines are generally buried no more than 20 meters below ground. Therefore, in the present embodiment, the midpoint of the line segment between the point P and the point Q is taken as the center of sphere (the center of the spheroid of revolution based on the geodetic plane, i.e., the geographic centroid), and the distance between the point P and the point Q is taken as the diameter to construct the bounding sphere, so that the bounding sphere can be guaranteed to have a sufficient depth in general. In a preferred embodiment, the distance between point P and point Q, the size of h, can also be compared, and if the distance between point P and point Q is less than h, the sphere diameter is adjusted to h, where h is the maximum of each pipeline in the pipeline area to be analyzed
The underground pipeline distribution analysis method comprises the following steps:
step (A): and determining the pipeline area to be analyzed according to the positions of the points P and Q.
Step (B): and constructing a bounding box with a cuboid shape according to the start point coordinates and the end point coordinates of each pipeline in the pipeline area to be analyzed, so that all pipelines in the pipeline area to be analyzed are within the range of the bounding box.
The step (B): the bounding box with the smallest volume is preferably constructed according to the start point coordinate and the end point coordinate of each pipeline in the pipeline area to be analyzed. The bounding box may have a face parallel to a ground plane.
When the pipeline region being analyzed has a plurality of batches of pipelines, replacing step (B) with step (B1): and constructing an ith bounding box in a cuboid shape according to the start point coordinates and the end point coordinates of each pipeline belonging to the ith batch in the pipeline area to be analyzed, so that each pipeline belonging to the ith batch is within the range of the ith bounding box. For each bounding box, steps (C) - (E) are performed.
In geophysical field exploration, pipeline data of multiple batches generally refers to pipelines built at different times, for example, the existing pipeline is the current pipeline, and the pipeline is usually a batch; the design pipeline is the pipeline to be newly built and is generally named as another batch. The pipelines of different batches generally do not cross in space, and in practice, need to be connected together, i.e. the newly-built pipelines and the existing pipelines are connected, so that the pipelines are communicated. Different batches of pipelines generally need to be managed separately for easy renewal and maintenance, each batch of pipelines containing a large number of pipe points and pipelines, each pipeline being a straight line from a starting point to a finishing point. The pipeline data of each batch are respectively written into different JSON files, and the JSON file name and the pipeline batch name are kept consistent.
And reading the JSON file of each batch of pipeline data. Wherein, each batch pipeline JSON file corresponds to one data source object. The data source refers to a source of the pipeline data, for example, the source of the pipeline data is the pipeline data; the design pipeline source is design pipeline data.
In this step, the outer bounding box of each data source object is computed. And traversing all the pipeline data corresponding to each data source object, and calculating the outer AABB bounding box range of the batch of pipeline data. Firstly, finding out a square contour line of the pipeline in the batch, then stretching the contour line from the altitude 0 according to the side length of the square to form a cube bounding box, and aiming at each batch of data, independently constructing a bounding box object to be mounted on an octree object of the data in the batch for subsequent collision analysis. Meanwhile, in the traversing process, the midpoint coordinate in the pipeline length direction is obtained according to the starting pipe well (the well below the municipal road well cover) and the ending pipe well of each pipeline, and the midpoint coordinate is used for constructing a space octree subsequently. The pipeline information generally includes information about the starting pipe well, the ending pipe well, the pipe diameter, the material of the pipeline, and the like.
Step (C): and constructing an octree object in the bounding box, dividing the bounding box into 8 first nodes, and defining the areas corresponding to the nodes divided in the bounding box as sub-bounding boxes with cuboid shapes corresponding to the nodes.
And the pipeline is accommodated in the corresponding first node by judging whether the first characteristic point on the pipeline is positioned in the sub-surrounding box corresponding to the first node.
For example, if the midpoint is taken as the first feature point, the pipeline is accommodated in a first node if the midpoint on the pipeline is located in a sub-enclosure box corresponding to the first node.
If the number of pipelines accommodated by the first node exceeds N, the recursion depth of the octree is added with 1, and the first node is divided into 8 second nodes.
And the pipeline is accommodated in the corresponding second node by judging whether the first characteristic point on the pipeline is positioned in the sub-surrounding box corresponding to the second node.
And the rest is repeated until the number of pipelines contained by each node in the bounding box does not exceed N, so that each pipeline in the bounding box is contained in each node of the bounding box.
In the step (C), if the first feature point on the pipeline is located at the boundary of two nodes, the pipeline may be divided into any one of two intersection points.
A spatial octree object of each batch of pipeline data is constructed for the batch of pipeline data. And (c) constructing an octree object according to the bounding box calculated in the step (B), in this example, setting the maximum depth of the octree to be 8, and setting the maximum number of pipelines accommodated by each child node (the first node and the second node … … are child nodes) to be 100, that is, the octree depth has at most 8 layers, each layer can be subdivided into 8 child nodes, and the maximum number of pipelines accommodated by each child node is 100. If each child node is subdivided into 8 levels, then there are 8 power of 7 child nodes in level 8 of the octree, i.e., 2097152 child nodes, and the level 8 child node can accommodate 209715200 pipelines at most. Of course, in practical application of the algorithm, the depth of the octree and the maximum number of pipelines each child node can be adjusted according to the size of the pipeline data volume, the performance of the computer and the consumed time.
Each node of the octree represents a cuboid volume element (i.e., a sub-bounding box having a cuboid shape corresponding to the node). The maximum recursion depth H of the octree object is in the range of [6,10], and N is in the range of [80,150]. Preferably, H =8,n =100.
When inserting pipeline data into the octree object, traversing all pipeline data in the batch, calculating a midpoint coordinate in the length direction of the pipeline according to the positions of a starting pipe well and a stopping pipe well of each pipeline, and inserting other accessory information (such as information of material, burial depth, pipe diameter, length, historical year, pipeline spacing and the like) of the pipeline into a certain node of the octree object as value by taking the midpoint coordinate in the length direction of the pipeline as key for displaying the subsequent accessory information of the pipeline.
The specific process of inserting pipeline data into the octree object is as follows:
1) Firstly, inserting data into an octree root node (a first node in the embodiment);
2) When the number of pipelines in the root node is greater than the threshold value 100, dynamically dividing the root node, and then inserting data exceeding the threshold value into the child nodes (second nodes in the embodiment); and (5) circularly traversing, and finally storing all pipeline data into the constructed octree.
Municipal drainage pipe lines are generally 40-50 meters in length, and pipe lines over 1 kilometer are generally abnormal data, so that insertion of bounding boxes based on midpoint positions instead of municipal pipe lines generally does not occur when multiple bounding boxes are inserted. If the number of the sub-nodes of a certain level for accommodating pipelines exceeds 100, the octree level is continuously subdivided until the maximum depth of the octree reaches 8.
Octree depth 8 and 100 pipelines per sub-bounding box were experimental values. A depth of 8, 100 pipelines per sub-bounding box is defined, which generally meets the pipeline requirements of a city level. Excessive values of the two values cause waste of algorithm space; too small may not contain all of the lines. In practice, these two values can be adjusted as required.
A step (D): judging whether the bounding volume and the bounding box have an overlapping area;
if the judgment result is negative, the plane OPQ is not intersected with each pipeline in the bounding box;
if so, judging whether the surrounding ball has an overlapping area with each sub surrounding box corresponding to each first node;
if the surrounding ball is judged to have an overlapping area with the sub-surrounding box corresponding to the first node, judging whether the first node is divided into 8 second nodes or not;
if the judgment result is negative, taking each pipeline contained in the first node as a pipeline to be analyzed;
if the judgment result is yes, judging whether the surrounding ball has an overlapping area with each sub surrounding box corresponding to each second node;
if the surrounding ball is judged to have an overlapping area with a sub-surrounding box corresponding to the second node, whether the second node is divided into 8 third nodes is judged;
if the judgment result is negative, taking each pipeline contained in the second node as a pipeline to be analyzed;
if the judgment result is yes, judging whether the surrounding ball has an overlapping area with each sub surrounding box corresponding to each third node;
and repeating the steps until the judgment result is negative.
In this step, pipeline data of a plurality of batches are quickly traversed through a spatial octree index, and pipeline data N in a bounding sphere constructed by any two points selected by the user in the three-dimensional scene in step 1 is solved.
And (3) determining a search range (namely a display area for cross section analysis) by a bounding sphere (marked as a bounding sphere T) constructed by any two points P, Q selected by a user in the three-dimensional scene, respectively traversing the spatial octree indexes of the pipeline data of each batch constructed in the step (C), and performing spatial collision analysis on the spatial octree indexes and the bounding sphere T. That is, for each batch of pipeline data, steps (C) -E are performed.
The specific steps of performing spatial collision analysis on the spatial octree index object surrounding the sphere T and the single batch of three-dimensional pipeline data are as follows:
step D.1: for a single batch of three-dimensional pipeline data, extracting an octree object constructed for the single batch of three-dimensional pipeline data, constructing an AABB bounding box B according to the minimum three-dimensional coordinate and the maximum three-dimensional coordinate in the octree object, and then carrying out collision analysis on the bounding box B and a bounding ball T (the collision analysis is based on the steps of acquiring a three-dimensional point Q which is closest to the center of the bounding ball T on the bounding box B, then calculating the distance da from the three-dimensional point P to the center of the bounding ball T, and if the distance da is smaller than the radius of the bounding ball, judging that the bounding ball T collides with the bounding box B).
Step D.2: traversing the three-dimensional pipeline data of other batches if the bounding box B and the bounding ball T do not collide; if the bounding box B collides with the bounding sphere T, judging whether the spatial octree object of the single batch of three-dimensional pipeline data has child nodes, if the octree object has no child nodes, indicating the tail node of the octree, storing the octree object in a result set; if the octree object has child nodes, the octree object also has child nodes, all the child nodes are traversed in sequence, AABB bounding boxes of the child nodes are obtained and constructed, and then recursive collision detection is carried out on the AABB bounding boxes and the bounding sphere T until the tail node of the octree object is reached.
Through the two steps, octree nodes which cannot intersect with the bounding sphere T can be quickly eliminated, and pipeline data in the intersected nodes are obtained, so that the analysis speed is greatly increased.
A step (E): and (D) judging whether each pipeline to be analyzed obtained in the step (D) is intersected with the plane OPQ or not, so as to obtain the pipeline distribution on the plane OPQ.
In this step, the intersection between the result obtained in step (D) and the plane OPQ (intersection between the line in the three-dimensional space and the plane in the three-dimensional space) is obtained, and finally the intersection condition between the constructed cross section and the underground pipeline (i.e. the pipeline distribution under the cross section) is obtained. The method comprises the following specific steps: and respectively solving the intersection points of the pipeline set N and the plane OPQ by using a vector method, and judging which pipelines in the pipeline set N are intersected with the plane OPQ, so as to obtain the intersection condition of the constructed cross section and the underground pipelines (namely the pipeline distribution under the cross section).
The pipeline information comprises three-dimensional coordinates of a starting pipe well and a stopping pipe well of the pipeline, pipe diameters, pipeline materials, pipeline lengths, pipeline construction time, pipeline burial depths and pipeline intervals.
A certain point of the pipeline in the length direction is to be understood as that point of the pipeline in the length direction and at the midpoint in the width direction of the pipeline. For example, the coordinate of the middle point of the pipeline in the length direction is selected, i.e. the three-dimensional coordinates of the middle point in the length direction and the middle point in the width direction of the pipeline are selected. Other stores of the pipeline can be selected as the three-dimensional coordinates of a certain position of the pipeline according to actual needs.
In this application, the bounding box may be an AABB bounding box. The AABB bounding box is the earliest bounding box to apply. It is defined as the smallest hexahedron containing the object with the sides parallel to the coordinate axes. So describing an AABB, only six scalars are needed. The AABB bounding box has a simple structure, a small storage space and poor compactness, particularly for irregular geometric bodies, a large redundant space is formed, and when an object rotates, the object cannot be correspondingly rotated. The processing object is rigid and convex, and is not suitable for complex virtual environment conditions involving soft body deformation.
A bounding sphere is defined as the smallest sphere that contains the object. Determining a bounding sphere, firstly, calculating the mean value of x, y and z coordinates of vertexes of all elements in a basic geometric element set forming the object respectively to determine the sphere center of the bounding sphere, and then determining the radius r according to the distance between the sphere center and a point determined by three maximum value coordinates. The collision detection of the surrounding ball mainly uses a ball body to surround the whole geometric body, and compares the radius between two balls and the distance between the two balls and the center of the ball. Both geometry and intersection tests are simple, but their compactness is too poor.
Defining: d is the distance between the center O2 of the bounding box and the center O1 of the bounding sphere, d1 is the distance between the center O2 of the bounding box and the corner point of the bounding box, d2 is the minimum value of the distance between the center O2 of the bounding box and each surface of the bounding box, and r is the radius of the bounding sphere; judging whether the surrounding ball and the surrounding box have an overlapping area or not, and judging whether the sub surrounding ball and the sub surrounding box have the overlapping area or not by adopting the same method;
in the step (D), the method of determining whether there is an overlapping area between the bounding volume and the bounding box includes:
step (D1): judging whether d is larger than or equal to d1+ r, and if so, judging that the bounding sphere is not overlapped with the bounding box; judging whether d < d2+ r is true or not, and if so, judging that the bounding box and the bounding box have an overlapping region; if D is not less than D1+ r and D is less than D2+ r, executing the step (D2);
step (D2): determining a point M closest to the center O1 of the bounding box on each surface of the bounding box, judging whether the distance between the M and the O1 is smaller than r, if so, judging that the bounding box has an overlapping area with the bounding box, otherwise, judging that the bounding box has no overlapping area with the bounding box.
The distance between the first characteristic point on the pipeline and the end of the pipeline in the length direction of the pipeline is [ L/3,2L/3], and L is the length of the pipeline, namely the first characteristic point on the pipeline is in the range of 1/3 length to 2/3 length of the pipeline. In a preferred embodiment, the first characteristic point on the pipeline may be a midpoint in the length direction of the pipeline.
If the point P and the point Q are positioned in the same administrative region, the pipeline region to be analyzed is a pipeline region corresponding to the administrative region;
preferably, the administrative region is one of a local administrative district, a county administrative district and a rural administrative district.
The digital city problem that this application is aimed at is generally all to a city, need to analyze pipeline area and generally be the pipeline of a city. If pipelines in each area of a city can be stored separately, a small area is also used as the area of the pipeline to be analyzed.
The pipeline includes a built pipeline and/or a designed and unfinished pipeline. That is, the present application may also determine whether a selected section intersects an unfinished design pipeline.
The invention also provides an underground pipeline distribution analysis system, which comprises computer equipment;
the computer device is configured or programmed to perform the steps of the above-described underground utility distribution analysis method.
Example 2
The first characteristic point on the pipeline is a point on the pipeline between the pipeline starting point and the pipeline ending point;
the underground pipeline distribution analysis method further comprises the following steps:
obtaining the corresponding relation between the coordinates of the starting point and the ending point of each pipeline and each node in the step (C) by judging whether the coordinates of the starting point and the ending point of each pipeline are positioned in the sub surrounding boxes corresponding to each node obtained by division in the step (C);
for each pipeline, judging whether the node corresponding to the pipeline starting point coordinate, the node corresponding to the pipeline end point coordinate and the node where the pipeline is located in the step (C) are the same node or not;
if the judgment result is negative, judging whether the pipeline is intersected with the plane OPQ;
and (E) if the pipeline is judged to intersect with the plane OPQ, updating the pipeline distribution obtained in the step (E).
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other.
The embodiments of the present invention have been described in detail, but the description is only for the preferred embodiments of the present invention and should not be construed as limiting the scope of the present invention. All equivalent changes and modifications made within the scope of the present invention should be covered by the present patent. After reading this disclosure, modifications of various equivalent forms of the present invention by those skilled in the art will fall within the scope of the present application, as defined in the appended claims. The embodiments and features of the embodiments of the present invention may be combined with each other without conflict.