CN114661729B - A method and device for generating pipeline auxiliary lines - Google Patents
A method and device for generating pipeline auxiliary lines Download PDFInfo
- Publication number
- CN114661729B CN114661729B CN202210402545.XA CN202210402545A CN114661729B CN 114661729 B CN114661729 B CN 114661729B CN 202210402545 A CN202210402545 A CN 202210402545A CN 114661729 B CN114661729 B CN 114661729B
- Authority
- CN
- China
- Prior art keywords
- pipeline
- auxiliary line
- point
- line
- index
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 67
- 238000004364 calculation method Methods 0.000 claims abstract description 29
- 238000004590 computer program Methods 0.000 claims description 18
- 238000013519 translation Methods 0.000 claims description 16
- 239000000463 material Substances 0.000 claims description 5
- 239000003550 marker Substances 0.000 claims 1
- 238000012216 screening Methods 0.000 abstract description 2
- 230000009286 beneficial effect Effects 0.000 abstract 1
- VXPSARQTYDZXAO-CCHMMTNSSA-N (4s,4ar,5s,5ar,12ar)-4-(dimethylamino)-1,5,10,11,12a-pentahydroxy-6-methylidene-3,12-dioxo-4,4a,5,5a-tetrahydrotetracene-2-carboxamide;hydron;chloride Chemical compound Cl.C=C1C2=CC=CC(O)=C2C(O)=C2[C@@H]1[C@H](O)[C@H]1[C@H](N(C)C)C(=O)C(C(N)=O)=C(O)[C@@]1(O)C2=O VXPSARQTYDZXAO-CCHMMTNSSA-N 0.000 description 52
- JLYXXMFPNIAWKQ-UHFFFAOYSA-N γ Benzene hexachloride Chemical compound ClC1C(Cl)C(Cl)C(Cl)C(Cl)C1Cl JLYXXMFPNIAWKQ-UHFFFAOYSA-N 0.000 description 39
- 230000008569 process Effects 0.000 description 16
- 230000006870 function Effects 0.000 description 15
- 238000010586 diagram Methods 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 238000003491 array Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 3
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006872 improvement Effects 0.000 description 2
- 238000009440 infrastructure construction Methods 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- VNWKTOKETHGBQD-UHFFFAOYSA-N methane Chemical compound C VNWKTOKETHGBQD-UHFFFAOYSA-N 0.000 description 2
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 239000004568 cement Substances 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 239000007789 gas Substances 0.000 description 1
- 238000010438 heat treatment Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 239000003345 natural gas Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004033 plastic Substances 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2291—User-Defined Types; Storage management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/24569—Query processing with adaptation to specific hardware, e.g. adapted for using GPUs or SSDs
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
- G06T11/203—Drawing of straight lines or curves
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Engineering & Computer Science (AREA)
- Computational Linguistics (AREA)
- Remote Sensing (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域technical field
本发明涉及管线数据处理技术领域,特别是涉及一种生成管线辅助线的方法和装置。The invention relates to the technical field of pipeline data processing, in particular to a method and device for generating pipeline auxiliary lines.
背景技术Background technique
随着社会的发展和当前城市化水平的不断提高,基础建设发展迅猛,地下管网体系越来越大,除原来的给排水网、电网、热力网、通讯线路外,增加了天然气管网、互联网等,地下管网变得越来越复杂。由于基础建设的猛增,缺乏对地下管网的有效管理,造成了重复建设和资源浪费。在施工中,由于不了解地下管网的情况,盲目开工,造成燃气泄漏、挖断水管、通讯中断等破坏地下管网的事件时有发生。With the development of society and the continuous improvement of the current level of urbanization, the infrastructure construction is developing rapidly, and the underground pipe network system is getting bigger and bigger. In addition to the original water supply and drainage network, power grid, heating power network and communication lines, natural gas pipeline network The Internet, etc., the underground pipeline network is becoming more and more complex. Due to the rapid increase in infrastructure construction, the lack of effective management of the underground pipe network has resulted in redundant construction and waste of resources. During the construction, due to the lack of understanding of the underground pipe network, blindly started construction, resulting in gas leakage, digging and disconnection of water pipes, communication interruption and other damage to the underground pipe network occurred from time to time.
在进行旧管网的更新、新管网的设计规划的过程中,需要在已形成的大量管网资料的基础上,根据相应的管线状况进行处理和设计,而传统的手工制图,靠人工记忆的管理和人工统计、分析的管理方式效率低下,很难适应城市化的快速发展的海量数据的要求。In the process of updating the old pipeline network and designing and planning the new pipeline network, it is necessary to process and design according to the corresponding pipeline conditions on the basis of a large amount of pipeline network data that has been formed, while the traditional manual drawing relies on artificial memory The management methods of manual statistics and analysis are inefficient, and it is difficult to adapt to the requirements of massive data in the rapid development of urbanization.
发明内容Contents of the invention
本发明所要解决的技术问题是针对上述现有技术的不足,提供一种克服上述问题或者至少部分地解决上述问题的一种生成管线辅助线方法和装置。The technical problem to be solved by the present invention is to provide a method and device for generating pipeline auxiliary lines that overcome the above-mentioned problems or at least partially solve the above-mentioned problems.
本发明解决上述技术问题的技术方案如下:一方面,本发明实施例公开了一种生成管线辅助线的方法,包括:The technical solution of the present invention to solve the above technical problems is as follows: On the one hand, the embodiment of the present invention discloses a method for generating pipeline auxiliary lines, including:
根据第一预设条件,获取管线数据的管线名称,所述管线数据包括若干段管线和管线标记;Acquiring the pipeline name of the pipeline data according to the first preset condition, the pipeline data including several sections of pipelines and pipeline marks;
根据第二预设条件,对所述管线数据进行空间查询,并依据空间参考坐标系确定所述管线的空间坐标;performing a spatial query on the pipeline data according to a second preset condition, and determining the spatial coordinates of the pipeline according to a spatial reference coordinate system;
创建管线类并根据所述管线类添加要素类索引,所述管线类根据所述管线数据的类型和所述空间坐标的信息创建;Create a pipeline class and add a feature class index according to the pipeline class, the pipeline class is created according to the type of the pipeline data and the information of the spatial coordinates;
根据所述管线的空间坐标和所述要素类索引计算所述管线辅助线的特征点;calculating feature points of the pipeline auxiliary line according to the spatial coordinates of the pipeline and the feature class index;
根据所述管线辅助线的特征点生成第一管线辅助线,并将所述管线标记添加至对应的所述第一管线辅助线。A first pipeline auxiliary line is generated according to the feature points of the pipeline auxiliary line, and the pipeline mark is added to the corresponding first pipeline auxiliary line.
可选的,所述根据所述管线类添加要素类索引,包括:Optionally, the adding feature class index according to the pipeline class includes:
添加要素类数据库索引,用于创建管线点要素类数据库索引和管线线要素类数据库索引,并将数据库索引信息进行存储;Add feature class database index, used to create pipeline point feature class database index and pipeline line feature class database index, and store database index information;
和/或,添加要素类空间索引,根据管线要素图层的几何范围确定所述空间索引起始点和网格值,分别为所述管线点要素类、所述管线线要素类创建空间索引,并计算出管线要素的网格范围,将网格编码进行存储。And/or, add a feature class spatial index, determine the starting point and grid value of the spatial index according to the geometric range of the pipeline feature layer, create a spatial index for the pipeline point feature class and the pipeline line feature class, and Calculate the grid range of pipeline elements, and store the grid code.
可选的,每段所述管线均包括第一端点和第二端点;Optionally, each section of the pipeline includes a first end point and a second end point;
所述根据所述管线的空间坐标和所述要素类索引计算所述管线辅助线的特征点,包括:The calculating the feature points of the pipeline auxiliary line according to the spatial coordinates of the pipeline and the feature class index includes:
根据所述第一端点和所述要素类索引计算所述管线辅助线的第一特征点,所述第一特征点通过将所述第一端点朝向所述管线的法线方向平移后得到,其中,平移的距离为管线的半径;Calculate the first feature point of the pipeline auxiliary line according to the first end point and the feature class index, the first feature point is obtained by translating the first end point toward the normal direction of the pipeline , where the translation distance is the radius of the pipeline;
根据所述第二端点和所述要素类索引计算所述管线辅助线的第二特征点,所述第二特征点通过将所述第二端点朝向所述管线的法线方向平移后得到,其中,平移的距离为管线的半径。Calculate the second feature point of the pipeline auxiliary line according to the second end point and the feature class index, the second feature point is obtained by translating the second end point toward the normal direction of the pipeline, wherein , the translation distance is the radius of the pipeline.
可选的,在根据第一预设条件,获取管线数据的管线名称后,所述方法还包括:Optionally, after obtaining the pipeline name of the pipeline data according to the first preset condition, the method further includes:
根据所述管线名称查找与所述管线数据对应的第二管线辅助线;Finding a second pipeline auxiliary line corresponding to the pipeline data according to the pipeline name;
删除所述第二管线辅助线,并对所述管线数据的图层进行初始化。The second pipeline auxiliary line is deleted, and the layer of the pipeline data is initialized.
可选的,所述第一预设条件包括以下至少一种:Optionally, the first preset condition includes at least one of the following:
所述管线的地理位置;the geographic location of the pipeline;
和/或,所述管线的材质;And/or, the material of the pipeline;
和/或,所述管线的尺寸。And/or, the size of the pipeline.
可选的,所述第二预设条件包括以下至少一种:Optionally, the second preset condition includes at least one of the following:
所述管线的用途;the purpose of the pipeline;
和/或,所述管线的使用范围。And/or, the scope of use of the pipeline.
另一方面,本发明的实施例还提供了一种生成管线辅助线的装置,包括:On the other hand, an embodiment of the present invention also provides a device for generating pipeline auxiliary lines, including:
管线数据获取模块,用于根据第一预设条件,获取管线数据的管线名称,所述管线数据包括若干段管线和管线标记;The pipeline data acquisition module is used to acquire the pipeline name of the pipeline data according to the first preset condition, and the pipeline data includes several sections of pipelines and pipeline marks;
管线坐标获取模块,用于根据第二预设条件,对所述管线数据进行空间查询,并依据空间参考坐标系确定所述管线的空间坐标;A pipeline coordinate acquisition module, configured to perform spatial query on the pipeline data according to the second preset condition, and determine the spatial coordinates of the pipeline according to the spatial reference coordinate system;
索引创建模块,用于创建管线类并根据所述管线类添加要素类索引,所述管线类根据所述管线数据的类型和所述空间坐标的信息创建;An index creation module, configured to create a pipeline class and add a feature class index according to the pipeline class, the pipeline class is created according to the type of the pipeline data and the information of the spatial coordinates;
特征点计算模块,用于根据所述管线的空间坐标和所述要素类索引计算所述管线辅助线的特征点;A feature point calculation module, configured to calculate feature points of the pipeline auxiliary line according to the spatial coordinates of the pipeline and the feature class index;
第一辅助线生成模块,用于根据所述管线辅助线的特征点生成第一管线辅助线,并将所述管线标记添加至对应的所述第一管线辅助线。The first auxiliary line generating module is configured to generate a first auxiliary line of pipeline according to the feature points of the auxiliary line of pipeline, and add the mark of the pipeline to the corresponding first auxiliary line of pipeline.
可选的,索引创建模块包括:Optionally, the index creation module includes:
第一索引创建子模块,用于添加要素类数据库索引,用于创建管线点要素类数据库索引和管线线要素类数据库索引,并将数据库索引信息进行存储;The first index creation sub-module is used to add a feature class database index, and is used to create a pipeline point feature class database index and a pipeline line feature class database index, and store database index information;
和/或,第二索引创建子模块,用于添加要素类空间索引,根据管线要素图层的几何范围确定所述空间索引起始点和网格值,分别为所述管线点要素类、所述管线线要素类创建空间索引,并计算出管线要素的网格范围,将网格编码进行存储。And/or, the second index creation submodule is used to add a feature class spatial index, and determine the starting point and grid value of the spatial index according to the geometric range of the pipeline feature layer, which are respectively the pipeline point feature class, the The pipeline line feature class creates a spatial index, calculates the grid range of the pipeline feature, and stores the grid code.
可选的,所述装置中每段所述管线均包括第一端点和第二端点;Optionally, each section of the pipeline in the device includes a first end point and a second end point;
所述特征点计算模块包括:The feature point calculation module includes:
第一特征点计算子模块,用于根据所述第一端点和所述要素类索引计算所述管线辅助线的第一特征点,所述第一特征点通过将所述第一端点朝向所述管线的法线方向平移后得到,其中,平移的距离为管线的半径;The first feature point calculation submodule is used to calculate the first feature point of the pipeline auxiliary line according to the first end point and the feature class index, and the first feature point is obtained by moving the first end point toward The normal direction of the pipeline is obtained after translation, wherein the distance of translation is the radius of the pipeline;
第二特征点计算子模块,用于根据所述第二端点和所述要素类索引计算所述管线辅助线的第二特征点,所述第二特征点通过将所述第二端点朝向所述管线的法线方向平移后得到,其中,平移的距离为管线的半径。The second feature point calculation submodule is used to calculate the second feature point of the pipeline auxiliary line according to the second end point and the feature class index, and the second feature point is obtained by moving the second end point toward the The normal direction of the pipeline is obtained after translation, where the translation distance is the radius of the pipeline.
可选的,在根据第一预设条件,获取管线数据的管线名称后,所述装置还包括:Optionally, after obtaining the pipeline name of the pipeline data according to the first preset condition, the device further includes:
查找模块,用于根据所述管线名称查找与所述管线数据对应的第二管线辅助线;A search module, configured to search for a second pipeline auxiliary line corresponding to the pipeline data according to the pipeline name;
初始化模块,用于删除所述第二管线辅助线,并对所述管线数据的图层进行初始化。The initialization module is configured to delete the second pipeline auxiliary line, and initialize the layer of the pipeline data.
可选的,所述第一预设条件包括以下至少一种:Optionally, the first preset condition includes at least one of the following:
所述管线的地理位置;the geographic location of the pipeline;
和/或,所述管线的材质;And/or, the material of the pipeline;
和/或,所述管线的尺寸。And/or, the size of the pipeline.
可选的,所述第二预设条件包括以下至少一种:Optionally, the second preset condition includes at least one of the following:
所述管线的用途;the purpose of the pipeline;
和/或,所述管线的使用范围。And/or, the scope of use of the pipeline.
另一方面,本发明的实施例还提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,所述计算机程序被所述处理器执行时实现该生成管线辅助线方法的步骤。On the other hand, an embodiment of the present invention also provides an electronic device, the electronic device includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, the computer program being The processor executes the steps of realizing the method for generating pipeline auxiliary lines.
另一方面,本发明的实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质上存储计算机程序,所述计算机程序被处理器执行时实现该生成管线辅助线方法的步骤。On the other hand, an embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for generating pipeline auxiliary lines are realized. .
本发明实施例包括以下优点:本发明根据预设条件对管线数据进行空间查询,并依据空间参考坐标系确定管线的空间坐标,通过筛选满足预设条件的管线数据,并根据实际需求获取相应区域内管线的空间坐标,根据空间坐标和要素类索引计算管线辅助线的特征点并生成第一管线辅助线,简化拓扑结构中生成管线辅助线的计算量,提高生成管线辅助线的效率。The embodiment of the present invention has the following advantages: the present invention performs spatial query on the pipeline data according to the preset conditions, and determines the spatial coordinates of the pipeline according to the spatial reference coordinate system, and obtains the corresponding area according to actual needs by filtering the pipeline data satisfying the preset conditions The spatial coordinates of the inner pipeline, calculate the feature points of the pipeline auxiliary line according to the spatial coordinates and the feature class index, and generate the first pipeline auxiliary line, simplify the calculation amount of generating the pipeline auxiliary line in the topology structure, and improve the efficiency of generating the pipeline auxiliary line.
附图说明Description of drawings
图1为本发明实施例提供的一种生成管线辅助线的步骤流程图;FIG. 1 is a flow chart of steps for generating pipeline auxiliary lines provided by an embodiment of the present invention;
图2为本发明实施例提供的一种生成管线辅助线的结构框图。Fig. 2 is a structural block diagram of generating pipeline auxiliary lines provided by an embodiment of the present invention.
具体实施方式detailed description
以下结合附图对本发明的原理和特征进行描述,所举实例只用于解释本发明,并非用于限定本发明的范围。The principles and features of the present invention are described below in conjunction with the accompanying drawings, and the examples given are only used to explain the present invention, and are not intended to limit the scope of the present invention.
如图1所示,图1为本发明实施例提供的一种生成管线辅助线的的步骤流程图,该方法包括以下步骤:As shown in Figure 1, Figure 1 is a flow chart of steps for generating pipeline auxiliary lines provided by an embodiment of the present invention, the method includes the following steps:
步骤101、根据第一预设条件,获取管线数据的管线名称,所述管线数据包括若干段管线和管线标记;
在进行旧管网的更新或新管网的设计规划的过程中,可在已形成的管网资料的基础上进行加工处理,由于现有的管网资料中的拓扑结构信息繁杂,用户可以提取其中的部分管网数据,并对该部分管网数据进行初步处理。In the process of updating the old pipe network or designing and planning the new pipe network, processing can be carried out on the basis of the formed pipe network data. Since the topological structure information in the existing pipe network data is complicated, the user can extract Part of the pipe network data, and preliminary processing of the part of the pipe network data.
在一种可选的实施例中,在根据第一预设条件,获取管线数据的管线名称后,所述方法还包括:根据管线名称查找与管线数据对应的第二管线辅助线,删除第二管线辅助线,并对管线数据的图层进行初始化。In an optional embodiment, after obtaining the pipeline name of the pipeline data according to the first preset condition, the method further includes: searching for a second pipeline auxiliary line corresponding to the pipeline data according to the pipeline name, and deleting the second pipeline auxiliary line. Pipeline auxiliary lines, and initialize the layer of pipeline data.
其中,第一预设条件可以包括管线的地理位置,如湖北省武汉市江夏区;第一预设条件还可以包括管线的材质,如管线采用铜、塑料或水泥等制作;第一预设条件可以包括管线的尺寸,如管线的直径为20cm。Wherein, the first preset condition can include the geographic location of the pipeline, such as Jiangxia District, Wuhan City, Hubei Province; the first preset condition can also include the material of the pipeline, such as the pipeline is made of copper, plastic or cement; the first preset condition The size of the pipeline may be included, eg the diameter of the pipeline is 20cm.
步骤102、根据第二预设条件,对所述管线数据进行空间查询,并依据空间参考坐标系确定所述管线的空间坐标;
其中,第二预设条件可以包括管线的用途或管线的使用范围。示例性的,管线可用于交通设施,包括城市地下通道、城市地铁、隧道;管线可用于商业设施,如地下商城、水下游乐园;管线可用于市政公益管线设施,提高城市道路利用、保护地下设施稳定运转、为以后添加设施提供预留空间。Wherein, the second preset condition may include the use of the pipeline or the scope of use of the pipeline. Exemplarily, pipelines can be used in transportation facilities, including urban underground passages, urban subways, and tunnels; pipelines can be used in commercial facilities, such as underground shopping malls and underwater amusement parks; pipelines can be used in municipal public welfare pipeline facilities to improve urban road utilization and protect underground The facilities are running stably and provide reserved space for adding facilities in the future.
在一种可选的实施例中,根据第二预设条件查找出特定区域或者特定属性的管线的名称(id),根据管线id查询对应的辅助线并删除,对管线数据的图层进行初始化,得到管线数据的集合,令该集合为L1,遍历集合L1,得到一个合并的空间范围,根据实际需求将该空间范围适当扩展,得到集合L2,对集合L2进行空间查询,查询出需要生成辅助线的管线数据的id,并依据空间参考坐标系确定管线的空间坐标。设扩展的空间范围为extent,令dSizeX=(extent.xmax-extent.xmin)/GridSizeX,dSizeY=(extent.ymax-extent.ymin)/GridSizeY,得到网格的大小dSizeX和dSizeY。遍历vecConnectPnts,设当前的ConnectPnt对象指针为p。由p可以找到line和idx,从而能找到line对应的线段空间对象,从而可以确定当前p的坐标(x,y)。则p所在的网格索引(i,j)应为((int)((x-extent.xmin)/dSizeX),(int)((y-extent.ymin)/dSizeY)),从而可以确定p所对应的网格对象vecvecConnectPnts[j*GridSizeX+i]。称其为vec ConnectPnts_ij。将p添加到vecConnectPnts_ij中即可。In an optional embodiment, the name (id) of the pipeline in a specific area or a specific attribute is found according to the second preset condition, and the corresponding auxiliary line is queried and deleted according to the pipeline id, and the layer of the pipeline data is initialized , to obtain a collection of pipeline data, let the collection be L1, traverse the collection L1, obtain a merged spatial range, expand the spatial range appropriately according to the actual needs, and obtain the collection L2, perform spatial query on the collection L2, and find out the need to generate auxiliary The id of the pipeline data of the line, and determine the spatial coordinates of the pipeline according to the spatial reference coordinate system. Let the extended spatial range be extent, set dSizeX=(extent.xmax-extent.xmin)/GridSizeX, dSizeY=(extent.ymax-extent.ymin)/GridSizeY, and obtain grid sizes dSizeX and dSizeY. Traversing vecConnectPnts, set the current ConnectPnt object pointer as p. Line and idx can be found from p, so that the line segment space object corresponding to line can be found, so that the coordinates (x, y) of the current p can be determined. Then the grid index (i, j) where p is located should be ((int)((x-extent.xmin)/dSizeX), (int)((y-extent.ymin)/dSizeY)), so that p can be determined The corresponding grid object vecvecConnectPnts[j*GridSizeX+i]. Call it vec ConnectPnts_ij. Just add p to vecConnectPnts_ij.
步骤103、创建管线类并根据所述管线类添加要素类索引,所述管线类根据所述管线数据的类型和所述空间坐标的信息创建;
遍历集合L2,将管线数据L2对应的空间数据、管线id、是否参与生成的标志(flag)、以及管线标记分别存储在数组array_lines和array_ids和array_flags和array_attrs中。其中array_attrs的每一项元素是一个属性数组,存储了预知字段的属性,包括与管线数据对应的管径大小、工程编号、管线类型(如果是排水管线还包括起点高程、止点高程)的字段或者需要写入到管线辅助线的字段,分别根据管线类array_lines、array_ids、array_flags和array_attrs添加要素类索引,包括:Traverse the set L2, store the spatial data corresponding to the pipeline data L2, the pipeline id, the flag (flag) whether to participate in generation, and the pipeline flag in the arrays array_lines and array_ids, and array_flags and array_attrs respectively. Each element of array_attrs is an attribute array, which stores the attributes of the predicted fields, including the fields corresponding to the pipeline data, the pipe diameter size, the project number, and the pipeline type (if it is a drainage pipeline, it also includes the starting point elevation and the ending point elevation) Or you need to write to the fields of the pipeline auxiliary lines, respectively add feature class indexes according to the pipeline class array_lines, array_ids, array_flags and array_attrs, including:
添加要素类数据库索引,用于加快管线点要素的查询速率创建管线点要素类相关的数据库索引,用于加快管线线要素的查询速率创建管线线要素类数据库索引,并将数据库索引信息进行存储;Add feature class database index to speed up the query rate of pipeline point features Create a database index related to pipeline point feature class to speed up the query rate of pipeline line features Create a pipeline line feature class database index and store the database index information;
和/或,添加要素类空间索引并存储:根据管线要素图层的几何范围确定空间索引起始点和网格值,分别为管线点要素类、管线线要素类创建空间索引;计算出管线要素的网格范围并将网格编码进行存储;And/or, add feature class spatial index and store: determine the starting point and grid value of the spatial index according to the geometric range of the pipeline feature layer, create spatial indexes for the pipeline point feature class and pipeline line feature class respectively; calculate the pipeline feature grid range and store the grid code;
和/或,添加要素类分页索引并存储:根据管线点要素图层、管线线要素图层的几何范围确定分页索引起始点和网格值,为管线点要素类、管线线要素类创建分页索引;计算出管线要素的网格位置,并将网格编码、网格几何信息、网格属性信息进行存储。And/or, add feature class paging index and store: determine the paging index starting point and grid value according to the geometric range of the pipeline point feature layer and pipeline line feature layer, and create a paging index for the pipeline point feature class and pipeline line feature class ; Calculate the grid position of the pipeline elements, and store the grid code, grid geometry information, and grid attribute information.
管线数据是一类具有特殊拓扑结构的矢量数据。它包括管线点、管线线、管线面、管线辅助线和管线注记。其中,管线线数据是首尾相接的线数据,管线线数据是具有起点和止点的线段,并且起点和止点一定是和某一管线点数据完全重合对应的。管线线数据不会出现悬挂和相交情况,即管线线数据的端点一定是和另一管线线数据的端点重合的,或者是其独立存在,不与其他的线段产生关系。这样,管线线数据就具有了特定的拓扑结构,即其端点是一一连接的,生成辅助线时,无需对线段求交来计算拓扑关系,而根据点的重合关系来获取即可。Pipeline data is a class of vector data with a special topology. It includes pipeline points, pipeline lines, pipeline faces, pipeline auxiliary lines, and pipeline annotations. Among them, the pipeline line data is end-to-end line data, and the pipeline line data is a line segment with a starting point and a dead point, and the starting point and the dead point must be completely coincident with a certain pipeline point data. There will be no hanging and intersecting situations in the pipeline data, that is, the endpoint of the pipeline data must coincide with the endpoint of another pipeline data, or it exists independently and does not have relationship with other line segments. In this way, the pipeline data has a specific topology, that is, its endpoints are connected one by one. When generating auxiliary lines, there is no need to intersect the line segments to calculate the topological relationship, but to obtain it according to the coincidence relationship of points.
于本实施例中,每条管线线段均包括第一端点和第二端点,根据管线的空间坐标和要素类索引计算管线辅助线的特征点的过程,包括:根据第一端点和要素类索引计算管线辅助线的第一特征点,根据第二端点和要素类索引计算管线辅助线的第二特征点,其中,第一特征点和第二特征点均是通过将端点朝向管线的法线方向平移后得到,且平移的距离为管线的半径。In this embodiment, each pipeline line segment includes a first end point and a second end point, and the process of calculating the feature points of the pipeline auxiliary line according to the spatial coordinates of the pipeline and the index of the feature class includes: according to the first end point and the feature class The index calculates the first feature point of the pipeline auxiliary line, and calculates the second feature point of the pipeline auxiliary line according to the second end point and the feature class index, where the first feature point and the second feature point are both by pointing the end point towards the normal of the pipeline It is obtained after the direction is translated, and the translation distance is the radius of the pipeline.
为了方便进行描述,我们将第一端点作为首点,将第二端点作为尾点。For the convenience of description, we take the first end point as the first point and the second end point as the end point.
定义一个结构体ConnectLine,代表一根线段的拓扑连接情况,其分别存储了线段首点的所有连接线listfirstLine(用ConnectLine类型的指针数组存储)、尾点的所有连接线listnextLine、以及该线段的id、该线段的空间数据、该线段是否参与生成的标志flag、首点的左特征点flp、右特征点frp、尾点的左特征点nlp、右特征点nrp、以及特征点连接线数组extLine。其中,特征点flp、frp、nlp和nrp均是每一条线段的端点往线段的法线方向平移后得到的特征点,且平移的距离为管线的半径。Define a structure ConnectLine, which represents the topological connection of a line segment, which stores all the connection lines listfirstLine of the first point of the line segment (stored by a pointer array of ConnectLine type), all the connection lines listnextLine of the end point, and the id of the line segment , the spatial data of the line segment, the flag flag of whether the line segment participates in generation, the left feature point flp of the first point, the right feature point frp of the first point, the left feature point nlp of the tail point, the right feature point nrp, and the feature point connection line array extLine. Among them, the feature points flp, frp, nlp and nrp are the feature points obtained after the end point of each line segment is translated to the normal direction of the line segment, and the translation distance is the radius of the pipeline.
定义一个结构体ConnectPnt,代表一根线段的首点或者尾点的拓扑连接情况。其分别存储了它对应的拓扑线段的指针line(类型为ConnectLine),和索引值idx(代表其是首点还是尾点,值为0或1)。Define a structure ConnectPnt, which represents the topological connection of the first or last point of a line segment. It respectively stores the pointer line (the type is ConnectLine) of its corresponding topology line segment, and the index value idx (representing whether it is the first point or the end point, and the value is 0 or 1).
定义一个ConnectLine类型的指针数组vecConnectlines,和一个ConnectPnt类型的指针数组vecConnectPnts。Define a pointer array vecConnectlines of ConnectLine type, and a pointer array vecConnectPnts of ConnectPnt type.
循环遍历array_lines,设当前索引为i。新建一个ConnectLine对象cl,将array_ids[i]和array_lines[i]和array_flags[i]分别赋值给cl的对应项。再将cl添加到数组vecConnectlines中。Loop through array_lines, set the current index as i. Create a new ConnectLine object cl, and assign array_ids[i], array_lines[i] and array_flags[i] to the corresponding items of cl respectively. Then add cl to the array vecConnectlines.
在创建管线类的过程中,遍历vecConnectlines,设当前的ConnectLine对象指针为cl。新建一个ConnectPnt对象p0,将cl赋值给p0的line,p0的idx赋值为0,再将p0添加进入vecConnectPnts中;再新建一个ConnectPnt对象p1,将cl赋值给p1的line,p1的idx赋值为1,再将p1添加进入vecConnectPnts中。In the process of creating the pipeline class, traverse vecConnectlines, and set the current ConnectLine object pointer as cl. Create a new ConnectPnt object p0, assign cl to the line of p0, assign the idx of p0 to 0, then add p0 to vecConnectPnts; create a new ConnectPnt object p1, assign cl to the line of p1, and assign the idx of p1 to 1 , and then add p1 into vecConnectPnts.
在建立空间索引的过程中,先通过预定义好的网格大小GridSizeX,GridSizeY(一般根据数据集大小确定或者设置为某固定值)定义一个GridSizeX*GridSizeY大小的网格G。网格类型为ConnectPnt类型的指针数组,即定义一个GridSizeX*GridSizeY大小的vector<ConnectPnts*>的数组,为vecvecConnectPnts。In the process of establishing a spatial index, first define a grid G with the size of GridSizeX*GridSizeY through the predefined grid sizes GridSizeX and GridSizeY (generally determined according to the size of the data set or set to a fixed value). The grid type is an array of pointers of the ConnectPnt type, that is, an array of vector<ConnectPnts*> with the size of GridSizeX*GridSizeY is defined, which is vecvecConnectPnts.
遍历完成vecConnectPnts后,vecConnectPnts中的ConnectPnt实际都被添加到网格索引中了。但为了提高算法效率,加快查找临近点的速度,我们还可以对上述过程做一些改造。具体的,将网格内的存储改成vecvecConnectPntsSortedByX和vecvecConnectPntsSortedByY,将ConnectPnt的对象指针分别存储到网格内的这两个数组中。则上述过程完成后,每个网格内实际上会有两个同样大小的ConnectPnt指针数组,并且它们存储的内容是相同的。而SortedByX和SortedByY顾名思义,是要把ConnectPnt按照X和Y坐标进行排序,其具体方法为:After traversing vecConnectPnts, the ConnectPnt in vecConnectPnts is actually added to the grid index. However, in order to improve the efficiency of the algorithm and speed up the search for adjacent points, we can also make some modifications to the above process. Specifically, the storage in the grid is changed to vecvecConnectPntsSortedByX and vecvecConnectPntsSortedByY, and the object pointer of ConnectPnt is stored in the two arrays in the grid respectively. After the above process is completed, there will actually be two arrays of ConnectPnt pointers of the same size in each grid, and their stored contents are the same. As the name suggests, SortedByX and SortedByY are to sort ConnectPnt according to X and Y coordinates. The specific method is:
遍历网格G,设当前索引为i,则vecvecConnectPntsSortedByX[i]和vecvecConnectPntsSortedByY[i]分别是存储了ConnectPnt指针的数组。对vecvecConnectPntsSortedByX[i]执行快速排序,设比较的两个ConnectPnt的对象分别为p1和p2,其比较条件是p1->line->line[p1->idx].x<p2->line->line[p2->idx].x。(第一个line是ConnectLine,第二个是其空间对象,接索引可以访问到点对象)。对vecvecConnectPntsSortedByY[i]执行快速排序,其比较条件是p1->line->line[p1->idx].y<p2->line->line[p2->idx].y。这样遍历完网格G后,就完成了网格索引的建立和连接点排序。Traversing the grid G, assuming that the current index is i, then vecvecConnectPntsSortedByX[i] and vecvecConnectPntsSortedByY[i] are arrays storing ConnectPnt pointers respectively. Perform quick sorting on vecvecConnectPntsSortedByX[i]. Let the two ConnectPnt objects to be compared be p1 and p2 respectively, and the comparison condition is p1->line->line[p1->idx].x<p2->line->line [p2->idx].x. (The first line is ConnectLine, the second is its spatial object, and the connection index can access the point object). Perform quick sort on vecvecConnectPntsSortedByY[i], the comparison condition is p1->line->line[p1->idx].y<p2->line->line[p2->idx].y. After traversing the grid G in this way, the establishment of the grid index and the sorting of the connection points are completed.
在创建管线类的过程中,若当前的管线类型为排水线,在遍历vecConnectlines前,需要先生成排水方向辅助线流程,生成排水方向辅助线的流程如下:In the process of creating a pipeline class, if the current pipeline type is a drainage line, before traversing vecConnectlines, it is necessary to generate the drainage direction auxiliary line process first. The process of generating the drainage direction auxiliary line is as follows:
循环遍历array_lines,设当前索引为i。从array_attrs[i]中取出当前线数据对应的起点高程和止点高程,计算当前线段的中点坐标centerX、centerY,并计算当前线段的长度length。令dX为0.5/length*(p1.x-p0.x),dY为0.5/length*(p1.y-p0.y)(p0,p1分别为线段的起点和止点)。若起点高程大于止点高程,则水流方向应为起点流向止点,排水方向辅助线箭头另一端的端点坐标otherX为centerX+dX,otherY为centerY+dY;否则,otherX为centerX–dX,otherY为centerY–dY。这样就找到了排水方向辅助线的箭头杆的两个点了。Loop through array_lines, set the current index as i. From array_attrs[i], take out the starting point elevation and ending point elevation corresponding to the current line data, calculate the midpoint coordinates centerX and centerY of the current line segment, and calculate the length of the current line segment. Let dX be 0.5/length*(p1.x-p0.x), and dY be 0.5/length*(p1.y-p0.y) (p0, p1 are the starting point and ending point of the line segment respectively). If the elevation of the starting point is greater than the elevation of the ending point, the direction of water flow should be from the starting point to the ending point, and the end point coordinates of the other end of the auxiliary line arrow in the drainage direction otherX is centerX+dX, and otherY is centerY+dY; otherwise, otherX is centerX–dX, and otherY is centerY–dY. In this way, the two points of the arrow rod of the drainage direction auxiliary line are found.
下面再寻找排水方向辅助线的箭头的两条线段。其中这个箭头的尖的坐标就是otherX,otherY。另外需要寻找左边的箭头腰部的坐标即可。首先计算箭头杆的方位角azimuth,即center点和other点的连线的方位角azimuth。设左边腰部到箭头的方位角为lazimuth,右边腰部到箭头的方位角为razimuth,想表达的箭头角度为30度(可以是任意角度,为了方便设置为30度),则lazimuth=azimuth–30/2;razimuth=azimuth+30/2。设箭头的长度为arrowlength,设置arrowlength为1(可以是想要的任意长度),则令lx=arrowlength*sin(lazimuth),ly=arrowlength*cos(lazimuth);rx=arrowlength*sin(razimuth),ry=arrowlength*cos(razimuth)。则点lp(otherX+lx,otherY+ly)为箭头左边腰部的坐标,点rp(otherX+rx,otherY+ry)为箭头右边腰部的坐标。这样将响应的坐标组成辅助线段后,并添加相应的属性值,排水方向辅助线就生成了。Next, look for the two line segments of the arrow of the drainage direction auxiliary line. The coordinates of the tip of the arrow are otherX, otherY. In addition, you need to find the coordinates of the waist of the arrow on the left. First calculate the azimuth of the arrow rod, that is, the azimuth of the line connecting the center point and the other point. Let the azimuth from the left waist to the arrow be lazimuth, and the azimuth from the right waist to the arrow be razimuth, and the angle of the arrow to be expressed is 30 degrees (it can be any angle, set to 30 degrees for convenience), then lazimuth=azimuth–30/ 2; razimuth=azimuth+30/2. Let the length of the arrow be arrowlength, set arrowlength to be 1 (can be any desired length), then make lx=arrowlength*sin(lazimuth), ly=arrowlength*cos(lazimuth); rx=arrowlength*sin(razimuth), ry=arrowlength*cos(razimuth). Then point lp(otherX+lx, otherY+ly) is the coordinates of the left waist of the arrow, and point rp(otherX+rx, otherY+ry) is the coordinates of the right waist of the arrow. In this way, after the corresponding coordinates are formed into the auxiliary line segment, and the corresponding attribute value is added, the drainage direction auxiliary line is generated.
步骤104、根据所述管线的空间坐标和所述要素类索引计算所述管线辅助线的特征点;
其中,计算管线辅助线的特征点包括以下子步骤:Among them, calculating the feature points of the pipeline auxiliary line includes the following sub-steps:
步骤104.1、遍历vecConnectlines,设当前的ConnectLine指针为cl。令p为cl->line[0],即p为cl对应的线段的首端点,按一定容限大小r(用户可以自己设置,也可以设置为固定值,比如0.01),对p周围所有的ConnectPnt进行空间查询,存储到vector<ConnectPnt*>类型的对象listConnectPnts中。Step 104.1, traverse vecConnectlines, and set the current ConnectLine pointer as cl. Let p be cl->line[0], that is, p is the first end point of the line segment corresponding to cl, according to a certain tolerance size r (users can set it by themselves, or it can be set to a fixed value, such as 0.01), for all the lines around p ConnectPnt performs spatial query and stores it in the object listConnectPnts of type vector<ConnectPnt*>.
该空间查询的具体方法为:The specific method of the spatial query is:
用查询点p(x,y)的坐标加上容限大小r生成一个查询矩形,它的xmin,ymin,xmax,ymax分别为x-r,y-r,x+r,y+r。分别计算这个查询矩形的四个顶点坐标所在的网格G的网格索引值,找到四个顶点所在的网格所覆盖的所有网格(即设四个顶点所在的网格索引值分别为(xmin_idx,ymin_idx),(xmax_idx,ymin_idx),(xmin_idx,ymax_idx),(xmax_idx,ymax_idx),则所覆盖的所有网格即行号从ymin_idx到ymax_idx,列号从xmin_idx到xmax_idx的所有网格)。而因为在本应用中是要找连接到一起的端点,因此容限r的值会设置得非常小,所以也最多就是四个网格。Use the coordinates of the query point p(x,y) plus the tolerance size r to generate a query rectangle, and its xmin, ymin, xmax, and ymax are x-r, y-r, x+r, y+r respectively. Calculate the grid index values of the grid G where the coordinates of the four vertices of the query rectangle are located, and find all the grids covered by the grids where the four vertices are located (that is, the grid index values where the four vertices are located are respectively ( xmin_idx, ymin_idx), (xmax_idx, ymin_idx), (xmin_idx, ymax_idx), (xmax_idx, ymax_idx), then all the grids covered are all grids with row numbers from ymin_idx to ymax_idx and column numbers from xmin_idx to xmax_idx). And because in this application it is to find the endpoints connected together, the value of the tolerance r will be set very small, so there are four grids at most.
对于每个找到的网格,查找其对应的vecConnectPntsSortedByX的已排序数组。对vecConnectPntsSortedByX,用(x-r,y-r)的point值查找下界索引值,用(x+r,y+r)的point值查找上界索引值,比较条件为前面的排序方法中对X值的比较条件。找到上界和下界的索引值后,若上界索引值减去下界索引值小于10,即符合区间条件的元素数小于10,则直接遍历从下界索引值到上界索引值的所有ConnectPnt,若其y值在y-r到y+r的范围内,则符合结果要求,把其ConnectPnt指针加入到每个网格的结果集合setResult中。For each found mesh, look up its corresponding sorted array of vecConnectPntsSortedByX. For vecConnectPntsSortedByX, use the point value of (x-r, y-r) to find the lower bound index value, use the point value of (x+r, y+r) to find the upper bound index value, and the comparison condition is the comparison condition for the X value in the previous sorting method . After finding the index values of the upper and lower bounds, if the upper bound index value minus the lower bound index value is less than 10, that is, the number of elements meeting the interval condition is less than 10, then directly traverse all ConnectPnts from the lower bound index value to the upper bound index value, if If its y value is within the range of y-r to y+r, it meets the result requirements, and its ConnectPnt pointer is added to the result set setResult of each grid.
若上界索引值减去下界索引值大于等于10,则认为其暂时的结果较多,还有进一步查询的必要性,则如法炮制,vecConnectPntsSortedByY,用(x-r,y-r)的point值查找下界索引值,用(x+r,y+r)的point值查找上界索引值,比较条件为前面的排序方法中对Y值的比较条件。这时,对vecConnectPntsSortedByX的结果的上界和下界的值可以产生一个集合setResultX,对vecConnectPntsSortedByY产生一个集合setResultY。这时候遍历setResultY,若其元素存在于setResultX中,则将结果加入到setResult中,最后得到单个网格的结果集合setResult。If the upper bound index value minus the lower bound index value is greater than or equal to 10, it is considered that there are many temporary results and there is a need for further query, then follow the same method, vecConnectPntsSortedByY, use the point value of (x-r, y-r) to find the lower bound index value, Use the point value of (x+r, y+r) to find the upper bound index value, and the comparison condition is the comparison condition for the Y value in the previous sorting method. At this time, a collection setResultX can be generated for the values of the upper bound and lower bound of the result of vecConnectPntsSortedByX, and a collection setResultY can be generated for vecConnectPntsSortedByY. At this time, setResultY is traversed, and if its elements exist in setResultX, the result is added to setResult, and finally the result set setResult of a single grid is obtained.
对于每个网格找到的setResult,对其结果求并集。具体方法为:新建一个空的setResultAll,遍历每个网格的setResult的元素,若setResultAll中不存在当前元素,则将当前元素加入到setResultAll中,最后得到所有结果的并集。For each grid found setResult, union its results. The specific method is: create an empty setResultAll, traverse the setResult elements of each grid, if the current element does not exist in the setResultAll, add the current element to the setResultAll, and finally get the union of all the results.
这样就做完了上述的空间查询操作。In this way, the above-mentioned spatial query operation is completed.
步骤104.2、定义一个数组listFoundConnectPnts。它是ConnectPnt类型指针数组。遍历数组listConnectPnts,对当前的ConnectPnt对象cp,如果cp->line==cl,则continue;(遇到自身了),否则找到cp对应的点空间对象p1(cp->line->line[cp->idx])。如果p与p1的距离小于r,则将当前的cp加入到listFoundConnectPnts中。这一步是确保查询到的ConnectPnt在容限范围内。Step 104.2, define an array listFoundConnectPnts. It is an array of ConnectPnt type pointers. Traverse the array listConnectPnts, for the current ConnectPnt object cp, if cp->line==cl, then continue; (encounter itself), otherwise find the point space object p1 corresponding to cp(cp->line->line[cp- >idx]). If the distance between p and p1 is less than r, add the current cp to listFoundConnectPnts. This step is to ensure that the queried ConnectPnt is within the tolerance range.
接着,遍历listFoundConnectPnts。对当前的ConnectPnt对象cp,如果cl的listfirstLine不包含cp->line,则将cp->line加入到cl的listfirstLine中。如果cp->idx为0,判断cp->line的listfirstLine若不包含cl,则将cl加入到cp->line的listfirstLine中。否则若cp->idx为1,则判断cp->line的listnextLine若不包含cl,则将cl加入到cp->line的listnextLine中。Next, traverse listFoundConnectPnts. For the current ConnectPnt object cp, if the listfirstLine of cl does not contain cp->line, add cp->line to the listfirstLine of cl. If cp->idx is 0, if the listfirstLine of cp->line does not contain cl, add cl to the listfirstLine of cp->line. Otherwise, if cp->idx is 1, it is judged that if the listnextLine of cp->line does not contain cl, then cl is added to the listnextLine of cp->line.
同样的,令p为cl->line[1],即p为cl对应的线段的尾端点,按一定容限大小r,对p周围所有的ConnectPnt进行空间查询,存储到vector<ConnectPnt*>类型的对象listConnectPnts中。再通过距离过滤,得到listFoundConnectPnts。遍历listFoundConnectPnts。对当前的ConnectPnt对象cp,如果cl的listnextLine不包含cp->line,则将cp->line加入到cl的listnextLine中。如果cp->idx为0,判断cp->line的listfirstLine若不包含cl,则将cl加入到cp->line的listfirstLine中。否则若cp->idx为1,则判断cp->line的listnextLine若不包含cl,则将cl加入到cp->line的listnextLine中。Similarly, let p be cl->line[1], that is, p is the end point of the line segment corresponding to cl, according to a certain tolerance size r, perform spatial query on all ConnectPnt around p, and store them in the vector<ConnectPnt*> type The object listConnectPnts. Then filter by distance to get listFoundConnectPnts. Traverse listFoundConnectPnts. For the current ConnectPnt object cp, if the listnextLine of cl does not contain cp->line, add cp->line to the listnextLine of cl. If cp->idx is 0, if the listfirstLine of cp->line does not contain cl, add cl to the listfirstLine of cp->line. Otherwise, if cp->idx is 1, it is judged that if the listnextLine of cp->line does not contain cl, then cl is added to the listnextLine of cp->line.
至此,完成了每一条管线的首尾端点连接管线的索引建立工作,即对每一条管线,通过其listfirstLine和listnextLine能找出与之相连的管线了。So far, the index building work of the pipeline connecting the first and last endpoints of each pipeline is completed, that is, for each pipeline, the pipeline connected to it can be found through its listfirstLine and listnextLine.
步骤104.3、在建立管线的首尾端点连接管线的索引后,根据首尾端点所在的空间坐标计算辅助线特征点,具体包括以下子步骤:Step 104.3. After establishing the index of the pipeline connecting the first and last endpoints of the pipeline, calculate the feature points of the auxiliary line according to the spatial coordinates where the first and last endpoints are located, specifically including the following sub-steps:
步骤104.3.1、令r为管线的半径,先确定左侧连接线的索引。Step 104.3.1. Let r be the radius of the pipeline, first determine the index of the left connecting line.
具体的,FindLeft,即找到方位角度azimuth在azimuths中位于其左侧第一个的连接线索引。令max为-10000,actmax为-10000,maxidx为-1,actmaxidx为-1。遍历azimuths,设当前索引为i,若azimuths[i]小于azimuth,并且azimuths[i]大于actmax,则actmax赋值为azimuths[i],actmaxidx赋值为i。如果azimuths[i]大于max,则max赋值为azimuths[i],maxidx赋值为i。遍历完毕,若actmaxidx大于等于0,则返回actmaxidx;否则,返回maxidx。Specifically, FindLeft is to find the first connection line index on the left of the azimuth in the azimuths. Let max be -10000, actmax be -10000, maxidx be -1, actmaxidx be -1. Traverse azimuths, set the current index as i, if azimuths[i] is smaller than azimuth, and azimuths[i] is greater than actmax, then actmax is assigned the value azimuths[i], and actmaxidx is assigned the value i. If azimuths[i] is greater than max, then max is assigned to azimuths[i] and maxidx is assigned to i. After traversing, if actmaxidx is greater than or equal to 0, return actmaxidx; otherwise, return maxidx.
步骤104.3.2、确定右侧连接线的索引。Step 104.3.2. Determine the index of the connecting line on the right.
FindRight,即找到方位角度azimuth在azimuths中位于其右侧第一个的连接线索引。令min为10000,actmin为10000,minidx为-1,actminidx为-1。遍历azimuths,设当前索引为i,若azimuths[i]大于azimuth,并且azimuths[i]小于actmin,则actmin赋值为azimuths[i],actminidx赋值为i。如果azimuths[i]小于min,则min赋值为azimuths[i],minidx赋值为i。遍历完毕,若actminidx大于等于0,则返回actminidx;否则,返回minidx。FindRight, that is to find the azimuth azimuth in the azimuths on the first connecting line index on the right. Let min be 10000, actmin be 10000, minidx be -1, actminidx be -1. Traverse azimuths, set the current index as i, if azimuths[i] is greater than azimuth, and azimuths[i] is less than actmin, then assign actmin to azimuths[i] and actminidx to i. If azimuths[i] is less than min, then min is assigned to azimuths[i] and minidx is assigned to i. After traversing, if actminidx is greater than or equal to 0, return actminidx; otherwise, return minidx.
步骤104.3.3、Step 104.3.3,
计算坐标增量calcDeltaXY函数,设其参数列表为X0,Y0,X1,Y1,r,deltaX,deltaY。令dy=Y1-Y0,dx=X1-X0。dy1初始值为0,dx1初始值为0。Calculate the coordinate increment calcDeltaXY function, set its parameter list as X0, Y0, X1, Y1, r, deltaX, deltaY. Let dy=Y1-Y0, dx=X1-X0. The initial value of dy1 is 0, and the initial value of dx1 is 0.
如果dx等于0,那么如果dy大于0,则dx1为-r,dy1为0。否则,dx1为r,dy1为0。If dx is equal to 0, then dx1 is -r and dy1 is 0 if dy is greater than 0. Otherwise, dx1 is r and dy1 is 0.
否则,令k=dy/dx。令val=r*sqrt(k*k/(1+k*k));valy=r*sqrt(1/(1+k*k))。如果dy大于0,则dx1为-val;否则dx1为val。如果dx大于0,则dy1为valy;否则dy1为-valy。Otherwise, let k=dy/dx. Let val=r*sqrt(k*k/(1+k*k)); valy=r*sqrt(1/(1+k*k)). If dy is greater than 0, dx1 is -val; otherwise dx1 is val. If dx is greater than 0, dy1 is valy; otherwise dy1 is -valy.
deltaX为dx1,deltaY为dy1。deltaX is dx1, deltaY is dy1.
至此calcDeltaXY函数结束。So far the calcDeltaXY function ends.
步骤104.3.4、Step 104.3.4,
K函数的参数列表为(x0,y0,x1,y1)。返回(y1-y0)/(x1-x0)。The parameter list of the K function is (x0, y0, x1, y1). Returns (y1-y0)/(x1-x0).
步骤104.3.5、Step 104.3.5,
b函数的参数列表为(x0,y0,x1,y1)。返回(x1*y0-x0*y1)/(x1-x0)。The parameter list of the b function is (x0, y0, x1, y1). Returns (x1*y0-x0*y1)/(x1-x0).
步骤104.3.6、Step 104.3.6,
calcCrossXY,即计算管线cl和lindex对应的管线的交点或其延长线交点,设参数列表为x0,y0,x1,y1,x2,y2,r1,r2,bValidL,xL,yL。bValidL,xL,yL为输出参数。算法如下:calcCrossXY, that is, the intersection point of the pipeline corresponding to the calculation pipeline cl and lindex or the intersection point of its extension line, the parameter list is set to x0, y0, x1, y1, x2, y2, r1, r2, bValidL, xL, yL. bValidL, xL, yL are output parameters. The algorithm is as follows:
定义deltaXf和deltaYf,代表第一根线((x0,y0),(x1,y1))的左侧沿法线偏离r1距离的x,y坐标增量;deltaXn,deltaYn代表第二根线((x1,y1),(x2,y2))的左侧沿法线偏离r2距离的x,y坐标增量。计算方法为,调用calcDeltaXY方法:传入参数x0,y0,x1,y1,r1,deltaXf,deltaYf,得到deltaXf,deltaYf;传入参数x1,y1,x2,y2,r2,deltaXn,deltaYn,得到deltaXn,deltaYn。Define deltaXf and deltaYf, representing the x, y coordinate increment of the left side of the first line ((x0, y0), (x1, y1)) away from the normal along the r1 distance; deltaXn, deltaYn represent the second line (( x1, y1), (x2, y2)) The left side of (x2, y2)) is offset from the normal along the x, y coordinate increment of the distance r2. The calculation method is to call the calcDeltaXY method: pass in the parameters x0, y0, x1, y1, r1, deltaXf, deltaYf to get deltaXf, deltaYf; pass in the parameters x1, y1, x2, y2, r2, deltaXn, deltaYn to get deltaXn, deltaYn.
令dxf=x1-x0,dxn=x2-x1,dyf=y1-y0,dyn=y2-y1。Let dxf=x1-x0, dxn=x2-x1, dyf=y1-y0, dyn=y2-y1.
如果dxf等于0并且dxn等于0,即两条线均竖直并且在同一条直线上,则xL为x1+detalXf,yL为y1。如果r1和r2不相等,则bValidL为false,程序返回。If dxf is equal to 0 and dxn is equal to 0, that is, both lines are vertical and on the same straight line, then xL is x1+detalXf, and yL is y1. If r1 and r2 are not equal, bValidL is false and the program returns.
如果dxf等于0但dxn不等于0,令kn=K(x1,y1,x2,y2),bn=b(x1+deltaXn,y1+deltaYn,x2+deltaXn,y2+deltaYn)。其中K为斜率函数,b为截距函数,对应直线表达式y=Kx+b里的K和b。则xL为x1+deltaXf,yL为kn*xL+bn。If dxf is equal to 0 but dxn is not equal to 0, let kn=K(x1, y1, x2, y2), bn=b(x1+deltaXn, y1+deltaYn, x2+deltaXn, y2+deltaYn). Among them, K is the slope function, and b is the intercept function, corresponding to K and b in the straight line expression y=Kx+b. Then xL is x1+deltaXf, and yL is kn*xL+bn.
如果dxf不等于0但dxn等于0,令kf=K(x0,y0,x1,y1),bf=b(x0+deltaXf,y0+deltaYf,x1+deltaXf,y1+deltaYf)。则xL为x1+deltaXn,yL为kf*xL+bf。If dxf is not equal to 0 but dxn is equal to 0, let kf=K(x0,y0,x1,y1), bf=b(x0+deltaXf, y0+deltaYf, x1+deltaXf, y1+deltaYf). Then xL is x1+deltaXn, and yL is kf*xL+bf.
如果dxf不等于0并且dxn不等于0,令kn=K(x1,y1,x2,y2),bn=b(x1+deltaXn,y1+deltaYn,x2+deltaXn,y2++deltaYn),kf=K(x0,y0,x1,y1),bf=b(x0+deltaXf,y0+deltaYf,x1+deltaXf,y1+deltaYf)。如果kf等于kn:如果r1等于r2,则xL为x1+deltaXf,yL为y1+deltaYf,bValidL为true,程序返回;否则,bValidL为false,程序返回。如果kf不等于kn,则xL为(bn-bf)/(kf-kn),yL为(kf*bn-kn*bf)/(kf-kn)。If dxf is not equal to 0 and dxn is not equal to 0, let kn=K(x1,y1,x2,y2), bn=b(x1+deltaXn,y1+deltaYn,x2+deltaXn,y2++deltaYn), kf=K (x0, y0, x1, y1), bf = b(x0+deltaXf, y0+deltaYf, x1+deltaXf, y1+deltaYf). If kf is equal to kn: if r1 is equal to r2, then xL is x1+deltaXf, yL is y1+deltaYf, bValidL is true, and the program returns; otherwise, bValidL is false, and the program returns. If kf is not equal to kn, xL is (bn-bf)/(kf-kn), and yL is (kf*bn-kn*bf)/(kf-kn).
最后,令dLf=yL-(y0+deltaYf),dLn=yL-(y2+deltaYn)。如果dLf*dyf<0或者dLn*dyn>0,则bValidL为false,否则bValidL为true,程序返回。这一步是判断最终的交点与线段((x0,y0),(x1,y1))和((x1,y1),(x2,y2))的位置关系。如果交点超出了线段的法线辐射范围,则认为交点无效。Finally, let dLf=yL-(y0+deltaYf), dLn=yL-(y2+deltaYn). If dLf*dyf<0 or dLn*dyn>0, then bValidL is false, otherwise bValidL is true, and the program returns. This step is to judge the position relationship between the final intersection point and the line segment ((x0,y0),(x1,y1)) and ((x1,y1),(x2,y2)). An intersection is considered invalid if it is outside the normal radius of the line segment.
至此calcCrossXY函数结束。So far the calcCrossXY function ends.
步骤104.3.7、计算辅助线的特征点;Step 104.3.7, calculating the feature points of the auxiliary line;
计算辅助线左侧的特征点:如果cl->flp==NULL或者cl->frp==NULL,则执行以下步骤:令(x1,y1)为cl->line[0]即cl对应的管线的首端点,(x2,y2)为cl对应的管线的尾端点。如果cl->listfirstLine的长度不为0,定义一个lindex和rindex,分别代表左侧参考的连接管线的索引和右侧参考的连接管线的索引。如果cl->listfirstLine的长度为1,则此时只有一个连接管线,lindex和rindex的值为0。否则,计算当前连接线cl从首点到尾点的射线的方位角azimuth。并遍历cl->listfirstLine,计算每一根对应的连接线的方位角。这时候,要注意计算的方位角的方向。方位角方向应从(x1,y1)对应的点开始计算。所以,令当前遍历的ConnectLine为line,如果line->listfirstLine包含cl,说明line的首点是对应的(x1,y1),其方位角从line的line[0]计算到line[1];若不包含,则说明是尾点对应的(x1,y1),其方位角从line的line[1]计算到line[0]。计算完方位角后,存储到数组azimuths中。之后利用FindLeft方法,找到对应的lindex,利用FindRight方法,找到对应的rindex。以下若不做特别说明,lindex对应的管线即指的是cl->listfirstLine[lindex]这条线;rindex对应的管线即指的是cl->listfirstLine[rindex]这条线。Calculate the feature points on the left side of the auxiliary line: if cl->flp==NULL or cl->frp==NULL, then perform the following steps: Let (x1,y1) be cl->line[0], which is the pipeline corresponding to cl The first endpoint of , (x2, y2) is the tail endpoint of the pipeline corresponding to cl. If the length of cl->listfirstLine is not 0, define a lindex and rindex, which respectively represent the index of the connecting pipeline referenced on the left and the index of the connecting pipeline referenced on the right. If the length of cl->listfirstLine is 1, then there is only one connecting pipeline at this time, and the values of lindex and rindex are 0. Otherwise, calculate the azimuth azimuth of the ray from the first point to the end point of the current connection line cl. And traverse cl->listfirstLine to calculate the azimuth of each corresponding connecting line. At this time, pay attention to the direction of the calculated azimuth. The azimuth direction should be calculated from the point corresponding to (x1,y1). Therefore, let the currently traversed ConnectLine be line. If line->listfirstLine contains cl, it means that the first point of line is corresponding to (x1, y1), and its azimuth is calculated from line[0] to line[1] of line; if If it is not included, it means (x1, y1) corresponding to the end point, and its azimuth is calculated from line[1] to line[0] of the line. After the azimuth is calculated, it is stored in the array azimuths. Then use the FindLeft method to find the corresponding lindex, and use the FindRight method to find the corresponding rindex. Unless otherwise specified below, the pipeline corresponding to lindex refers to the line cl->listfirstLine[lindex]; the pipeline corresponding to rindex refers to the line cl->listfirstLine[rindex].
定义点(x3l,y3l),表示lindex对应的管线的不和(x1,y1)相连的端点。定义点(x3r,y3r),表示rindex对应的管线的不和(x1,y1)相连的端点。定义(rx3,ry3),表示待求出的连接管线的辅助线特征点。令rl为lindex对应的管线的半径。rr为rindex对应的管线的半径。The definition point (x3l, y3l) represents the endpoint of the pipeline corresponding to lindex that is not connected to (x1, y1). The definition point (x3r, y3r) represents the endpoint of the pipeline corresponding to rindex that is not connected to (x1, y1). Define (rx3, ry3), which represents the auxiliary line feature point of the connecting pipeline to be obtained. Let rl be the radius of the pipeline corresponding to lindex. rr is the radius of the pipeline corresponding to rindex.
如果cl->flp为NULL,则需要计算左边的特征点。计算的方法为:如果lindex对应的管线的listfirstLine包含cl,即是其首端点对应(x1,y1),则(x3l,y3l)为lindex对应的管线的尾端点;否则(x3l,y3l)为lindex对应的管线的首端点。调用函数calcCrossXY,传入参数为x3l,y3l,x1,y1,x2,y2,rl,r,传出参数为bValidL,lx,ly。其中bValidL代表计算出来的交点坐标是否是有效的;(lx,ly)代表计算出来的交点坐标。If cl->flp is NULL, the left feature point needs to be calculated. The calculation method is: if the listfirstLine of the pipeline corresponding to lindex contains cl, that is, its first endpoint corresponds to (x1, y1), then (x3l, y3l) is the tail endpoint of the pipeline corresponding to lindex; otherwise (x3l, y3l) is lindex The first endpoint of the corresponding pipeline. Call the function calcCrossXY, the incoming parameters are x3l, y3l, x1, y1, x2, y2, rl, r, and the outgoing parameters are bValidL, lx, ly. Among them, bValidL represents whether the calculated intersection coordinates are valid; (lx, ly) represents the calculated intersection coordinates.
回到刚才的步骤,如果bValidL为false,即计算交点lx,ly失败,这时候应该分别取两条线段的法线偏移点,并且在两个偏移点中间再连线。具体做法为:定义deltaX,deltaY,使用calcDeltaXY,传入(x1,y1,x2,y2,r,deltaX,deltaY),求出deltaX,deltaY。则lx=x1+deltaX,ly=y1+deltaY。cl的flp为(lx,ly)。设该点为A。Going back to the previous step, if bValidL is false, the calculation of the intersection point lx, ly fails. At this time, the normal offset points of the two line segments should be taken respectively, and a line should be connected between the two offset points. The specific method is: define deltaX, deltaY, use calcDeltaXY, pass in (x1, y1, x2, y2, r, deltaX, deltaY), and find deltaX, deltaY. Then lx=x1+deltaX, ly=y1+deltaY. The flp of cl is (lx, ly). Let this point be A.
定义deltaX3,deltaY3,使用calcDeltaXY,传入(x1,y1,x3l,y3l,rl,deltaX3,deltaY3),求出deltaX3,deltaY3。则rx3=x1-deltaX3,ry3=y1-deltaY3。Define deltaX3, deltaY3, use calcDeltaXY, pass in (x1, y1, x3l, y3l, rl, deltaX3, deltaY3), and calculate deltaX3, deltaY3. Then rx3=x1-deltaX3, ry3=y1-deltaY3.
如果lindex对应的管线的listfirstLine包含cl,即lindex对应的管线的首端对应(x1,y1),则lindex对应的管线的frp为(rx3,ry3),否则lindex对应的管线的nlp为(rx3,ry3)。设该点为B。最后,生成线段AB,添加到cl的extLine中。If the listfirstLine of the pipeline corresponding to lindex contains cl, that is, the head end of the pipeline corresponding to lindex corresponds to (x1, y1), then the frp of the pipeline corresponding to lindex is (rx3, ry3), otherwise the nlp of the pipeline corresponding to lindex is (rx3, ry3). Let this point be B. Finally, a line segment AB is generated and added to the extLine of cl.
如果bValidL为true,即计算交点lx,ly成功。则cl的flp为(lx,ly)。如果lindex对应的管线的listfirstLine包含cl,即lindex对应的管线的首端对应(x1,y1),则lindex对应的管线的frp为cl的flp。否则,lindex对应的管线的nlp为cl的flp。If bValidL is true, the intersection point lx,ly is calculated successfully. Then the flp of cl is (lx, ly). If the listfirstLine of the pipeline corresponding to lindex contains cl, that is, the head end of the pipeline corresponding to lindex corresponds to (x1, y1), then the frp of the pipeline corresponding to lindex is the flp of cl. Otherwise, the nlp of the pipeline corresponding to lindex is the flp of cl.
至此,计算左边的特征点完毕,下面计算辅助线左侧的特征点。So far, the calculation of the feature points on the left is completed, and the feature points on the left side of the auxiliary line are calculated below.
如果cl的listfirstLine的长度为1,即lindex和rindex相等为同一根线,则可利用对称性特点,求出rx=x1*2-lx,ry=y1*2-ly。cl的frp为(rx,ry)。令其为点A。如果bValidL为false,则令lx3=x1*2-rx3,ly3=y1*2-ry3。如果rindex对应的管线的listfirstLine包含cl,即rindex对应的管线的首端对应(x1,y1),则rindex对应的管线的flp为(lx3,ly3)。否则,rindex对应的管线的nrp为(lx3,ly3)。令其为点B。最后,生成线段AB,添加到cl的extLine中。如果bValidL为true,则如果rindex对应的管线的listfirstLine包含cl,则rindex对应的管线的flp为cl的frp;否则,rindex对应的管线的nrp为cl的frp。If the length of listfirstLine of cl is 1, that is, lindex and rindex are equal to the same line, then rx=x1*2-lx, ry=y1*2-ly can be obtained by using the symmetry feature. The frp of cl is (rx, ry). Let it be point A. If bValidL is false, let lx3=x1*2-rx3, ly3=y1*2-ry3. If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, the head end of the pipeline corresponding to rindex corresponds to (x1, y1), then the flp of the pipeline corresponding to rindex is (lx3, ly3). Otherwise, the nrp of the pipeline corresponding to rindex is (lx3, ly3). Let it be point B. Finally, a line segment AB is generated and added to the extLine of cl. If bValidL is true, if the listfirstLine of the pipeline corresponding to rindex contains cl, then the flp of the pipeline corresponding to rindex is the frp of cl; otherwise, the nrp of the pipeline corresponding to rindex is the frp of cl.
如果cl的listfirstLine的长度不为1,则和求左边的特征点类似。计算的方法为:If the length of listfirstLine of cl is not 1, it is similar to finding the feature points on the left. The calculation method is:
如果rindex对应的管线的listfirstLine包含cl,即是其首端点对应(x1,y1),则(x3r,y3r)为rindex对应的管线的尾端点;否则(x3r,y3r)为rindex对应的管线的首端点。调用函数calcCrossXY,传入参数为x2,y2,x1,y1,x3r,y3r,r,rr,传出参数为bValidR,rx,ry。其中bValidR代表计算出来的交点坐标是否是有效的;(rx,ry)代表计算出来的交点坐标。If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, its first endpoint corresponds to (x1, y1), then (x3r, y3r) is the tail endpoint of the pipeline corresponding to rindex; otherwise (x3r, y3r) is the first endpoint of the pipeline corresponding to rindex endpoint. Call the function calcCrossXY, the incoming parameters are x2, y2, x1, y1, x3r, y3r, r, rr, and the outgoing parameters are bValidR, rx, ry. Among them, bValidR represents whether the calculated intersection coordinates are valid; (rx, ry) represents the calculated intersection coordinates.
如果bValidR为false,即计算交点rx,ry失败,这时候应该分别取两条线段的法线偏移点,并且在两个偏移点中间再连线。具体做法为:定义deltaX,deltaY,使用calcDeltaXY,传入(x1,y1,x2,y2,r,deltaX,deltaY),求出deltaX,deltaY。则rx=x1-deltaX,ry=y1-deltaY。cl的frp为(rx,ry)。设该点为A。If bValidR is false, that is, the calculation of intersection points rx, ry fails. At this time, the normal offset points of the two line segments should be taken respectively, and a line should be connected between the two offset points. The specific method is: define deltaX, deltaY, use calcDeltaXY, pass in (x1, y1, x2, y2, r, deltaX, deltaY), and find deltaX, deltaY. Then rx=x1-deltaX, ry=y1-deltaY. The frp of cl is (rx, ry). Let this point be A.
定义deltaX3,deltaY3,使用calcDeltaXY,传入(x1,y1,x3r,y3r,rr,deltaX3,deltaY3),求出deltaX3,deltaY3。则rx3=x1+deltaX3,ry3=y1+deltaY3。Define deltaX3, deltaY3, use calcDeltaXY, pass in (x1, y1, x3r, y3r, rr, deltaX3, deltaY3), and calculate deltaX3, deltaY3. Then rx3=x1+deltaX3, ry3=y1+deltaY3.
如果rindex对应的管线的listfirstLine包含cl,即rindex对应的管线的首端对应(x1,y1),则rindex对应的管线的flp为(rx3,ry3),否则rindex对应的管线的nrp为(rx3,ry3)。设该点为B。最后,生成线段AB,添加到cl的extLine中。If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, the head end of the pipeline corresponding to rindex corresponds to (x1, y1), then the flp of the pipeline corresponding to rindex is (rx3, ry3), otherwise the nrp of the pipeline corresponding to rindex is (rx3, ry3). Let this point be B. Finally, a line segment AB is generated and added to the extLine of cl.
如果bValidR为true,即计算交点rx,ry成功。则cl的frp为(rx,ry)。如果rindex对应的管线的listfirstLine包含cl,即rindex对应的管线的首端对应(x1,y1),则rindex对应的管线的flp为cl的frp。否则,rindex对应的管线的nrp为cl的frp。If bValidR is true, the intersection point rx, ry is calculated successfully. Then the frp of cl is (rx, ry). If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, the head end of the pipeline corresponding to rindex corresponds to (x1, y1), then the flp of the pipeline corresponding to rindex is the frp of cl. Otherwise, the nrp of the pipeline corresponding to rindex is the frp of cl.
至此,cl的listfirstLine的长度不为零的情况讨论完毕。So far, the case where the length of listfirstLine of cl is not zero is discussed.
下面,接着讨论cl的listfirstLine的长度为零的情况。此时,因为已没有连接线,所以生成辅助线的方法也比较简单,即计算首端点两边的法线偏移点即可。但是在管线尽头还需要延伸一点以封闭辅助线,不妨设需要延伸的长度为R。首先,定义deltaX,deltaY。通过calcDeltaXY,参数为x1,y1,x2,y2,r,deltaX,deltaY,计算出deltaX,deltaY。令lx=x1+deltaX,ly=y1+deltaY,rx=x1-deltaX,ry=y1-deltaY。则cl的flp为(lx,ly),frp为(rx,ry)。定义lxe,lye,rxe,rye。调用GetPntOnParalline,参数为x1,y1,x2,y2,lx,ly,-R,lxe,lye,得到lxe,lye。调用GetPntOnParalline,参数为x1,y1,x2,y2,rx,ry,-R,rxe,rye,得到rxe,rye。将cl的frp,(rxe,rye),(lxe,lye),cl的flp依次连成线段,加入到cl的extLine中。Next, we discuss the case where the length of listfirstLine of cl is zero. At this point, since there are no connecting lines, the method of generating auxiliary lines is relatively simple, that is, calculating the normal offset points on both sides of the first end point. However, at the end of the pipeline, it needs to be extended a little to close the auxiliary line. It is advisable to set the length to be extended as R. First, define deltaX, deltaY. Through calcDeltaXY, the parameters are x1, y1, x2, y2, r, deltaX, deltaY to calculate deltaX, deltaY. Let lx=x1+deltaX, ly=y1+deltaY, rx=x1-deltaX, ry=y1-deltaY. Then the flp of cl is (lx, ly), and the frp is (rx, ry). Define lxe, lye, rxe, rye. Call GetPntOnParalline with parameters x1, y1, x2, y2, lx, ly, -R, lxe, lye to get lxe, lye. Call GetPntOnParalline with parameters x1, y1, x2, y2, rx, ry, -R, rxe, rye to get rxe, rye. Connect the frp of cl, (rxe, rye), (lxe, lye), and the flp of cl to form a line segment in turn, and add them to the extLine of cl.
步骤104.3.8、Step 104.3.8,
GetPntOnParalline函数的实现如下:The implementation of the GetPntOnParalline function is as follows:
参数列表:x1,y1,x2,y2,xp,yp,length,x,y。x,y为传出参数。Parameter list: x1,y1,x2,y2,xp,yp,length,x,y. x, y are outgoing parameters.
先令len1等于线段((x1,y1),(x2,y2))的长度,dx=x2-x1,dy=y2-y1。The shilling len1 is equal to the length of the line segment ((x1, y1), (x2, y2)), dx=x2-x1, dy=y2-y1.
令rate=length/len1。则x=xp+dx*rate,y=yp+dy*rate。得到待求的平行线点。Let rate=length/len1. Then x=xp+dx*rate, y=yp+dy*rate. Get the desired parallel line point.
以上,是完成了cl的flp为空或者frp为空的计算。The above is to complete the calculation that the flp of cl is empty or the frp is empty.
步骤104.3.9、完成cl的nlp为空或者nrp为空的计算。Step 104.3.9, complete the calculation that nlp of cl is empty or nrp is empty.
令(x1,y1)为cl->line[1]即cl对应的管线的尾端点,(x2,y2)为cl对应的管线的首端点。如果cl->listnextLine的长度不为0,定义一个lindex和rindex,分别代表左侧参考的连接管线的索引和右侧参考的连接管线的索引。Let (x1, y1) be cl->line[1], that is, the end point of the pipeline corresponding to cl, and (x2, y2) be the first end point of the pipeline corresponding to cl. If the length of cl->listnextLine is not 0, define a lindex and rindex, which respectively represent the index of the connecting pipeline referenced on the left and the index of the connecting pipeline referenced on the right.
如果cl->listnextLine的长度为1,则此时只有一个连接管线,lindex和rindex的值为0。否则,计算当前连接线cl从尾点到首点的射线的方位角azimuth。并遍历cl->listnextLine,计算每一根对应的连接线的方位角。这时候,要注意计算的方位角的方向。方位角方向应从(x1,y1)对应的点开始计算。所以,令当前遍历的ConnectLine为line,如果line->listfirstLine包含cl,说明line的首点是对应的(x1,y1),其方位角从line的line[0]计算到line[1];若不包含,则说明是尾点对应的(x1,y1),其方位角从line的line[1]计算到line[0]。计算完方位角后,存储到数组azimuths中。之后利用FindLeft方法,找到对应的lindex,利用FindRight方法,找到对应的rindex。以下若不做特别说明,lindex对应的管线即指的是cl->listnextLine[lindex]这条线;rindex对应的管线即指的是cl->listnextLine[rindex]这条线。If the length of cl->listnextLine is 1, then there is only one connecting pipeline at this time, and the values of lindex and rindex are 0. Otherwise, calculate the azimuth azimuth of the ray from the end point to the first point of the current connection line cl. And traverse cl->listnextLine to calculate the azimuth of each corresponding connecting line. At this time, pay attention to the direction of the calculated azimuth. The azimuth direction should be calculated from the point corresponding to (x1,y1). Therefore, let the currently traversed ConnectLine be line. If line->listfirstLine contains cl, it means that the first point of line is corresponding to (x1, y1), and its azimuth is calculated from line[0] to line[1] of line; if If it is not included, it means (x1, y1) corresponding to the end point, and its azimuth is calculated from line[1] to line[0] of the line. After the azimuth is calculated, it is stored in the array azimuths. Then use the FindLeft method to find the corresponding lindex, and use the FindRight method to find the corresponding rindex. Unless otherwise specified below, the pipeline corresponding to lindex refers to the line cl->listnextLine[lindex]; the pipeline corresponding to rindex refers to the line cl->listnextLine[rindex].
定义点(x3l,y3l),表示lindex对应的管线的不和(x1,y1)相连的端点。定义点(x3r,y3r),表示rindex对应的管线的不和(x1,y1)相连的端点。定义(rx3,ry3),表示待求出的连接管线的辅助线特征点。令rl为lindex对应的管线的半径。rr为rindex对应的管线的半径。The definition point (x3l, y3l) represents the endpoint of the pipeline corresponding to lindex that is not connected to (x1, y1). The definition point (x3r, y3r) represents the endpoint of the pipeline corresponding to rindex that is not connected to (x1, y1). Define (rx3, ry3), which represents the auxiliary line feature point of the connecting pipeline to be obtained. Let rl be the radius of the pipeline corresponding to lindex. rr is the radius of the pipeline corresponding to rindex.
如果cl->nrp为NULL,则需要计算右边的特征点。计算的方法为:如果lindex对应的管线的listfirstLine包含cl,即是其首端点对应(x1,y1),则(x3l,y3l)为lindex对应的管线的尾端点;否则(x3l,y3l)为lindex对应的管线的首端点。调用函数calcCrossXY,传入参数为x3l,y3l,x1,y1,x2,y2,rl,r,传出参数为bValidR,rx,ry。其中bValidR代表计算出来的交点坐标是否是有效的;(rx,ry)代表计算出来的交点坐标。If cl->nrp is NULL, the feature points on the right need to be calculated. The calculation method is: if the listfirstLine of the pipeline corresponding to lindex contains cl, that is, its first endpoint corresponds to (x1, y1), then (x3l, y3l) is the tail endpoint of the pipeline corresponding to lindex; otherwise (x3l, y3l) is lindex The first endpoint of the corresponding pipeline. Call the function calcCrossXY, the incoming parameters are x3l, y3l, x1, y1, x2, y2, rl, r, and the outgoing parameters are bValidR, rx, ry. Among them, bValidR represents whether the calculated intersection coordinates are valid; (rx, ry) represents the calculated intersection coordinates.
如果bValidR为false,即计算交点rx,ry失败,这时候应该分别取两条线段的法线偏移点,并且在两个偏移点中间再连线。具体做法为:定义deltaX,deltaY,使用calcDeltaXY,传入(x1,y1,x2,y2,r,deltaX,deltaY),求出deltaX,deltaY。则rx=x1+deltaX,ry=y1+deltaY。cl的nrp为(rx,ry)。设该点为A。If bValidR is false, that is, the calculation of intersection points rx, ry fails. At this time, the normal offset points of the two line segments should be taken respectively, and a line should be connected between the two offset points. The specific method is: define deltaX, deltaY, use calcDeltaXY, pass in (x1, y1, x2, y2, r, deltaX, deltaY), and find deltaX, deltaY. Then rx=x1+deltaX, ry=y1+deltaY. The nrp of cl is (rx, ry). Let this point be A.
定义deltaX3,deltaY3,使用calcDeltaXY,传入(x1,y1,x3l,y3l,rl,deltaX3,deltaY3),求出deltaX3,deltaY3。则rx3=x1-deltaX3,ry3=y1-deltaY3。Define deltaX3, deltaY3, use calcDeltaXY, pass in (x1, y1, x3l, y3l, rl, deltaX3, deltaY3), and calculate deltaX3, deltaY3. Then rx3=x1-deltaX3, ry3=y1-deltaY3.
如果lindex对应的管线的listfirstLine包含cl,即lindex对应的管线的首端对应(x1,y1),则lindex对应的管线的frp为(rx3,ry3),否则lindex对应的管线的nlp为(rx3,ry3)。设该点为B。最后,生成线段AB,添加到cl的extLine中。If the listfirstLine of the pipeline corresponding to lindex contains cl, that is, the head end of the pipeline corresponding to lindex corresponds to (x1, y1), then the frp of the pipeline corresponding to lindex is (rx3, ry3), otherwise the nlp of the pipeline corresponding to lindex is (rx3, ry3). Let this point be B. Finally, a line segment AB is generated and added to the extLine of cl.
如果bValidR为true,即计算交点rx,ry成功。则cl的nrp为(rx,ry)。如果lindex对应的管线的listfirstLine包含cl,即lindex对应的管线的首端对应(x1,y1),则lindex对应的管线的frp为cl的nrp。否则,lindex对应的管线的nlp为cl的nrp。If bValidR is true, the intersection point rx, ry is calculated successfully. Then the nrp of cl is (rx, ry). If the listfirstLine of the pipeline corresponding to lindex contains cl, that is, the head end of the pipeline corresponding to lindex corresponds to (x1, y1), then the frp of the pipeline corresponding to lindex is the nrp of cl. Otherwise, the nlp of the pipeline corresponding to lindex is the nrp of cl.
至此,计算右边的特征点完毕,接下来计算左边的特征点。So far, the feature points on the right are calculated, and then the feature points on the left are calculated.
如果cl的listnextLine的长度为1,即lindex和rindex相等为同一根线,则可利用对称性特点,求出lx=x1*2-rx,ly=y1*2-ry。cl的nlp为(lx,ly)。令其为点A。如果bValidR为false,则令lx3=x1*2-rx3,ly3=y1*2-ry3。如果rindex对应的管线的listfirstLine包含cl,即rindex对应的管线的首端对应(x1,y1),则rindex对应的管线的flp为(lx3,ly3)。否则,rindex对应的管线的nrp为(lx3,ly3)。令其为点B。最后,生成线段AB,添加到cl的extLine中。如果bValidR为true,则如果rindex对应的管线的listfirstLine包含cl,则rindex对应的管线的flp为cl的nlp;否则,rindex对应的管线的nrp为cl的nlp。If the length of listnextLine of cl is 1, that is, lindex and rindex are equal to the same line, then the symmetry feature can be used to obtain lx=x1*2-rx, ly=y1*2-ry. The nlp of cl is (lx, ly). Let it be point A. If bValidR is false, let lx3=x1*2-rx3, ly3=y1*2-ry3. If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, the head end of the pipeline corresponding to rindex corresponds to (x1, y1), then the flp of the pipeline corresponding to rindex is (lx3, ly3). Otherwise, the nrp of the pipeline corresponding to rindex is (lx3, ly3). Let it be point B. Finally, a line segment AB is generated and added to the extLine of cl. If bValidR is true, if the listfirstLine of the pipeline corresponding to rindex contains cl, then the flp of the pipeline corresponding to rindex is the nlp of cl; otherwise, the nrp of the pipeline corresponding to rindex is the nlp of cl.
如果cl的listnextLine的长度不为1,则和求右边的特征点类似。计算的方法为:If the length of listnextLine of cl is not 1, it is similar to finding the feature points on the right. The calculation method is:
如果rindex对应的管线的listfirstLine包含cl,即是其首端点对应(x1,y1),则(x3r,y3r)为rindex对应的管线的尾端点;否则(x3r,y3r)为rindex对应的管线的首端点。调用函数calcCrossXY,传入参数为x2,y2,x1,y1,x3r,y3r,r,rr,传出参数为bValidL,lx,ly。其中bValidL代表计算出来的交点坐标是否是有效的;(lx,ly)代表计算出来的交点坐标。If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, its first endpoint corresponds to (x1, y1), then (x3r, y3r) is the tail endpoint of the pipeline corresponding to rindex; otherwise (x3r, y3r) is the first endpoint of the pipeline corresponding to rindex endpoint. Call the function calcCrossXY, the incoming parameters are x2, y2, x1, y1, x3r, y3r, r, rr, and the outgoing parameters are bValidL, lx, ly. Among them, bValidL represents whether the calculated intersection coordinates are valid; (lx, ly) represents the calculated intersection coordinates.
如果bValidL为false,即计算交点lx,ly失败,这时候应该分别取两条线段的法线偏移点,并且在两个偏移点中间再连线。具体做法为:定义deltaX,deltaY,使用calcDeltaXY,传入(x1,y1,x2,y2,r,deltaX,deltaY),求出deltaX,deltaY。则lx=x1-deltaX,ly=y1-deltaY。cl的nlp为(lx,ly)。设该点为A。If bValidL is false, that is, the calculation of the intersection point lx, ly fails. At this time, the normal offset points of the two line segments should be taken respectively, and a line should be connected between the two offset points. The specific method is: define deltaX, deltaY, use calcDeltaXY, pass in (x1, y1, x2, y2, r, deltaX, deltaY), and find deltaX, deltaY. Then lx=x1-deltaX, ly=y1-deltaY. The nlp of cl is (lx, ly). Let this point be A.
定义deltaX3,deltaY3,使用calcDeltaXY,传入(x1,y1,x3r,y3r,rr,deltaX3,deltaY3),求出deltaX3,deltaY3。则rx3=x1+deltaX3,ry3=y1+deltaY3。Define deltaX3, deltaY3, use calcDeltaXY, pass in (x1, y1, x3r, y3r, rr, deltaX3, deltaY3), and calculate deltaX3, deltaY3. Then rx3=x1+deltaX3, ry3=y1+deltaY3.
如果rindex对应的管线的listfirstLine包含cl,即rindex对应的管线的首端对应(x1,y1),则rindex对应的管线的flp为(rx3,ry3),否则rindex对应的管线的nrp为(rx3,ry3)。设该点为B。最后,生成线段AB,添加到cl的extLine中。If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, the head end of the pipeline corresponding to rindex corresponds to (x1, y1), then the flp of the pipeline corresponding to rindex is (rx3, ry3), otherwise the nrp of the pipeline corresponding to rindex is (rx3, ry3). Let this point be B. Finally, a line segment AB is generated and added to the extLine of cl.
如果bValidL为true,即计算交点lx,ly成功。则cl的nlp为(lx,ly)。如果rindex对应的管线的listfirstLine包含cl,即rindex对应的管线的首端对应(x1,y1),则rindex对应的管线的flp为cl的nlp。否则,rindex对应的管线的nrp为cl的nlp。If bValidL is true, the intersection point lx,ly is calculated successfully. Then the nlp of cl is (lx, ly). If the listfirstLine of the pipeline corresponding to rindex contains cl, that is, the head end of the pipeline corresponding to rindex corresponds to (x1, y1), then the flp of the pipeline corresponding to rindex is the nlp of cl. Otherwise, the nrp of the pipeline corresponding to rindex is the nlp of cl.
至此,cl的listnextLine的长度不为零的情况讨论完毕。So far, the case where the length of the listnextLine of cl is not zero has been discussed.
下面,接着讨论cl的listnextLine的长度为零的情况。此时,因为已没有连接线,所以生成辅助线的方法也比较简单,即计算首端点两边的法线偏移点即可。但是在管线尽头还需要延伸一点以封闭辅助线,不妨设需要延伸的长度为R。首先,定义deltaX,deltaY。通过calcDeltaXY,参数为x1,y1,x2,y2,r,deltaX,deltaY,计算出deltaX,deltaY。令lx=x1-deltaX,ly=y1-deltaY,rx=x1+deltaX,ry=y1+deltaY。则cl的nlp为(lx,ly),nrp为(rx,ry)。定义lxe,lye,rxe,rye。调用GetPntOnParalline,参数为x1,y1,x2,y2,lx,ly,-R,lxe,lye,得到lxe,lye。调用GetPntOnParalline,参数为x1,y1,x2,y2,rx,ry,-R,rxe,rye,得到rxe,rye。将cl的nrp,(rxe,rye),(lxe,lye),cl的nlp依次连成线段,加入到cl的extLine中。Next, we discuss the case where the length of listnextLine of cl is zero. At this point, since there are no connecting lines, the method of generating auxiliary lines is relatively simple, that is, calculating the normal offset points on both sides of the first end point. However, at the end of the pipeline, it needs to be extended a little to close the auxiliary line. It is advisable to set the length to be extended as R. First, define deltaX, deltaY. Through calcDeltaXY, the parameters are x1, y1, x2, y2, r, deltaX, deltaY to calculate deltaX, deltaY. Let lx=x1-deltaX, ly=y1-deltaY, rx=x1+deltaX, ry=y1+deltaY. Then the nlp of cl is (lx, ly), and the nrp is (rx, ry). Define lxe, lye, rxe, rye. Call GetPntOnParalline with parameters x1, y1, x2, y2, lx, ly, -R, lxe, lye to get lxe, lye. Call GetPntOnParalline with parameters x1, y1, x2, y2, rx, ry, -R, rxe, rye to get rxe, rye. Connect the nrp of cl, (rxe, rye), (lxe, lye), and the nlp of cl into line segments in turn, and add them to the extLine of cl.
步骤105、根据所述管线辅助线的特征点生成第一管线辅助线,并将所述管线标记添加至对应的所述第一管线辅助线。Step 105: Generate a first pipeline auxiliary line according to the feature points of the pipeline auxiliary line, and add the pipeline mark to the corresponding first pipeline auxiliary line.
连接步骤104中生成的第一特征点和第二特征点。具体的,遍历vecConnectlines,对每一根连接线对象cl,连接其flp和nlp,得到左侧辅助线;连接其frp和nrp,得到右侧辅助线。遍历cl的extLine,生成每一根额外连接线段。对每一根生成的辅助线,添加管线标记,利用先前记录的array_attrs内的属性值对其赋上相应的属性。至此,生成所有的管线辅助线算法执行完毕。The first feature point and the second feature point generated in
本发明实施例通过筛选满足预设条件的管线数据,并根据实际需求获取相应区域内管线的空间坐标,根据空间坐标和要素类索引计算管线辅助线的特征点并生成第一管线辅助线,可以简化拓扑结构中生成管线辅助线的计算量,提高生成管线辅助线的效率。In the embodiment of the present invention, by screening the pipeline data satisfying the preset conditions, obtaining the spatial coordinates of the pipelines in the corresponding area according to the actual needs, calculating the feature points of the pipeline auxiliary lines according to the spatial coordinates and the feature class index, and generating the first pipeline auxiliary line, it can be Simplify the calculation amount of generating pipeline auxiliary lines in the topology structure, and improve the efficiency of generating pipeline auxiliary lines.
需要说明的是,对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。It should be noted that, for the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the present invention is not limited by the described action sequence, because According to the embodiment of the present invention, certain steps may be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
为了实现上述方法,本发明实施例还提供了一种生成管线辅助线的装置,图2为本发明实施例提供的一种生成管线辅助线的装置的结构框图,所述装置包括:In order to implement the above method, an embodiment of the present invention also provides a device for generating auxiliary pipeline lines. FIG. 2 is a structural block diagram of a device for generating auxiliary pipeline lines provided by an embodiment of the present invention. The device includes:
管线数据获取模块201,用于根据第一预设条件,获取管线数据的管线名称,所述管线数据包括若干段管线和管线标记;The pipeline
管线坐标获取模块202,用于根据第二预设条件,对所述管线数据进行空间查询,并依据空间参考坐标系确定所述管线的空间坐标;The pipeline coordinate
索引创建模块203,用于创建管线类并根据所述管线类添加要素类索引,所述管线类根据所述管线数据的类型和所述空间坐标的信息创建;An
特征点计算模块204,用于根据所述管线的空间坐标和所述要素类索引计算所述管线辅助线的特征点;A feature
第一辅助线生成模块205,用于根据所述管线辅助线的特征点生成第一管线辅助线,并将所述管线标记添加至对应的所述第一管线辅助线。The first auxiliary
在一种可选的实施例中,索引创建模块203可以包括:In an optional embodiment, the
第一索引创建子模块,用于添加要素类数据库索引,用于创建管线点要素类数据库索引和管线线要素类数据库索引,并将数据库索引信息进行存储;The first index creation sub-module is used to add a feature class database index, and is used to create a pipeline point feature class database index and a pipeline line feature class database index, and store database index information;
和/或,第二索引创建子模块,用于添加要素类空间索引,根据管线要素图层的几何范围确定所述空间索引起始点和网格值,分别为所述管线点要素类、所述管线线要素类创建空间索引,并计算出管线要素的网格范围,将网格编码进行存储。And/or, the second index creation submodule is used to add a feature class spatial index, and determine the starting point and grid value of the spatial index according to the geometric range of the pipeline feature layer, which are respectively the pipeline point feature class, the The pipeline line feature class creates a spatial index, calculates the grid range of the pipeline feature, and stores the grid code.
在一种可选的实施例中,所述装置中每段所述管线均包括第一端点和第二端点;所述特征点计算模块204可以包括:In an optional embodiment, each section of the pipeline in the device includes a first end point and a second end point; the feature
第一特征点计算子模块,用于根据所述第一端点和所述要素类索引计算所述管线辅助线的第一特征点,所述第一特征点通过将所述第一端点朝向所述管线的法线方向平移后得到,其中,平移的距离为管线的半径;The first feature point calculation submodule is used to calculate the first feature point of the pipeline auxiliary line according to the first end point and the feature class index, and the first feature point is obtained by moving the first end point toward The normal direction of the pipeline is obtained after translation, wherein the distance of translation is the radius of the pipeline;
第二特征点计算子模块,用于根据所述第二端点和所述要素类索引计算所述管线辅助线的第二特征点,所述第二特征点通过将所述第二端点朝向所述管线的法线方向平移后得到,其中,平移的距离为管线的半径。The second feature point calculation submodule is used to calculate the second feature point of the pipeline auxiliary line according to the second end point and the feature class index, and the second feature point is obtained by moving the second end point toward the The normal direction of the pipeline is obtained after translation, where the translation distance is the radius of the pipeline.
在一种可选的实施例中,在根据第一预设条件,获取管线数据的管线名称后,所述装置还包括:In an optional embodiment, after obtaining the pipeline name of the pipeline data according to the first preset condition, the device further includes:
查找模块,用于根据所述管线名称查找与所述管线数据对应的第二管线辅助线;A search module, configured to search for a second pipeline auxiliary line corresponding to the pipeline data according to the pipeline name;
初始化模块,用于删除所述第二管线辅助线,并对所述管线数据的图层进行初始化。The initialization module is configured to delete the second pipeline auxiliary line, and initialize the layer of the pipeline data.
在一种可选的实施例中,所述第一预设条件包括以下至少一种:In an optional embodiment, the first preset condition includes at least one of the following:
所述管线的地理位置;the geographic location of the pipeline;
和/或,所述管线的材质;And/or, the material of the pipeline;
和/或,所述管线的尺寸。And/or, the size of the pipeline.
在一种可选的实施例中,所述第二预设条件包括以下至少一种:In an optional embodiment, the second preset condition includes at least one of the following:
所述管线的用途;the purpose of the pipeline;
和/或,所述管线的使用范围。And/or, the scope of use of the pipeline.
本发明实施例包括以下优点:本发明实施例通过筛选满足预设条件的管线数据,并根据实际需求获取相应区域内管线的空间坐标,根据空间坐标和要素类索引计算管线辅助线的特征点并生成第一管线辅助线,可以简化拓扑结构中生成管线辅助线的计算量,提高生成管线辅助线的效率。The embodiment of the present invention has the following advantages: the embodiment of the present invention filters the pipeline data satisfying the preset conditions, and obtains the spatial coordinates of the pipeline in the corresponding area according to actual needs, calculates the feature points of the pipeline auxiliary line according to the spatial coordinates and the feature class index, and Generating the first pipeline auxiliary line can simplify the calculation amount of generating the pipeline auxiliary line in the topology structure and improve the efficiency of generating the pipeline auxiliary line.
本发明实施例还提供了一种电子设备,包括处理器、存储器及存储在所述存储器上并能够在所述处理器上运行的计算机程序,该计算机程序被处理器执行时实现上述生成管线辅助线方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。An embodiment of the present invention also provides an electronic device, including a processor, a memory, and a computer program stored on the memory and capable of running on the processor. When the computer program is executed by the processor, the above-mentioned generation pipeline assistance is realized. Each process of the line method embodiment can achieve the same technical effect, so in order to avoid repetition, it will not be repeated here.
本发明实施例还提供了一种计算机可读存储介质,计算机可读存储介质上存储计算机程序,计算机程序被处理器执行时实现上述生成管线辅助线方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。The embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process in the above-mentioned embodiment of the method for generating pipeline auxiliary lines can be achieved, and the same Technical effects, in order to avoid repetition, will not be repeated here.
本说明书中的各个实施例均采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似的部分互相参见即可。Each embodiment in this specification is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
本领域内的技术人员应明白,本发明的实施例可提供为方法、装置、或计算机程序产品。因此,本发明实施例可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明实施例可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present invention may be provided as methods, apparatuses, or computer program products. Accordingly, embodiments of the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, embodiments of the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明实施例是参照根据本发明实施例的方法、终端设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理终端设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理终端设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。Embodiments of the present invention are described with reference to flowcharts and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each procedure and/or block in the flowchart and/or block diagram, and a combination of procedures and/or blocks in the flowchart and/or block diagram can be realized by computer program instructions. These computer program instructions may be provided to a general purpose computer, special purpose computer, embedded processor or processor of other programmable data processing terminal equipment to produce a machine such that instructions executed by the computer or processor of other programmable data processing terminal equipment Produce means for realizing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理终端设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal to operate in a specific manner, such that the instructions stored in the computer-readable memory produce an article of manufacture comprising instruction means, the The instruction means implements the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理终端设备上,使得在计算机或其他可编程终端设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程终端设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded into a computer or other programmable data processing terminal equipment, so that a series of operational steps are performed on the computer or other programmable terminal equipment to produce computer-implemented processing, thereby The instructions executed above provide steps for implementing the functions specified in one or more procedures of the flowchart and/or one or more blocks of the block diagram.
尽管已描述了本发明实施例的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例做出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明实施例范围的所有变更和修改。Having described preferred embodiments of embodiments of the present invention, additional changes and modifications to these embodiments can be made by those skilled in the art once the basic inventive concept is appreciated. Therefore, the appended claims are intended to be construed to cover the preferred embodiment and all changes and modifications which fall within the scope of the embodiments of the present invention.
最后,还需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者终端设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者终端设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者终端设备中还存在另外的相同要素。Finally, it should also be noted that in this text, relational terms such as first and second etc. are only used to distinguish one entity or operation from another, and do not necessarily require or imply that these entities or operations, any such actual relationship or order exists. Furthermore, the term "comprises", "comprises" or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article, or terminal equipment comprising a set of elements includes not only those elements, but also includes elements not expressly listed. other elements identified, or also include elements inherent in such a process, method, article, or end-equipment. Without further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article or terminal device comprising said element.
以上所述仅为本发明的较佳实施例,并不用以限制本发明,凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included in the protection of the present invention. within range.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210402545.XA CN114661729B (en) | 2022-04-18 | 2022-04-18 | A method and device for generating pipeline auxiliary lines |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210402545.XA CN114661729B (en) | 2022-04-18 | 2022-04-18 | A method and device for generating pipeline auxiliary lines |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114661729A CN114661729A (en) | 2022-06-24 |
CN114661729B true CN114661729B (en) | 2023-01-17 |
Family
ID=82034839
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210402545.XA Active CN114661729B (en) | 2022-04-18 | 2022-04-18 | A method and device for generating pipeline auxiliary lines |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114661729B (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106600468A (en) * | 2015-10-20 | 2017-04-26 | 星际空间(天津)科技发展有限公司 | Geographic-information-based comprehensive pipeline data two-dimensional and three-dimensional integrated organization method |
CN108446488A (en) * | 2018-03-16 | 2018-08-24 | 杭州市建筑设计研究院有限公司 | A kind of intelligentized design quality analysis system based on BIM technology |
WO2021207199A1 (en) * | 2020-04-06 | 2021-10-14 | Saudi Arabian Oil Company | Augmented reality visualization of underground pipelines using geospatial databases and km markers |
-
2022
- 2022-04-18 CN CN202210402545.XA patent/CN114661729B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106600468A (en) * | 2015-10-20 | 2017-04-26 | 星际空间(天津)科技发展有限公司 | Geographic-information-based comprehensive pipeline data two-dimensional and three-dimensional integrated organization method |
CN108446488A (en) * | 2018-03-16 | 2018-08-24 | 杭州市建筑设计研究院有限公司 | A kind of intelligentized design quality analysis system based on BIM technology |
WO2021207199A1 (en) * | 2020-04-06 | 2021-10-14 | Saudi Arabian Oil Company | Augmented reality visualization of underground pipelines using geospatial databases and km markers |
Non-Patent Citations (1)
Title |
---|
基于ArcEngine 的地下管线信息管理系统的设计与应用;崔磊等;《城市勘测》;20181031(第5期);45-48 * |
Also Published As
Publication number | Publication date |
---|---|
CN114661729A (en) | 2022-06-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106683198B (en) | Three-dimensional automatic modeling and scheduling rendering method for comprehensive pipe network | |
Hadzilacos et al. | An extended entity-relationship model for geographic applications | |
CN106600468A (en) | Geographic-information-based comprehensive pipeline data two-dimensional and three-dimensional integrated organization method | |
CN101924647B (en) | Local area topology rebuilding method for updating navigation road network increment | |
CN102193998B (en) | Arc scanning type construction scheme of triangular irregular network containing edge topological information | |
CN103679804A (en) | System and method for automatically building three-dimensional model of data of underground pipeline | |
CN111540051B (en) | CIM-based full-element mass data lightweight and topology analysis application platform | |
CN115641407A (en) | Three-dimensional pipe network incremental updating modeling method and device, storage medium and electronic equipment | |
CN109190174B (en) | Method and system for establishing pipe network data model | |
CN112182871A (en) | System and method for converting three-dimensional pipeline model into MapGIS model | |
CN101251929B (en) | Method for establishing area topological relation based on Delaunay triangular mesh technology | |
CN106373188B (en) | A kind of generation method and system of underground pipe network threedimensional model | |
CN101685465A (en) | Integrated three-dimensional data modeling method for comprehensive pipe network geographic information system | |
CN104700453A (en) | Method for generating three-dimensional model of cable pipe network based on GIS | |
CN114661729B (en) | A method and device for generating pipeline auxiliary lines | |
CN112328877A (en) | A method for multi-user skyline query on time-dependent road network | |
Ai et al. | A map generalization model based on algebra mapping transformation | |
CN107229678A (en) | A kind of new line feature structure face method | |
CN110390725B (en) | Pipeline completion map generation method, device and system | |
CN101546438A (en) | Superposing analysis method of a plurality of region topology layers based on restricting Delaunay triangulation network technique | |
CN116432355A (en) | Automatic modeling method for three-dimensional model of urban comprehensive underground pipeline | |
CN111680376B (en) | Method, device and system for constructing polygons from line elements | |
Zeitouni et al. | Topological modelling for 3D GIS | |
CN117853669A (en) | Topology analysis and three-dimensional road network automatic generation method based on low-precision road network | |
CN119323093A (en) | Method and device for generating single line diagram of power distribution network fused with spatial data |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |