Map marking method and device for overlapped pipe sections, electronic equipment and storage medium
By calculating and counting the number of overlapping pipe sections associated with each station point on the map and assigning offset values, the problem of difficulty in dealing with complex overlapping pipe sections in the prior art is solved, and efficient and intuitive display on the map is achieved.
Patent Information
- Application Number
- CN202510221914.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-06-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing overlapping pipe segment map marking methods are difficult to efficiently and intuitively deal with overlapping pipe segment problems in many complex or special situations, resulting in the map display being not intuitive enough.
By obtaining the station site point set data and pipe segment set data on the map, calculate the overlapping pipe segments associated with each station site and count the number, assign offset values to the pipe segments of each station site in turn, and draw the line segments representing the pipe segment on the map according to the offset.
It realizes efficient and intuitive handling of overlapping pipe segment problems in a variety of complex or special situations, minimizes overlap and crossover, and improves the clarity of map drawing and intuitive expression.
Smart Images

Figure CN120164378A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of map marking, and particularly relates to a method, device, electronic device and storage medium for map marking of overlapping pipeline segments. Background Art
[0002] In a pipeline network project, a certain point on the map is used to represent a station yard, and the connection line between two points represents a pipeline segment. Multiple station yards and pipeline segments will form a topological pipeline network. When the topological network is displayed on the map, if there are multiple pipeline segment connection lines between two station yards, or multiple pipeline segment connection lines overlap on the map, it will be impossible to directly view how many pipeline segments there are on the overlapping line segment, affecting user identification and thus unable to perform map pipeline segment operations.
[0003] In order to distinguish overlapping pipeline segments and visually display the overlapping pipeline segments on the map, in the industry, when drawing a map, it is solved by setting an offset for the pipeline segment. When the offset of the pipeline segment is 0, the pipeline segment can be directly drawn as a straight line. When the offset of the pipeline segment is not 0, the pipeline segment can be drawn as a broken line for display, so as to distinguish the overlapping pipeline segments between station yards on the map. However, in practice, the situation of pipeline segment overlap distribution is complex and diverse, and the existing map marking method for overlapping pipeline segments still cannot solve the problem of pipeline segment overlap in various special situations. Summary of the Invention
[0004] The embodiments of the present application provide a method, device, electronic device and storage medium for map marking of overlapping pipeline segments, so as to solve the problem that in the existing map marking method for overlapping pipeline segments, only the problem of overlapping pipeline segments in simple situations can be solved, and the map marking problem of overlapping pipeline segments in various complex or special situations cannot be efficiently and visually processed.
[0005] In a first aspect, the embodiments of the present application provide a method for map marking of overlapping pipeline segments, including:
[0006] Obtain the station yard point set data and pipeline segment set data on the map, where the station yard point set data includes a set of longitude data and latitude data of each station yard point on the map, and the pipeline segment set data includes a set of association information between the two endpoints of each pipeline segment on the map and the station yard points;
[0007] Calculate the overlapping pipeline segments associated with each station yard point respectively according to the station yard point set data and the pipeline segment set data, and count the number of overlapping pipeline segments associated with each station yard point;
[0008] Assign offset values to the pipeline segments associated with each station yard point in sequence according to the number of the associated overlapping pipeline segments;
[0009] Draw a line segment representing the pipeline segment on the map according to the offset value assignment of the pipeline segment.
[0010] In a possible embodiment, calculating the overlapping pipe segments associated with each station point according to the station point set data and the pipe segment set data respectively, and counting the number of overlapping pipe segments associated with each station point, includes:
[0011] Taking each station point as a common endpoint respectively, and obtaining the longitude data and latitude data of the other end station points of all the associated pipe segments of this common endpoint;
[0012] Calculating the slope value of the pipe segment relative to the common endpoint according to the longitude data and latitude data of the station points associated with both ends of the pipe segment;
[0013] If the slope values of different pipe segments relative to the common endpoint are equal, they are overlapping pipe segments;
[0014] Calculating the number of overlapping pipe segments on each station point according to the slope value of the pipe segment relative to the common endpoint.
[0015] In a possible embodiment, calculating the overlapping pipe segments associated with each station point according to the station point set data and the pipe segment set data respectively, and counting the number of overlapping pipe segments associated with each station point, includes:
[0016] Generating a straight line equation of the pipe segment according to the longitude data and latitude data of the station points associated with both ends of the pipe segment;
[0017] Calculating the overlapping pipe segments with each station point as the common endpoint according to the straight line equation of the pipe segment;
[0018] Calculating the number of overlapping pipe segments with each station point as the common endpoint.
[0019] In a possible embodiment, before calculating the overlapping pipe segments with each station point as the common endpoint according to the straight line equation of the pipe segment, it further includes:
[0020] Calculating all the overlapping pipe segments according to the straight line equation of the pipe segment;
[0021] In the case where there is no common endpoint between the overlapping pipe segments, adding virtual pipe segments by extending the two endpoints of the pipe segment so that there is at least one common endpoint between the overlapping pipe segments.
[0022] In a possible embodiment, assigning offset values to the pipe segments associated with each station point in sequence according to the number of the associated overlapping pipe segments, includes:
[0023] Sorting the station points in descending order according to the number of overlapping pipe segments associated with each station point;
[0024] Calculating the length values of the overlapping pipe segments on each station point in sequence according to the sorting result;
[0025] Assign offset values to each pipe segment in sequence according to the length value of the overlapping pipe segments.
[0026] In a possible embodiment, the step of assigning offset values to each pipe segment in sequence according to the length value of the overlapping pipe segments includes:
[0027] Assign an offset value of 0 to the pipe segment with the smallest length value among the overlapping pipe segments at the station point;
[0028] According to the length values of the overlapping pipe segments at the station point, assign offset values to the pipe segments incrementally from 0 in ascending order of the length values;
[0029] For the offset values of several overlapping pipe segments with equal length values, assign positive and negative values with equal absolute values or directly assign them incrementally.
[0030] In a possible embodiment, the step of drawing a line segment representing the pipe segment on the map according to the offset value assignment of the pipe segment includes:
[0031] For the pipe segment with an offset value assignment of 0, draw a straight line segment on the map to mark the pipe segment;
[0032] For the pipe segment with an offset value assignment not equal to 0, draw a polyline segment on the map with the offset value assignment as the amplitude.
[0033] In a second aspect, an embodiment of the present application provides a map marking device for overlapping pipe segments, including:
[0034] An acquisition module, configured to acquire station point set data and pipe segment set data on the map, where the station point set data includes a set of longitude data and latitude data of each station point on the map, and the pipe segment set data includes a set of association information between the two endpoints of each pipe segment on the map and the station point;
[0035] A calculation module, configured to calculate the overlapping pipe segments associated with each station point respectively according to the station point set data and the pipe segment set data, and count the number of overlapping pipe segments associated with each station point;
[0036] An assignment module, configured to assign offset values to the pipe segments associated with each station point in sequence according to the number of the associated overlapping pipe segments;
[0037] A drawing module, configured to draw a line segment representing the pipe segment on the map according to the offset value assignment of the pipe segment.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory. Among them, the memory stores program code, and when the program code is executed by the processor, the processor executes the map marking method for overlapping pipe segments described in the first aspect above.
[0039] In a fourth aspect, a computer-readable storage medium provided by the present application includes program codes, which, when the storage medium runs on an electronic device, are used to cause the electronic device to execute the method for map marking of overlapping pipe segments described in the first aspect above.
[0040] In a fifth aspect, an embodiment of a computer program product of the present application includes computer instructions stored in a computer-readable storage medium; when a processor of an electronic device reads the computer instructions from the computer-readable storage medium, the processor executes the computer instructions, causing the electronic device to execute the method for map marking of overlapping pipe segments described in the first aspect above.
[0041] The beneficial effects of the present application are as follows:
[0042] The embodiment of the present application provides a method, device, electronic device and storage medium for map marking of overlapping pipe segments. Among them, the method for map marking of overlapping pipe segments includes: obtaining station field point set data and pipe segment set data on a map, where the station field point set data includes a set of longitude data and latitude data of each station field point on the map, and the pipe segment set data includes a set of association information between two endpoints of each pipe segment and station field points on the map; calculating the overlapping pipe segments associated with each station field point respectively according to the station field point set data and the pipe segment set data, and counting the number of overlapping pipe segments associated with each station field point; assigning offset values to the pipe segments associated with each station field point in sequence according to the number of associated overlapping pipe segments; and drawing a line segment representing the pipe segment on the map according to the offset value assignment of the pipe segment. In this way, when solving various problems of overlapping pipe segments, the overlapping pipe segments can be judged first according to the longitude data and latitude data of the station field points at both ends of the pipe segment, and then the number of overlapping pipe segments associated with each station field point as a common endpoint is counted, and the offset values are assigned to the overlapping pipe segments at each common endpoint in sequence according to the number of overlapping pipe segments, so as to accurately calculate the offset value of each overlapping pipe segment, minimize the overlap and intersection of overlapping pipe segments during map drawing, and improve the clarity of pipe segment map drawing and the intuitiveness of expression.
[0043] Other features and advantages of the present application will be described in the following description, and part of them will be obvious from the description, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the written description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] To more clearly illustrate the technical solutions in the embodiments of the present application or in the related art, the following will briefly introduce the accompanying drawings required for the description of the embodiments or the related art. Obviously, the accompanying drawings in the following description are only those of the embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can also be obtained based on the provided drawings.
[0045] Figure 1 Schematic diagram of the application scenario in the embodiments of the present application;
[0046] Figure 2 Flowchart of the implementation of a method for map marking of overlapping pipe segments in the embodiments of the present application;
[0047] Figure 3 Schematic diagram of the process of calculating overlapping pipe segments in the embodiments of the present application;
[0048] Figure 4 Schematic diagram of the process of adding virtual pipe segments in the embodiments of the present application;
[0049] Figure 5 Schematic diagram of the process of offset assignment in the embodiments of the present application;
[0050] Figure 6 Schematic diagram of the structure of a device for map marking of overlapping pipe segments in the embodiments of the present application;
[0051] Figure 7 Schematic diagram of the hardware composition structure of an electronic device in the embodiments of the present application. Detailed implementation manners
[0052] To make the objectives, technical solutions, and advantages of the present application clearer and more understandable, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of them. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts belong to the scope of protection of the present application. Without conflict, the embodiments in the present application and the features in the embodiments can be arbitrarily combined with each other. And although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.
[0053] The following briefly introduces the design concept of the embodiments of the present application:
[0054] In a pipe network project, a certain point on the map is used to represent a station yard, and the connection line between two points represents a pipe section. Multiple station yards and pipe sections will form a topological pipe network. When the topological network is displayed on the map, if there are multiple pipe section connection lines between two station yards, or multiple pipe section connection lines overlap on the map, it will be impossible to intuitively view how many pipe sections there are on the overlapping line segments, affecting the user's discrimination and thus unable to perform map pipe section operations. In order to distinguish overlapping pipe sections and visually display them on the map, the industry solves this problem by setting an offset for the pipe sections when drawing the map. In the prior art, after assigning an offset value to the overlapping pipe sections between two station yards and then performing map drawing, this method can only solve the problem of overlapping pipe sections between two station yard points. When drawing multiple special cases of overlapping pipe sections generated by multiple station yard points on the map, there will be problems such as pipe section coincidence and intersection, resulting in an unintuitive map display and the display effect not meeting the user's requirements.
[0055] In view of this, the embodiments of the present application provide a method, device, electronic device, and storage medium for map marking of overlapping pipe sections. Among them, the method for map marking of overlapping pipe sections includes:
[0056] First, obtain the station yard point set data and pipe section set data on the map; wherein, the station yard point set data includes a set of longitude data and latitude data of each station yard point on the map, and the pipe section set data includes a set of association information between the two endpoints of each pipe section on the map and the station yard points; then, calculate the overlapping pipe sections associated with each station yard point respectively according to the station yard point set data and the pipe section set data, and count the number of overlapping pipe sections associated with each station yard point; again, assign offset values to the pipe sections associated with each station yard point in sequence according to the number of the associated overlapping pipe sections; finally, draw a line segment representing the pipe section on the map according to the offset value assignment of the pipe section. In this way, when drawing the overlapping pipe sections between multiple station yard points on the map, the overlapping pipe sections associated with the station yard points can be assigned values in sequence according to the number of overlapping pipe sections of each station yard point, avoiding the influence of repeated offset value assignment to the same pipe section on the map drawing effect.
[0057] The following describes the preferred embodiments of the present application with reference to the accompanying drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application, and are not used to limit the present application. And without conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.
[0058] As Figure 1 shown, it is a schematic diagram of an application scenario provided by the embodiments of the present application. In this application scenario schematic diagram, it includes a terminal device 101 and a server 102. Among them, the terminal device 101 communicates with the server 102 through a communication network.
[0059] The terminal device 101 is an electronic device used by a target object. This electronic device can be a personal computer, mobile phone, tablet computer, notebook, e-book reader, vehicle-mounted terminal, etc. In addition, a client with functions of uploading data and displaying a map interface can be installed on the terminal device 101. This client can be software (such as an APP, browser, etc.), or a web page, mini-program, etc. The target object can use the above-mentioned client with functions of uploading data and displaying a map interface through the terminal device 101 to perform related operations such as data uploading and map interface viewing.
[0060] The server 102 can be an independent physical server, an edge device in the field of cloud computing, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud storage, cloud functions, network services, cloud communications, middleware services, domain name services, security services, Content Delivery Network (English name: Content Delivery Network, abbreviation: CDN), as well as big data and artificial intelligence platforms.
[0061] The user of the pipeline network map drawing system uploads the station field point set data and pipeline segment set data on the map to the server 102 through the terminal device 101, and the server 102 obtains the station field point set data and pipeline segment set data on the map; wherein, the station field point set data includes a set of longitude data and latitude data of each station field point on the map, and the pipeline segment set data includes a set of association information between the two endpoints of each pipeline segment and the station field point on the map; then, calculate the overlapping pipeline segments associated with each station field point respectively according to the station field point set data and the pipeline segment set data, and count the number of overlapping pipeline segments associated with each station field point; again, assign offset values to the pipeline segments associated with each station field point in sequence according to the number of the associated overlapping pipeline segments; finally, draw a line segment representing the pipeline segment on the map according to the offset value assignment of the pipeline segment. The user views the pipeline segment map drawn by the server 102 through the terminal device 101.
[0062] The number of the above-mentioned terminal device 101 and / or server 102 is not limited in any way.
[0063] Next, in combination with the above application scenario, refer to the drawings to describe the map marking method for overlapping pipeline segments provided by the exemplary embodiments of the present application. It should be noted that the above application scenario is only shown for the convenience of understanding the spirit and principle of the present application, and the embodiments of the present application are not limited in this regard.
[0064] Refer to Figure 2 , which is the implementation flowchart of a map marking method for overlapping pipeline segments provided by an embodiment of the present application. Here, the server is used as the execution subject for introduction. The specific implementation process of this method is as follows:
[0065] S201. Obtain the data of the set of station points and the data of the set of pipeline segments on the map. The data of the set of station points includes the set of longitude data and latitude data of each station point on the map, and the data of the set of pipeline segments includes the set of the association information between the two endpoints of each pipeline segment and the station points on the map.
[0066] In this embodiment, the data of the set of station points and the data of the set of pipeline segments on the map are obtained according to the geographical distribution information of the actual pipeline network. Specifically, first, obtain the set of all station points to be drawn on the map. The data of each station point in this set includes the geographical location coordinates of the station point, that is, the longitude data and latitude data of the station point. Then, obtain the set of all pipeline segments to be drawn on the map. The data of each pipeline segment in this set includes the information of the associated stations at both ends of the pipeline segment. Here, the information of the associated stations includes but is not limited to the number, name, longitude data, and dimension data of the station points.
[0067] In some embodiments, the data of the set of station points further includes the information of all pipeline segments connected to each station. The pipeline segment information includes but is not limited to the pipeline segment number, the station points connected at both ends of the pipeline segment, the length value of the pipeline segment, and the number of pipeline segments with this station point as a common endpoint, etc.
[0068] S202. Calculate the overlapping pipeline segments associated with each station point according to the data of the set of station points and the data of the set of pipeline segments, and count the number of overlapping pipeline segments associated with each station point.
[0069] Among them, the overlapping pipeline segments refer to different pipeline segments that completely overlap, partially overlap, or short pipeline segments completely overlap within long pipeline segments. There may be one group or multiple groups of overlapping pipeline segments associated with each station point. The overlapping pipeline segments within the same group should overlap on the same straight line; different groups of overlapping pipeline segments associated with the same station point have a common endpoint but different slopes. Here, counting the number of overlapping pipeline segments associated with each station point means counting the number of overlapping pipeline segments in the same group associated with a certain station point.
[0070] In some embodiments, as shown in the appendix Figure 3 In S202, the specific implementation manner of calculating the overlapping pipeline segments associated with each station point according to the data of the set of station points and the data of the set of pipeline segments and counting the number of overlapping pipeline segments associated with each station point may include:
[0071] First, take each station point as a common endpoint respectively, and obtain the longitude data and latitude data of the other end station points of all associated pipeline segments of this common endpoint. As shown in the appendix Figure 3 In the figure, taking station point A as the common endpoint, obtain the longitude data and latitude data (i.e., the point coordinates on the map) of the other end station points B, C, D, and E of the pipeline segments AB, AC, AD, and AE associated with point A.
[0072] Then, according to the longitude data and latitude data of the associated station points at both ends of the pipeline segment, calculate the slope value of the pipeline segment relative to the common end point. That is, respectively calculate the slopes k of pipeline segments AB, AC, AD, and AE according to the longitude data and latitude data of station points A, B, C, D, and E, namely: k AB = latitude difference AB / longitude difference AB , k AC = latitude difference AC / longitude difference AC , k AD = latitude difference AD / longitude difference AD , k AE = latitude difference AE / longitude difference AE .
[0073] If the slope values of different pipeline segments relative to the common end point are equal, they are overlapping pipeline segments. Specifically, equal slope values mean that relative to the horizontal direction, the deflection angles of the two pipeline segments are equal and the directions are the same. As shown in the appendix Figure 3 , by calculating k AB = k AC , and the directions are both positive and consistent with the horizontal direction, it is determined that pipeline segment AB overlaps with pipeline segment AC, and this overlapping method is that short pipeline segment AB completely overlaps within long pipeline segment AC.
[0074] Finally, calculate the number of overlapping pipeline segments at each station point according to the slope value of the pipeline segment relative to the common end point. That is, referring to all the pipeline segment slope values calculated above, the number of overlapping pipeline segments connected when each station point is used as the common end point can be calculated. As shown in the appendix Figure 3 , the number of overlapping pipeline segments connected with station point A as the common end point is 2.
[0075] In this embodiment, by first determining the common end point, calculate the overlapping pipeline segments with each station point as the common end point respectively, so that the number of overlapping pipeline segments associated with each station point can be counted, providing a data basis for subsequent sorting according to the number of overlapping pipeline segments at the station point. This method can solve the statistical problem of more than 2 overlapping pipeline segments with at least one common end point.
[0076] In some embodiments, in S202, another specific implementation manner of calculating the overlapping pipeline segments associated with each station point according to the station point set data and the pipeline segment set data and counting the number of overlapping pipeline segments associated with each station point may include:
[0077] First, generate the straight line equation of the pipeline segment according to the longitude data and latitude data of the associated station points at both ends of the pipeline segment.
[0078] Then, overlapping pipe segments with each station point as a common endpoint are calculated according to the straight-line equation of the pipe segment. According to the principle that the straight-line equations of two overlapping line segments are the same, all overlapping pipe segments connected by the common endpoint can be determined.
[0079] Calculate the number of overlapping pipe segments with each station point as a common endpoint.
[0080] In this embodiment, without considering the common endpoint, first, according to the straight-line equation of the pipe segment, all calculated overlapping pipe segments are obtained, so as to achieve the purpose of summarizing and counting all overlapping pipe segments on the same straight line.
[0081] Since this embodiment directly calculates the overlapping pipe segments according to the straight-line equation of the pipe segment, there will be a problem that although two pipe segments overlap, due to the absence of a common endpoint, when the offset value is assigned to the pipe segment according to the station point subsequently, the pipe segments of the overlapping pipe segments are assigned the same offset value or the overlapping pipe segments are not assigned values in the order of the length values. When drawing the map, the problem of line segment coincidence or intersection of the overlapping pipe segments still cannot be avoided.
[0082] In order to enable orderly offset value assignment for all overlapping pipe segments on the same straight line, it is necessary to determine a station point as the common endpoint for the overlapping pipe segments, providing an accurate data basis for subsequently assigning offset values to the overlapping pipe segments associated with the station point in sequence. Specifically, as shown in the appendix Figure 4 As shown, based on the method of obtaining overlapping pipe segments through the straight-line equation above, in S202, before calculating the overlapping pipe segments with each station point as a common endpoint according to the straight-line equation of the pipe segment, it may further include:
[0083] Calculate all overlapping pipe segments according to the straight-line equation of the pipe segment;
[0084] In the case where there is no common endpoint between the overlapping pipe segments, virtual pipe segments are added by extending the two endpoints of the pipe segment so that there is at least one common endpoint between the overlapping pipe segments.
[0085] As shown in the appendix Figure 4 In the figure, according to the longitude data and latitude data of the station points associated with both ends of the pipe segments AB, CD, and EF, the equation of the pipe segment AB can be obtained as y AB -latitude A =k AB *(x AB -longitude A ), the equation of the pipe segment CD is y CD -latitude C =k CD *(x CD -longitude C ), the equation of the pipe segment EF is y EF -latitudeE = k EF *(x EF - longitude E ). It can be known from the equations of pipeline segments AB, CD, and EF that these three pipeline segments overlap. Both station points C and D of pipeline segment CD fall within pipeline segment AB. At this time, taking station point A as the common endpoint, a virtual pipeline segment AC is added from point A to point C. If taking station point B as the common endpoint, a virtual pipeline segment DB is added between point D and point B; similarly, one station endpoint E of pipeline segment EF falls within pipeline segment AB, and a virtual pipeline segment AE is added from A to E; one station endpoint B of pipeline segment AB falls within pipeline segment EF. When calculating the overlapping pipeline segment with station point B as the common endpoint, a virtual pipeline segment BE is added from B to E. In practice, to avoid duplicate calculations, usually a direction is unified before adding virtual pipeline segments, such as uniformly virtualizing pipeline segments in the positive direction with the common endpoint as the origin, for example, virtualizing AC; or uniformly virtualizing pipeline segments in the negative direction with the common endpoint as the origin, for example, virtualizing BD or virtual BE. Through this standardized regulation, it is possible to prevent situations where pipeline segment CD is repeatedly calculated due to virtual pipeline segments AC and BD.
[0086] In this embodiment, by adding virtual pipeline segments, a common endpoint is determined for all overlapping pipeline segments on the same straight line, which can ensure that personalized offset values are assigned to each overlapping pipeline segment, enabling all overlapping pipeline segments to be clearly drawn as a non-crossing line segment on the map.
[0087] S203. Assign offset values to the pipeline segments associated with each station point in sequence according to the number of the associated overlapping pipeline segments.
[0088] Among them, assigning offset values to the pipeline segments associated with each station point in sequence means: first, assign values one by one to the overlapping pipeline segments associated with one of the station points starting from the initial value, and then assign values one by one to the overlapping pipeline segments associated with another station point also starting from the initial value.
[0089] In some embodiments, the specific implementation of step S203 may include:
[0090] Sort the station points in descending order according to the number of overlapping pipeline segments associated with each station point;
[0091] Calculate the length values of the overlapping pipeline segments at each station point in sequence according to the sorting result;
[0092] Assign offset values to each pipeline segment in sequence according to the length values of the overlapping pipeline segments.
[0093] Since there may be multiple overlapping pipe segments, it is necessary to reverse-sort the station points according to the number of overlapping pipe segments at this time. That is, first assign offset values to the pipe segments connected to the station points with a large number of overlapping pipe segments, and then assign values to the pipe segments connected to the station points with a small number of overlapping pipe segments. This is because a pipe segment has two endpoints that are respectively associated with two different station points, so there will be a situation where the same pipe segment is repeatedly calculated with two different station points as the common endpoints. For example, for the pipe segment AC, it can take station point A as the common endpoint or station point C as the common endpoint. When calculating with station point A as the common endpoint, there are two overlapping pipe segments AB and AC, but when calculating with station point C as the common endpoint, it will be found that there is only one pipe segment AC and no overlapping pipe segments. After sorting according to the number of overlapping pipe segments, the offset values will be preferentially assigned to the pipe segments AB and AC with station point A as the common endpoint. Suppose the offset of AB = 0 and the offset of AC = 0.2. When assigning the offset value to the pipe segment AC with station point C as the common endpoint, it is found that the pipe segment AC already has a value, and at this time, the pipe segment AC is no longer assigned a value and is ignored. If the overlapping pipe segments associated with each station point are not assigned values in order, it may occur that if the offset value of the pipe segment AC is assigned with station point C as the common endpoint, since there are no overlapping pipe segments, the offset of AC = 0, and then when the offset values of the pipe segments AB and AC are assigned with station point A as the common endpoint, it will be found that the pipe segment AC already has a value, then there will be two different offset value assignments for the pipe segment AC, or the offset of the pipe segment AC is equal to the offset of the pipe segment AB, and at this time, the purpose of distinguishing overlapping pipe segments cannot be achieved.
[0094] In some embodiments, the step of sequentially assigning offset values to each pipe segment according to the length value of the overlapping pipe segments may include:
[0095] Assign an offset value of 0 to the pipe segment with the smallest length value among the overlapping pipe segments at the station point;
[0096] According to the length values of the overlapping pipe segments at the station point, assign offset values to the pipe segments incrementally from 0 in ascending order of the length values;
[0097] For the offset values of several overlapping pipe segments with equal length values, assign positive and negative values with equal absolute values or directly assign values incrementally.
[0098] Specifically, as shown in the appendix Figure 5 When sequentially assigning offset values to the overlapping pipe segments connected with a certain station point as the common endpoint: First, sort the overlapping pipe segments in ascending order according to the pipe segment length value (when there are virtual pipe segments, the length of the virtual pipe segments needs to be calculated). Assign a small offset value to the pipe segment with a short distance and a large offset value to the pipe segment with a long distance. This sorting can reduce the intersection of the line segments of the pipe segments with a long distance and the pipe segments with a short distance when displayed. AsFigure 5 As shown: Taking the station point A as the common endpoint, there are four overlapping pipe segments AB1, AB2, AC, and AD. Among them, AB1 and AB2 indicate that there are two overlapping pipe segments with opposite length values between A and B. If AB is not the pipe segment with the smallest length value, that is, the offset assignments of AB1 and AB2 are not 0, then positive and negative values with equal absolute values of the offset are respectively assigned to AB1 and AB2. As shown in the attached figure, if AB is the pipe segment with the smallest length value, that is, at least one of the offset assignments of AB1 and AB2 is 0, then the offset assignments of AB1 and AB2 are incremented one by one, and the offset assignments of other pipe segments are also incremented one by one according to the length value. The results are as follows: Offset of AB1 = 0, Offset of AB2 = 0.2, Offset of AC = -0.2, Offset of AD = 0.4
[0099] Finally, the offset of the pipe segments without overlap is uniformly assigned 0, indicating that a straight line can be shown on the map.
[0100] S204, draw a line segment representing the pipe segment on the map according to the offset assignment of the pipe segment.
[0101] In some embodiments, when shown on the map, the overlapping pipe segments are shown in a zigzag manner according to the offset value, and the final display effect can be referred to the attached Figure 4 and the attached Figure 5 illustrations shown. Specifically, for the pipe segment with an offset assignment of 0, draw a straight line segment on the map to mark the pipe segment; for the pipe segment with an offset assignment not equal to 0, draw a broken line segment on the map with the offset assignment as the amplitude. The larger the offset, the greater the zigzag amplitude of the broken line segment.
[0102] It can be seen that in this embodiment, by obtaining the station point set data and pipeline segment set data on the map, the station point set data includes a set of longitude data and latitude data of each station point on the map, and the pipeline segment set data includes a set of association information between the two endpoints of each pipeline segment and the station points on the map; then, according to the station point set data and the pipeline segment set data, calculate the overlapping pipeline segments associated with each station point respectively, and count the number of overlapping pipeline segments associated with each station point; then, assign offset values to the pipeline segments associated with each station point in sequence according to the number of the associated overlapping pipeline segments; finally, draw a line segment representing the pipeline segment on the map according to the offset value assignment of the pipeline segment. In this way, the problem of calculating the offset values in the case of multiple overlapping pipeline segments at multiple station points and the problem of overlapping and crossing in map drawing can be solved. In addition, a method of assigning values to the overlapping pipeline segments connected by the station points in order according to the number of overlapping pipeline segments of the station points is proposed, which can solve the problem of repeated calculation and assignment of the overlapping pipeline segments; in addition, the method of assigning offset values in a gradually increasing manner according to the length values of the overlapping pipeline segments can minimize the situation where the overlapping pipeline segments cross and overlap and cannot be visually displayed during map drawing. To sum up, the map marking method for overlapping pipeline segments in this embodiment can not only improve the accuracy of calculating the offset values of the overlapping pipeline segments, but also greatly improve the map drawing effect, making the overlapping pipeline segment map more intuitively viewable by users.
[0103] Based on the same inventive concept, an embodiment of the present application also provides a map marking device for overlapping pipeline segments. As Figure 6 shown, it is a schematic structural diagram of a map marking device 600 for overlapping pipeline segments, which may include:
[0104] An acquisition module 601, configured to acquire the station point set data and pipeline segment set data on the map, where the station point set data includes a set of longitude data and latitude data of each station point on the map, and the pipeline segment set data includes a set of association information between the two endpoints of each pipeline segment and the station points on the map;
[0105] A calculation module 602, configured to calculate the overlapping pipeline segments associated with each station point respectively according to the station point set data and the pipeline segment set data, and count the number of overlapping pipeline segments associated with each station point;
[0106] An assignment module 603, configured to assign offset values to the pipeline segments associated with each station point in sequence according to the number of the associated overlapping pipeline segments;
[0107] A drawing module 604, configured to draw a line segment representing the pipeline segment on the map according to the offset value assignment of the pipeline segment.
[0108] In some possible embodiments, the map marking device for overlapping pipe segments according to the present application may at least include a processor and a memory. Among them, the memory stores program code, and when the program code is executed by the processor, the processor is caused to execute the steps in the map marking method for overlapping pipe segments according to various exemplary embodiments of the present application described in this specification. For example, the processor may execute the steps as shown in Figure 2 shown.
[0109] Based on the same inventive concept, an electronic device is further provided in an embodiment of the present application. The electronic device can implement the functions of the foregoing map marking method for overlapping pipe segments. Refer to Figure 7 , the electronic device includes:
[0110] At least one processor 701, and a memory 702 connected to at least one processor 701. In the embodiment of the present application, the specific connection medium between the processor 701 and the memory 702 is not limited. Figure 7 In Figure 7 it is taken as an example that the processor 701 and the memory 702 are connected through a bus 700. The bus 700 is represented by a thick line in Figure 7 . The connection manners between other components are only for illustrative purposes and are not to be construed as limiting. The bus 700 can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience of representation,
[0111] in Figure 6 it is only represented by a thick line, but it does not mean that there is only one bus or one type of bus. Alternatively, the processor 701 may also be referred to as a controller, and the name is not limited.
[0111] In the embodiment of the present application, the memory 702 stores instructions executable by at least one processor 701. By executing the instructions stored in the memory 702, at least one processor 701 can execute the map marking method for overlapping pipe segments described above. The processor 701 can implement Figure 6 the functions of each module in the device shown.
[0112] Among them, the processor 701 is the control center of the device, and can connect various parts of the entire control device through various interfaces and lines. By running or executing the instructions stored in the memory 702 and calling the data stored in the memory 702, various functions of the device and process data, so as to monitor the device as a whole.
[0113] In a possible design, the processor 701 may include one or more processing units. The processor 701 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 701 either. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be separately implemented on independent chips.
[0114] The processor 701 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit, a field programmable gate array, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the map marking method for overlapping pipe segments disclosed in combination with the embodiments of the present application can be directly embodied as being executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
[0115] As a non-volatile computer-readable storage medium, the memory 702 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The memory 702 may include at least one type of storage medium, for example, it may include flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (RAM), a static random access memory (SRAM), a programmable read-only memory (PROM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function, for storing program instructions and / or data.
[0116] By programming the design of the processor 701, the code corresponding to the map marking method for overlapping pipe segments introduced in the foregoing embodiments can be solidified into the chip, so that the chip can execute when running Figure 2Steps of the map marking method for overlapping pipe segments of the illustrated embodiments. How to design and program the processor 701 is a well-known technology to those skilled in the art and will not be elaborated here.
[0117] Based on the same inventive concept, an embodiment of the present application further provides a storage medium storing computer instructions, which when run on a computer, cause the computer to execute the map marking method for overlapping pipe segments discussed above.
[0118] In some possible implementation manners, various aspects of the map marking method for overlapping pipe segments provided by the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a device, the program code is used to cause the control device to execute the steps in the map marking method for overlapping pipe segments according to various exemplary embodiments of the present application described above in this specification.
[0119] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0120] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the functions specified in Figure 1 one or more flows or multiple flows and / or blocks Figure 1 one or more blocks or multiple blocks.
[0121] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in Figure 1 one or more flows or multiple flows and / or blocks Figure 1 one or more blocks or multiple blocks.
[0122] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, so that a series of operation steps are executed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions for implementing the process Figure 1 in one process or a plurality of processes and / or boxes Figure 1 steps for the functions specified in one box or a plurality of boxes.
[0123] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these modifications and variations.
Claims
1. A method for mapping overlapping pipe sections, characterized in that: include: Acquire station point set data and pipe section set data on the map, wherein the station point set data includes a set of longitude data and latitude data of each station point on the map, and the pipe section set data includes a set of association information between two endpoints of each pipe section on the map and the station point; Calculate the overlapping pipe sections associated with each station point according to the station point set data and the pipe section set data, and count the number of overlapping pipe sections associated with each station point; Assigning offset values to the pipe segments associated with each station point in turn according to the number of associated overlapping pipe segments; Based on the offset value assigned to the pipe segment, a line segment representing the pipe segment is drawn on the map.
2. The method according to claim 1, characterized in that: The step of calculating the overlapping pipe segments associated with each station point according to the station point set data and the pipe segment set data, and counting the number of overlapping pipe segments associated with each station point, includes: Take each station point as a common endpoint, and obtain the longitude and latitude data of the other end station point of all associated pipe sections of the common endpoint; Calculate the slope value of the pipe section relative to the common endpoint according to the longitude data and latitude data of the associated stations at both ends of the pipe section; If the slope values of different pipe segments relative to the common endpoint are equal, they are overlapping pipe segments; The number of overlapping pipe segments at each station point is calculated according to the slope values of the pipe segments relative to the common endpoint.
3. The method according to claim 1, characterized in that: The step of calculating the overlapping pipe segments associated with each station point according to the station point set data and the pipe segment set data, and counting the number of overlapping pipe segments associated with each station point, includes: Generate the straight line equation of the pipe section according to the longitude and latitude data of the associated station points at both ends of the pipe section; Calculating the overlapping pipe sections with each station point as a common endpoint according to the straight line equation of the pipe section; Calculate the number of overlapping pipe segments with each station point as a common endpoint.
4. The method according to claim 3, characterized in that: Before obtaining the overlapping pipe segments with each station point as a common endpoint by calculating the straight line equation of the pipe segment, the method further includes: All overlapping pipe segments are calculated according to the straight line equations of the pipe segments; In the case that there is no common endpoint between the overlapping pipe segments, two endpoints of the extending pipe segment are added as virtual pipe segments so that the overlapping pipe segments have at least one common endpoint.
5. The method according to claim 1, characterized in that: The step of assigning offset values to the pipe segments associated with each station point in turn according to the number of associated overlapping pipe segments includes: Sort the stations and fields in descending order according to the number of overlapping pipe sections associated with each station and field point; According to the sorting results, the length value of the overlapping pipe section at each station point is calculated in turn; An offset value is assigned to each pipe segment in turn according to the length value of the overlapping pipe segment.
6. The method according to claim 5, characterized in that The step of assigning an offset value to each pipe segment in turn according to the length value of the overlapping pipe segments includes: The offset of the pipe segment with the smallest length among the overlapping pipe segments at the station point is assigned a value of 0; According to the length values of the overlapping pipe sections at the station point, the offset values are assigned to the pipe sections in ascending order of length values starting from 0; For the offsets of the plurality of overlapping pipe segments with equal lengths, positive values and negative values with equal absolute values are assigned respectively, or the values are assigned directly by increasing value by value.
7. The method according to claim 1, characterized in that: The step of drawing a line segment representing the pipe segment on a map according to the offset value of the pipe segment includes: For the pipe segment with an offset value of 0, draw a straight line segment on the map to mark the pipe segment; For pipe segments with offset values other than 0, a polyline segment is drawn on the map with the offset value as the amplitude.
8. A map marking device for overlapping pipe sections, characterized in that: include: An acquisition module, used to acquire station point set data and pipe section set data on a map, wherein the station point set data includes a set of longitude data and latitude data of each station point on the map, and the pipe section set data includes a set of association information between two endpoints of each pipe section on the map and the station point; A calculation module, used for respectively calculating the overlapping pipe sections associated with each station point according to the station point set data and the pipe section set data, and counting the number of overlapping pipe sections associated with each station point; An assignment module, used for assigning offset values to the pipe sections associated with each station point in turn according to the number of the associated overlapping pipe sections; The drawing module is used to draw a line segment representing the pipe segment on the map according to the offset value of the pipe segment.
9. An electronic device, characterized in that: The device comprises a processor and a memory, wherein the memory stores program codes, and when the program codes are executed by the processor, the processor executes any one of the methods in claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The storage medium comprises a program code, and when the storage medium is run on an electronic device, the program code is used to enable the electronic device to execute any one of the methods described in claims 1 to 7.