Track geographical filtering method and system based on computational geometry

By obtaining the geographical coordinates of the track and target area based on the calculation geometry, selecting the corresponding relative position relationship judgment algorithm, and converting the track coordinates to the same local coordinate system, solving the problem of insufficient support for non-polygonal areas in the existing technology, achieving more fine filtering and higher accuracy.

CN120408039APending Publication Date: 2025-08-01BEIJING HUIQING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510578880.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-07
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

Existing track geographic filtration technologies have limited support for non-polygonal or complex shape areas, making it difficult to achieve fine relative position descriptions, and may lead to judgment errors in critical situations.

Method used

Using a method based on calculation geometry, by obtaining the geographical coordinates of the track and the target area, selecting the corresponding relative position relationship judgment algorithm, converting the track coordinates to the same local coordinate system, using the characteristics of shapes such as ellipses, rectangles, polyline segments and polygons to determine whether the track meets the filtering conditions, and performing fine filtering according to the filtering direction.

Benefits of technology

It improves the ability to support complex shape areas, achieves more refined relative position judgment, reduces errors caused by Earth's curvature, enhances the accuracy and robustness of the algorithm, and adapts to various geospatial filtering needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408039A_ABST
    Figure CN120408039A_ABST
Patent Text Reader

Abstract

The invention discloses a track geographic filtering method and system based on computational geometry. The method comprises the following steps: acquiring a geographic coordinate sequence of a track to be filtered; a geographic filter definition of the target area is obtained, and a geographic filter defines the shape, geographic coordinates, size parameters, the axial direction and the filtering direction of the target area; selecting a corresponding relative position relation judgment algorithm according to the shape of the target area; executing a relative position relation judgment algorithm; and based on a calculation result of the relative position relation judgment algorithm and a filtering direction defined by the geographic filter, judging whether the track meets a filtering condition or not, and filtering the track when the track meets the filtering condition. By utilizing the scheme of the invention, various complex geographic space filtering requirements are met, the filtering target is clear and definite by defining the filtering direction, and the controllability of the application is improved. And a special optimization algorithm can be used for a specific shape, so that the calculation process is more efficient, and the calculation result is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application generally relates to the technical field of track data processing. More specifically, this application relates to a track geographic filtering method and system based on computational geometry. Background Art

[0002] With the development of positioning technologies and mobile devices, track data has been widely used in fields such as traffic management, logistics monitoring, personal travel analysis, and public safety. Before analyzing and applying massive amounts of track data, it is often necessary to screen or filter according to specific geographic regions, which is track geographic filtering.

[0003] Track geographic filtering, as an important link in the track processing process, has multiple significances. First of all, it can achieve data screening, extracting track segments within a specific geographic region according to analysis requirements, such as analyzing the passenger flow trajectory within a certain business district or the ship trajectory within a certain waterway. Secondly, it helps with data optimization. By filtering out irrelevant data outside the target region, the amount of data for subsequent processing can be significantly reduced, improving the efficiency of data processing and analysis. Moreover, track geographic filtering also plays an important role in security and privacy protection. For example, it can filter out track data within sensitive regions such as military restricted areas and confidential units, protecting the security and privacy of location-sensitive information.

[0004] However, the existing track geographic filtering or similar point / region relationship judgment technologies have the following deficiencies: Firstly, many existing methods mainly target polygon regions. However, in practical applications, the shapes of target regions are diverse, and may include circular, elliptical, rectangular, annular regions (such as elliptical rings, rectangular rings), and open polyline segments, etc. The existing technologies have limited support for these non-polygon or complex-shaped regions. Secondly, existing technologies usually only support judging whether a point is "inside" or "outside" a region. However, in some scenarios, more refined relative position descriptions are required, such as judging whether a track is on the "northeast side" or "southwest side" of a certain road (polyline segment), or on a specific side of a region boundary. The existing methods have insufficient support for such direction-based filtering conditions. Thirdly, the point-in-polygon judgment algorithms (such as the ray method) in existing technologies may have problems when dealing with some critical situations. For example, when a track point exactly falls on the side of a polygon, or the ray emitted from the track point for judgment coincides with a side of the polygon, it may lead to incorrect judgment or inability to judge.

[0005] In view of this, there is an urgent need to provide a track geographic filtering solution based on computational geometry to break through the technical barriers of the existing technologies in terms of scalability, real-time performance, and anomaly handling reliability, and provide an efficient dynamic scheduling solution for personalized customized production scenarios. Summary of the Invention

[0006] To at least solve one or more of the above-mentioned technical problems, the present application proposes a track geographical filtering scheme based on computational geometry in multiple aspects.

[0007] In a first aspect, the present application provides a track geographical filtering method based on computational geometry, including: obtaining a sequence of geographical coordinates of a track to be filtered, where the geographical coordinates include longitude, latitude, and altitude; obtaining a geographical filter definition of a target area, where the geographical filter defines the shape, geographical coordinates, size parameters, axial direction, and filtering direction of the target area; selecting a corresponding relative position relationship judgment algorithm according to the shape of the target area; executing the relative position relationship judgment algorithm, where the algorithm includes converting the geographical coordinates of the track and the relevant geographical coordinates of the target area into the same coordinate system; and judging whether the track meets the filtering condition based on the calculation result of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, and filtering the track when the track meets the filtering condition.

[0008] In some embodiments, the shape of the target area at least includes one of an ellipse, an elliptical ring, a rectangle, a rectangular ring, a polyline, and a polygon, and the filtering direction is internal or external for an ellipse and a rectangle, and one of the northeast side, northwest side, southeast side, or southwest side for a polyline and a polygon.

[0009] In some embodiments, when the shape of the target area is an ellipse or an elliptical ring, the ellipse is determined by the center geographical coordinates, the semi-major axis length, the semi-minor axis length, and the axial direction, and the elliptical ring is defined by two concentric ellipses, an inner one and an outer one; in the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the ellipse or elliptical ring into the same coordinate system, the track geographical coordinates are converted into a northeast-up coordinate with the ellipse center as the origin, and then the northeast-up coordinate is rotationally converted according to the ellipse axial direction into a local Cartesian coordinate (x1, y1, z1) with the major axis of the ellipse as the X-axis and the minor axis as the Y-axis; when the shape of the target area is an ellipse, judging whether the track meets the filtering condition includes: judging whether (x1 / semi-major axis) 2 +(y1 / semi-minor axis) 2 <= 1; in response to (x1 / semi-major axis) 2 +(y1 / semi-minor axis) 2 <= 1, determining that the track is inside the ellipse, when the filtering direction is internal, the track meets the filtering condition, and when the filtering direction is external, the track does not meet the filtering condition; in response to not satisfying (x1 / semi-major axis) 2 +(y1 / semi-minor axis) 2<= 1, it is determined that the track is outside the ellipse. When the filtering direction is internal, the track does not meet the filtering condition. When the filtering direction is external, the track meets the filtering condition. When the shape of the target area is an elliptical ring, determining whether the track meets the filtering condition includes: determining whether the track simultaneously meets the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary. In response to the track simultaneously meeting the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary, when the filtering direction is internal, the track meets the filtering condition. When the filtering direction is external, the track does not meet the filtering condition. In response to the track not simultaneously meeting the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary, when the filtering direction is internal, the track does not meet the filtering condition. When the filtering direction is external, the track meets the filtering condition.

[0010] In some embodiments, when the shape of the target area is a rectangle or a rectangular ring, the shape of the target area is determined by the central geographical coordinates, the semi-major side length, the semi-minor side length, and the axial direction. The rectangular ring is defined by two concentric rectangles, an inner one and an outer one. During the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the rectangle or rectangular ring to the same coordinate system, the geographical coordinates of the track are converted into a northeast celestial coordinate with the center of the rectangle as the origin, and then this northeast celestial coordinate is rotationally converted according to the rectangular axial direction into a local Cartesian coordinate (x2, y2, z2) with the long side direction of the rectangle as the X-axis and the short side direction as the Y-axis. When the shape of the target area is a rectangle, determining whether the track meets the filtering condition includes: determining whether |x2| <= the semi-major side length and |y2| <= the semi-minor side length are satisfied. In response to |x2| <= the semi-major side length and |y2| <= the semi-minor side length being satisfied, it is determined that the track is inside the rectangle. When the filtering direction is internal, the track meets the filtering condition. When the filtering direction is external, the track does not meet the filtering condition. In response to |x2| <= the semi-major side length and |y2| <= the semi-minor side length being satisfied, it is determined that the track is outside the rectangle. When the filtering direction is internal, the track does not meet the filtering condition. When the filtering direction is external, the track meets the filtering condition. When the shape of the target area is a rectangular ring, determining whether the track meets the filtering condition includes: determining whether the track simultaneously meets the conditions of being inside the outer rectangle and outside the inner rectangle. In response to simultaneously meeting the conditions of being inside the outer rectangle and outside the inner rectangle, when the filtering direction is internal, the track meets the filtering condition. When the filtering direction is external, the track does not meet the filtering condition. In response to not simultaneously meeting the conditions of being inside the outer rectangle and outside the inner rectangle, when the filtering direction is internal, the track does not meet the filtering condition. When the filtering direction is external, the track meets the filtering condition.

[0011] In some embodiments, when the shape of the target area is a broken line segment, the shape of the broken line segment is determined by the geographical coordinates of a set of multiple ordered endpoints; in the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the broken line segment into the same coordinate system, the geographical coordinate set of the track geographical coordinates and all endpoints of the broken line segment is converted into a northeast celestial coordinate with the first endpoint of the broken line segment as the origin; in the process of judging whether the track meets the filtering condition, the following steps are executed: calculate the vector product of the head segment vector and the tail segment vector of the broken line segment on the horizontal plane to judge the included angle range, and distinguish whether the relationship between the head and tail segments is acute / obtuse, reverse obtuse or perpendicular; construct a ray starting from the track, perpendicular to the head segment and pointing to the filtering direction; calculate the number of intersection points of the ray and each segment of the broken line segment, and make a count adjustment according to the intersection point type; according to the relationship between the head and tail segments and / or the number of intersection points, judge whether the track is on one side of the filtering direction, and when the track is on one side of the filtering direction, determine that the track meets the filtering condition.

[0012] In some embodiments, in the process of judging whether the track is on one side of the filtering direction according to the relationship between the head and tail segments and / or the number of intersection points, the following steps are executed: when the relationship between the head and tail segments is acute / obtuse, execute the first judgment rule, where the first judgment rule is: judge whether the corresponding number of intersection points is odd or even; in response to the corresponding number of intersection points being odd, determine that the track is not on one side of the filtering direction; in response to the corresponding number of intersection points being even, determine that the track is on one side of the filtering direction; when the relationship between the head and tail segments is reverse obtuse, execute the second judgment rule, where the second judgment rule is: judge whether the corresponding number of intersection points is odd or even; in response to the corresponding number of intersection points being odd, determine that the track is on one side of the filtering direction; in response to the corresponding number of intersection points being even, determine that the track is not on one side of the filtering direction.

[0013] In some embodiments, in the process of judging whether the track is on one side of the filtering direction according to the relationship between the head and tail segments and / or the number of intersection points, the following steps are also executed: when the relationship between the head and tail segments is perpendicular, divide the target area into a specific area and other areas, where the specific area is the vector extension line and the vector between, N is the number of all endpoints of the broken line segment, P N-2 is the penultimate third endpoint in the broken line segment, P N-1 is the penultimate second endpoint in the broken line segment, P Nis the penultimate endpoint in the polyline; in a specific region, respectively determine whether the filtering direction is on the left / right side of the first segment and whether the track is on the left / right side of the last segment; in response to the filtering direction being on the left side of the first segment and the track being on the left side of the last segment or the filtering direction being on the right side of the first segment and the track being on the right side of the last segment, determine that the track is on one side of the filtering direction; in response to the filtering direction being on the left side of the first segment and the track being on the right side of the last segment or the filtering direction being on the right side of the first segment and the track being on the left side of the last segment, determine that the track is not on one side of the filtering direction; in other regions, calculate the vector product of the first segment vector of the polyline and the vector on the horizontal plane to judge the included angle range, and distinguish whether the first segment vector of the polyline and the vector is an acute angle / obtuse angle or a reverse obtuse angle, and execute the first judgment rule or the second judgment rule accordingly.

[0014] In some embodiments, when the shape of the target region is a polygon, the shape of the polygon is determined by the geographical coordinates of multiple ordered endpoints; in the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the polygon to the same coordinate system, the geographical coordinates of the track and the set of geographical coordinates of all endpoints of the polygon are converted to the northeast celestial coordinates with the first endpoint of the polygon as the origin; in the process of judging whether the track meets the filtering conditions, the following steps are executed: judge whether the polygon vertices are arranged in a clockwise or counterclockwise order according to the line integral of the sides of the polygon; judge whether the filtering direction is on the left or right side of the first segment according to the vector heading angle of the first segment of the polygon and the filtering direction; determine whether the target region corresponds to the inside or outside of the polygon according to the clockwise / counterclockwise arrangement result of the polygon vertices and the left / right side result of the filtering direction on the first segment; construct a ray starting from the track and horizontally eastward; calculate the number of intersection points of the ray and all sides of the polygon, and make a counting adjustment according to the intersection point type; judge whether the track is inside or outside the polygon according to the parity of the number of intersection points; when the inside / outside state of the target region corresponds to the inside / outside state of the polygon and the track is inside / outside the polygon, determine that the track meets the filtering conditions; when the inside / outside state of the target region corresponds to the inside / outside state of the polygon and the track is not inside / outside the polygon, determine that the track does not meet the filtering conditions.

[0015] In some embodiments, in the process of making a counting adjustment according to the intersection point type, when the target region is a polyline, the following steps are executed: judge whether the intersection point is on the polyline or on the extension line of the first segment and the last segment of the polyline; in response to the intersection point being on the polyline or on the extension line of the first segment and the last segment of the polyline, judge whether the intersection point is an endpoint; in response to the intersection point not being an endpoint, when the vector is in the same direction as the vector , increase the number of intersection points by 1, where P foot is the foot of the perpendicular of the track on the line where the first segment is located, PTarget is a track, P intsect intersection point; in response to the intersection point being an endpoint, in the vector and the vector being in the same direction, determine whether the other two endpoints of the two line segments connected to this endpoint are on the same side of the ray; in response to the other two endpoints of the two line segments connected to this endpoint being on the same side of the ray, increase the number of intersection points by 2; in response to the other two endpoints of the two line segments connected to this endpoint not being on the same side of the ray, increase the number of intersection points by 1; in response to the intersection point not being on the polyline or on the extension lines of the first and last line segments of the polyline, do not perform any action; when the target area is a polygon, perform the following steps: determine whether the intersection point is on the line segment of the polygon; in response to the intersection point not being on the line segment of the polygon, do not perform any action; in response to the intersection point being on the line segment of the polygon, determine whether the intersection point is an endpoint of the polygon; in response to the intersection point not being an endpoint of the polygon, increase the number of intersection points by 1; in response to the intersection point being an endpoint of the polygon, determine whether the other two endpoints of the two line segments connected to this endpoint are on the same side of the ray; in response to the other two endpoints of the two line segments connected to this endpoint being on the same side of the ray, increase the number of intersection points by 2; in response to the other two endpoints of the two line segments connected to this endpoint not being on the same side of the ray, increase the number of intersection points by 1.

[0016] In a second aspect, the present application provides a set of track geographical filtering systems based on computational geometry, which perform track geographical filtering based on computational geometry by using the track geographical filtering method based on computational geometry described in any embodiment of the first aspect. The system includes: an acquisition module, configured to acquire the geographical coordinate sequence of the track to be filtered and the geographical filter definition of the target area, where the geographical coordinates include longitude, latitude, and altitude, and the geographical filter defines the shape, geographical coordinates, size parameters, axial direction, and filtering direction of the target area; a selection module, configured to select a corresponding relative position relationship judgment algorithm according to the shape of the target area; an execution module, configured to execute the relative position relationship judgment algorithm, where the algorithm includes converting the geographical coordinates of the track and the relevant geographical coordinates of the target area into the same coordinate system; a filtering module, configured to determine whether the track meets the filtering conditions based on the calculation result of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, and filter the track when the track meets the filtering conditions.

[0017] Through the trajectory geographical filtering solution based on computational geometry provided above, embodiments of the present application provide a necessary data basis for subsequent filtering operations by obtaining the geographical coordinate sequence of the trajectory to be filtered, and ensuring that the geographical coordinates include longitude, latitude, and altitude, enabling filtering to be performed in a three-dimensional space, which is crucial for application scenarios that require considering altitude, such as air traffic control and UAV obstacle avoidance, improving the accuracy and practicality of filtering. By obtaining the geographical filter definition of the target area, the geographical filter defines the shape, geographical coordinates, size parameters, axis, and filtering direction of the target area, allowing users to customize the shape, position, size, and orientation of the area, adapting to various complex geographical space filtering requirements. By defining the filtering direction, the filtering target is clear and definite, increasing the controllability of the application. By selecting the corresponding relative position relationship judgment algorithm according to the shape of the target area, a specially optimized algorithm can be used for a specific shape, making the calculation process more efficient and the calculation results more accurate. By converting the geographical coordinates of the trajectory and the relevant geographical coordinates of the target area to the same local coordinate system, the error caused by the earth's curvature can be significantly reduced. By judging whether the trajectory meets the filtering conditions based on the calculation results of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, and filtering it when the trajectory meets the filtering conditions, the calculation results are transformed into actual filtering actions, achieving the ultimate goal of the entire process.

[0018] Further, in some embodiments, by setting that the target area shape includes at least one of an ellipse, an elliptical ring, a rectangle, a rectangular ring, a polyline, and a polygon, and the filtering direction is internal or external for an ellipse and a rectangle, and one of the northeast side, northwest side, southeast side, or southwest side for a polyline and a polygon, this makes the target area no longer limited to polygons, clearly increasing the support for ellipses, elliptical rings, rectangles, and rectangular rings, so that the filter can define more diverse and more practical geographical areas. Introducing the judgment of the northeast side, northwest side, southeast side, or southwest side for polylines and polygons makes the filtering rules more refined and directional, providing a richer information dimension and control ability than simple internal and external judgments.

[0019] Furthermore, in some embodiments, when the shape of the target area is an ellipse or an elliptical ring, the geographical coordinates of the track points and the geographical coordinates of the ellipse are converted into the same locally two-dimensional Cartesian coordinate system centered on the ellipse and axially aligned, reducing the complex geographical space position judgment problem to a simple two-dimensional plane geometry problem, improving the calculation efficiency and the simplicity of the algorithm. And a mathematical criterion for judging whether the converted track point coordinates are inside (or on the boundary) of the ellipse is defined, a composite logic for judging whether the track point is located inside the elliptical ring is defined, and whether the track meets the filtering condition is determined according to the judgment result and the filtering direction (inside / outside) specified by the user, ensuring the accuracy, flexibility, and calculation feasibility when filtering the track for the target area.

[0020] Still further, in some embodiments, when the shape of the target area is a polyline, during the process of judging whether the track meets the filtering condition, by calculating the dot product of the head and tail line segment vectors to judge the included angle relationship, the relative directions of the line segments at the starting point and the ending point of the polyline can be analyzed. By constructing a ray perpendicular to the first segment and pointing to the filtering direction, the direction of the ray is directly related to the filtering direction, and its intersection with the polyline can be used to infer on which side of the polyline the point is located. By calculating the intersection points of the ray and each line segment and adjusting the count, situations such as the ray exactly passing through the endpoint and coinciding with the line segment are considered, avoiding misjudgments caused thereby, and significantly improving the robustness and accuracy of the algorithm. By judging whether the track is on one side of the filtering direction according to the relationship between the head and tail line segments and / or the number of intersection points, an accurate azimuth judgment of the track point relative to the polyline is realized, meeting the finer filtering requirements than simple inside / outside.

[0021] Even still further, in some embodiments, when the shape of the target area is a polygon, during the process of judging whether the track meets the filtering condition, by judging whether the vertices of the polygon are arranged in a clockwise or counterclockwise order, its inherent directionality can be automatically recognized, providing a guarantee of consistency for subsequent judgments and increasing the robustness of the method. By judging the relative position of the filtering direction and determining the inside and outside corresponding to the target area, the azimuth direction (such as the northeast side, etc.) that the user may initially define is finally mapped to the inside or outside of the corresponding polygon, solving the problem that the user may use azimuth descriptions while geometric judgments are usually based on inside and outside, and establishing a clear mapping relationship. By constructing a horizontally eastward ray, calculating the number of intersection points of the ray and all sides of the polygon, and adjusting the count according to the intersection point type, the special situation where the track ray coincides with the polygon line segment is considered. Through specific counting rules, it is ensured that correct results can be obtained even when the ray is along or partially coincides with the polygon edge, greatly improving the robustness of the algorithm. And the special situation where the intersection point passes through the intersection point of two line segments forming the polygon is considered. By adjusting the count, the counting error caused by passing through the vertex is avoided, further enhancing the accuracy and robustness of the algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The above and other objects, features and advantages of the exemplary embodiments of the present application will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0023] Figure 1 An exemplary flow chart of a track geographic filtering method based on computational geometry according to an embodiment of the present application is shown;

[0024] Figure 2 A schematic diagram of the conversion of the X-axis and Y-axis coordinates of the track when the shape of the target area is an ellipse or an elliptical ring according to an embodiment of the present application is shown.

[0025] Figure 3 A schematic diagram showing the conversion of track X-axis and Y-axis coordinates when the target area is a rectangle or a rectangular ring in an embodiment of the present application is shown;

[0026] Figure 4 An exemplary flow chart of an embodiment of the present application for determining whether a track satisfies a filtering condition when the target area is elliptical in shape is shown;

[0027] Figure 5 An exemplary flow chart of an embodiment of the present application for determining whether a track satisfies a filtering condition when the target area is in the shape of an elliptical ring is shown;

[0028] Figure 6 An exemplary flow chart of an embodiment of the present application for determining whether a track satisfies a filtering condition when the target area is rectangular is shown;

[0029] Figure 7 An exemplary flow chart of an embodiment of the present application for determining whether a track satisfies a filtering condition when the target area is in the shape of a rectangular ring is shown;

[0030] Figure 8 An exemplary flow chart of an embodiment of the present application for determining whether a track satisfies a filtering condition when the target area is in the shape of a broken line segment is shown;

[0031] Figure 9 A schematic diagram illustrating an embodiment of the present application for determining whether a track is in a filtering direction of a broken line segment when the target area is in the shape of a broken line segment and the relationship between the first and last line segments is an acute angle / obtuse angle;

[0032] Figure 10 A schematic diagram illustrating an embodiment of the present application for determining whether a track is in a filtering direction when the target area is in the shape of a broken line segment and the relationship between the first and last line segments is an inverse obtuse angle;

[0033] Figure 11(a) - Figure 11(b)Shows a schematic diagram of determining whether a track is in the filtering direction when the shape of the target area is a broken line in an embodiment of the present application;

[0034] Figure 12(a) - Figure 12(d) Shows a schematic diagram of determining whether the filtering direction is on the left or right side of the first-segment vector according to the filtering direction and the heading angle of the first-segment vector of the polygon in an embodiment of the present application;

[0035] Figure 13(a) - Figure 13(b) Shows a schematic diagram of determining whether the target area corresponds to the inside or outside of the polygon according to the clockwise / counterclockwise arrangement of the polygon vertices and whether the filtering direction is on the left / right side of the first segment in an embodiment of the present application;

[0036] Figure 14 Shows a schematic diagram of determining whether a track is in the filtering direction when the shape of the target area is a polygon in an embodiment of the present application;

[0037] Figure 15 Shows an exemplary structural block diagram of a track geographical filtering system based on computational geometry in an embodiment of the present application. Detailed implementation manners

[0038] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.

[0039] It should be understood that the terms "including" and "comprising" used in the specification and claims of the present application indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their combinations.

[0040] It should also be understood that the terms used in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification and claims of the present application, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include the plural forms. It should also be further understood that the term " / and / " used in the specification and claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0041] Figure 1 Shows an exemplary flowchart of a track geographical filtering method 100 based on computational geometry in an embodiment of the present application.

[0042] AsFigure 1 As shown, in step S110, a geographical coordinate sequence of the track to be filtered is obtained, where the geographical coordinates include longitude, latitude, and altitude.

[0043] After step S110 is executed, in step S120, a geographical filter definition of the target area is obtained, where the geographical filter defines the shape, geographical coordinates, size parameters, axis, and filtering direction of the target area.

[0044] In an embodiment of the present application, the elements corresponding to the geographical filter definition of the target area are shown in Table 1:

[0045] Table 1 Elements Table Corresponding to Geographical Filter Definition

[0046]

[0047]

[0048]

[0049] According to Table 1, the target area shapes include ellipse, elliptical ring, rectangle, rectangular ring, polyline, and polygon. The filtering direction is internal or external for ellipse and rectangle, and northeast, northwest, southeast, or southwest for polyline and polygon.

[0050] After step S120 is executed, in step S130, a corresponding relative position relationship judgment algorithm is selected according to the shape of the target area.

[0051] After step S130 is executed, in step S140, the relative position relationship judgment algorithm is executed, where the algorithm includes converting the geographical coordinates of the track and the relevant geographical coordinates of the target area to the same local coordinate system.

[0052] In an embodiment of the present application, when the target area shape is an ellipse or an elliptical ring, the ellipse is determined by the center geographical coordinates, semi-major axis length, semi-minor axis length, and axis, and the elliptical ring is defined by two concentric ellipses inside and outside.

[0053] During the execution of the relative position relationship judgment algorithm for the ellipse or elliptical ring, the geographical coordinates of the track and the relevant geographical coordinates of the ellipse or elliptical ring are converted to the same local coordinate system. Specifically, the geographical coordinates of the track are converted to the northeast celestial coordinates with the ellipse center as the origin, and then the northeast celestial coordinates are rotated according to the ellipse axis to be converted to the local Cartesian coordinates (x1, y1, z1) with the major axis of the ellipse as the X axis and the minor axis as the Y axis.

[0054] In some embodiments of the present application, the northeast celestial coordinates of the track are represented by (East Target , North Target,Up Target ) indicates that in the process of converting the northeast celestial coordinates of the track into Cartesian coordinates with the center of the ellipse as the origin of the coordinate system, the major axis of the ellipse as the X-axis, and the minor axis of the ellipse as the Y-axis, the Cartesian coordinates of the track are represented by (x1, y1, z1). The Z-axis coordinate of the track is the same as the northeast celestial coordinate, that is, z1 = Up Target . The conversion methods of the X-axis and Y-axis coordinates can be specifically referred to Figure 2 .

[0055] Figure 2 Fig. shows the schematic diagram of the conversion of the X-axis and Y-axis coordinates of the track when the shape of the target area is an ellipse or an elliptical ring in the embodiment of the present application

[0056] As Figure 2 shown, first, the course angle β of the connection line between the center and the track and the distance Dist between the center and the track are calculated respectively according to the northeast celestial coordinates of the track Centre-Target . Then, the included angle γ between the connection line between the center and the track and the major axis of the ellipse is calculated according to the axial α and the course angle β, that is, γ = α - β. Finally, the X and Y axis coordinates are calculated according to the distance Dist Centre-Target between the center and the track and the included angle γ, which are x1 = Dist Centre-Target ·cosγ and y2 = Dist Centre-Target ·sinγ respectively

[0057] In the embodiment of the present application, when the shape of the target area is a rectangle or a rectangular ring, the shape of the target area is determined by the central geographical coordinates, the semi-major side length, the semi-minor side length, and the axial direction. The rectangular ring is defined by two concentric rectangles, an inner one and an outer one

[0058] In the process of executing the relative position relationship judgment algorithm for the rectangle or the rectangular ring, the geographical coordinates of the track and the relevant geographical coordinates of the rectangle or the rectangular ring are converted into the same local coordinate system. Specifically, the geographical coordinates of the track are converted into the northeast celestial coordinates with the center of the rectangle as the origin, and then the northeast celestial coordinates are rotationally converted according to the rectangle axial direction into the local Cartesian coordinates (x2, y2, z2) with the long side direction of the rectangle as the X-axis and the short side direction as the Y-axis

[0059] In some embodiments of the present application, the northeast celestial coordinates of the track are represented by (East Target , North Target , Up Target ). In the process of rotationally converting the northeast celestial coordinates of the track according to the rectangle axial direction into the local Cartesian coordinates with the long side direction of the rectangle as the X-axis and the short side direction as the Y-axis, the Cartesian coordinates of the track are represented by (x2, y2, z2). The Z-axis coordinate of the track is the same as the northeast celestial coordinate, that is, z2 = Up Target . The conversion methods of the X-axis and Y-axis coordinates can be specifically referred to Figure 3 .

[0060] Figure 3 Shows a schematic diagram of the conversion of the track X-axis and Y-axis coordinates when the shape of the target area is a rectangle or a rectangular ring in the embodiments of the present application.

[0061] As Figure 3 shown, first calculate the course angle β of the connection line between the rectangle center and the track and the distance Dist between the rectangle center and the track respectively according to the northeast celestial coordinates of the track Centre-Target . Then calculate the included angle γ between the connection line between the rectangle center and the track and the long side of the rectangle according to the axial α and the course angle β, that is, γ = α - β. Finally, calculate the X and Y axis coordinates according to the distance Dist Centre-Target between the rectangle center and the track and the included angle γ, which are x2 = Dist Centre-Target ·cosγ and y2 = Dist Centre-Target ·sinγ.

[0062] In the embodiments of the present application, when the shape of the target area is a broken line, the shape of the broken line is determined by the geographical coordinates of a set of multiple ordered endpoints.

[0063] During the execution of the relative position relationship judgment algorithm for the broken line, convert the track geographical coordinates and the set of geographical coordinates of all endpoints of the broken line into the northeast celestial coordinates with the first endpoint of the broken line as the origin.

[0064] In the embodiments of the present application, when the shape of the target area is a polygon, the shape of the polygon is determined by the geographical coordinates of a set of multiple ordered endpoints.

[0065] During the execution of the relative position relationship judgment algorithm for the polygon, convert the track geographical coordinates and the set of geographical coordinates of all endpoints of the polygon into the northeast celestial coordinates with the first endpoint of the polygon as the origin.

[0066] After step S140 is executed, in step S150, based on the calculation result of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, determine whether the track meets the filtering conditions, and filter the track when it meets the filtering conditions.

[0067] In the embodiments of the present application, when the shape of the target area is an ellipse, the specific process of determining whether the track meets the filtering conditions can refer to Figure 4 .

[0068] Figure 4 Shows an exemplary flowchart of determining whether a track meets the filtering conditions when the shape of the target area is an ellipse in the embodiments of the present application.

[0069] As Figure 4 shown, in step S410, determine whether it satisfies (x1 / semi-major axis) 2 +(y1 / semi-minor axis)2 <= 1. In response to satisfying (x1 / semi-major axis) 2 + (y1 / semi-minor axis) 2 <= 1, in step S420, it is determined that the track is inside the ellipse. Then, in step S430, it is judged whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S440, it is determined that the track meets the filtering condition. In response to the filtering direction being external, in step S450, it is determined that the track does not meet the filtering condition. In response to not satisfying (x1 / semi-major axis) 2 + (y1 / semi-minor axis) 2 <= 1, in step S460, it is determined that the track is outside the ellipse. Then, in step S470, it is judged whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S480, it is determined that the track does not meet the filtering condition. In response to the filtering direction being external, in step S480, it is determined that the track meets the filtering condition.

[0070] Through the above process, when the filtering direction is internal, only the tracks inside the ellipse meet the conditions. When the filtering direction is external, only the tracks outside the ellipse meet the conditions.

[0071] In an embodiment of the present application, when the shape of the target area is an elliptical ring, the specific process of judging whether a track meets the filtering condition can be referred to Figure 5 .

[0072] Figure 5 Fig. shows an exemplary flowchart for judging whether a track meets the filtering condition when the shape of the target area is an elliptical ring in an embodiment of the present application.

[0073] As Figure 5 shown, in step S510, it is judged whether the track simultaneously meets the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary. In response to the track simultaneously meeting the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary, in step S520, it is judged whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S530, it is determined that the track meets the filtering condition. In response to the filtering direction being external, in step S540, it is determined that the track does not meet the filtering condition. In response to the track not simultaneously meeting the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary, in step S550, it is judged whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S560, it is determined that the track does not meet the filtering condition. In response to the filtering direction being external, in step S570, it is determined that the track meets the filtering condition.

[0074] Through the above process, when the track is simultaneously inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner boundary of the inner ellipse, the track is inside the elliptical ring. When the track does not simultaneously meet the conditions of being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner boundary of the inner ellipse, the track is inside the inner ellipse or outside the outer ellipse, that is, the track is outside the elliptical ring. When the filtering direction is internal, only the tracks inside the elliptical ring meet the conditions. When the filtering direction is external, only the tracks outside the elliptical ring meet the conditions.

[0075] In the embodiments of the present application, when the shape of the target area is rectangular, the specific process of determining whether a track meets the filtering conditions can be referred to Figure 6 .

[0076] Figure 6 shows an exemplary flowchart for determining whether a track meets the filtering conditions when the shape of the target area is rectangular in the embodiments of the present application.

[0077] As Figure 6 shown, in step S610, it is determined whether |x2| <= the length of the semi-major side and |y2| <= the length of the semi-minor side are satisfied. In response to |x2| <= the length of the semi-major side and |y2| <= the length of the semi-minor side being satisfied, in step S620, it is determined that the track is inside the rectangle. Then, in step S630, it is determined whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S640, it is determined that the track meets the filtering conditions. In response to the filtering direction being external, in step S650, it is determined that the track does not meet the filtering conditions. In response to |x2| <= the length of the semi-major side and |y2| <= the length of the semi-minor side being satisfied, in step S660, it is determined that the track is outside the rectangle. Then, in step S670, it is determined that the track is inside the rectangle. In response to the filtering direction being internal, in step S680, it is determined that the track does not meet the filtering conditions. In response to the filtering direction being external, in step S690, it is determined that the track meets the filtering conditions.

[0078] Through the above process, when the filtering direction is internal, only the tracks inside the rectangle meet the conditions. When the filtering direction is external, only the tracks outside the rectangle meet the conditions.

[0079] In the embodiments of the present application, when the shape of the target area is a rectangular ring, the specific process of determining whether a track meets the filtering conditions can be referred to Figure 7 .

[0080] Figure 7 shows an exemplary flowchart for determining whether a track meets the filtering conditions when the shape of the target area is a rectangular ring in the embodiments of the present application.

[0081] As Figure 7As shown, in step S710, it is determined whether the track simultaneously satisfies being inside the outer rectangle and outside the inner rectangle. In response to simultaneously satisfying being inside the outer rectangle and outside the inner rectangle, in step S720, it is determined whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S730, it is determined that the track satisfies the filtering condition. In response to the filtering direction being external, in step S740, it is determined that the track does not satisfy the filtering condition. In response to not simultaneously satisfying being inside the outer rectangle and outside the inner rectangle, in step S750, it is determined whether the filtering direction is internal or external. In response to the filtering direction being internal, in step S760, it is determined that the track does not satisfy the filtering condition. In response to the filtering direction being external, in step S770, it is determined that the track satisfies the filtering condition.

[0082] Through the above process, when the track simultaneously satisfies being inside the outer rectangle and outside the inner rectangle, the track is inside the rectangular ring. When the track does not simultaneously satisfy being inside the outer rectangle and outside the inner rectangle, the track is outside the rectangular ring. When the filtering direction is internal, only the tracks inside the rectangular ring satisfy the conditions. When the filtering direction is external, only the tracks outside the rectangular ring satisfy the conditions.

[0083] In an embodiment of the present application, when the shape of the target area is a broken line, the specific process of determining whether the track satisfies the filtering condition can refer to Figure 8 .

[0084] Figure 8 The exemplary flowchart showing whether the track satisfies the filtering condition when the shape of the target area is a broken line in the embodiment of the present application is shown.

[0085] As Figure 8 shown, in step S810, the vector product of the head segment vector and the tail segment vector of the broken line on the horizontal plane is calculated to determine the angle range, and the relationship between the head and tail segments is distinguished as acute / obtuse, reverse obtuse, or perpendicular. In step S820, a ray is constructed starting from the track, perpendicular to the head segment and pointing to the filtering direction. In step S830, the number of intersection points of the ray and each segment of the broken line is calculated, and the count is adjusted according to the intersection point type. In step S840, according to the relationship between the head and tail segments and / or the number of intersection points, it is determined whether the track is on one side of the filtering direction, and when the track is on one side of the filtering direction, it is determined that the track satisfies the filtering condition.

[0086] In an embodiment of the present application, when the vector product of the head segment vector and the tail segment vector of the broken line on the horizontal plane is greater than 0, it indicates that the included angle between the head and tail segment vectors is or the relationship between the head and tail segments is acute / obtuse. When the vector product of the head segment vector and the tail segment vector of the broken line on the horizontal plane is less than 0, it indicates that the included angle between the head and tail segment vectors is The relationship between the head and tail line segments is an obtuse angle in the reverse direction. When the dot product of the vector of the head line segment and the vector of the tail line segment of the broken line segment on the horizontal plane is equal to 0, it indicates that the head and tail line segment vectors are perpendicular.

[0087] In an embodiment of the present application, when the target area is a broken line segment, during the process of counting adjustment according to the intersection type, first, it is determined whether the intersection point is on the broken line segment or on the extension lines of the head and tail line segments of the broken line segment. In response to the intersection point being on the broken line segment or on the extension lines of the head and tail line segments of the broken line segment, it is determined whether the intersection point is an end point. In response to the intersection point not being an end point, when the vector is in the same direction as the vector , the number of intersection points is increased by 1, where P foot is the foot of the perpendicular of the track on the straight line where the head line segment is located, P Target is the track, and P intsect is the intersection point. In response to the intersection point being an end point, when the vector is in the same direction as the vector , it is determined whether the other two end points of the two line segments connected to this end point are on the same side of the ray. In response to the other two end points of the two line segments connected to this end point being on the same side of the ray, the number of intersection points is increased by 2. In response to the other two end points of the two line segments connected to this end point not being on the same side of the ray, the number of intersection points is increased by 1. In response to the intersection point not being on the broken line segment or on the extension lines of the head and tail line segments of the broken line segment, no action is taken.

[0088] In an embodiment of the present application, when the relationship between the head and tail line segments is an acute / obtuse angle, the first judgment rule is executed in step S840. Specifically, during the execution of the first judgment rule, first, it is determined whether the corresponding number of intersection points is odd or even. In response to the corresponding number of intersection points being odd, it is determined that the track is not on the side of the filtering direction. In response to the corresponding number of intersection points being even, it is determined that the track is on the side of the filtering direction.

[0089] In an embodiment of the present application, when the relationship between the head and tail line segments is an acute / obtuse angle, the schematic diagram involved in executing steps S820 - S840 can be referred to Figure 9 . In Figure 9 , when the filtering direction is the northeast side, the numbers of intersection points of tracks 1 - 7 are 3, 2, 2, 2, 2, 0, 3 respectively. Therefore, tracks 1 and 7 are not on the northeast side of this broken line segment, and the other tracks are on the northeast side of this broken line segment.

[0090] In an embodiment of the present application, when the relationship between the head and tail line segments is an obtuse angle in the reverse direction, the second judgment rule is executed in step S840. During the execution of the second judgment rule, first, it is determined whether the corresponding number of intersection points is odd or even. In response to the corresponding number of intersection points being odd, it is determined that the track is on the side of the filtering direction. In response to the corresponding number of intersection points being even, it is determined that the track is not on the side of the filtering direction.

[0091] In an embodiment of the present application, when the relationship between the head and tail line segments is a reverse obtuse angle, the schematic diagrams involved in executing steps S820 - S840 can be referred to Figure 10 . In Figure 10 , when the filtering direction is the northeast side, the number of intersection points of tracks 1 - 7 are 2, 1, 1, 1, 1, 1, 2 respectively. Therefore, tracks 1 and 7 are not on the northeast side of this polyline segment, and the other tracks are on the northeast side of this polyline segment.

[0092] In an embodiment of the present application, when the relationship between the head and tail line segments is perpendicular, the target area is divided into a specific area and other areas. Among them, the specific area is the area between the extension line of the vector and the vector . N is the number of all endpoints of the polyline segment, P N-2 is the third - last endpoint of the polyline segment, P N-1 is the second - last endpoint of the polyline segment, and P N is the last endpoint of the polyline segment. For example, referring to FIGS. 11(a) and 11(b), in FIGS. 11(a) and 11(b), the specific area is the area between the extension line of the vector and the vector .

[0093] In an embodiment of the present application, in the specific area, first, it is respectively determined whether the filtering direction is on the left / right side of the head line segment and whether the track is on the left / right side of the tail line segment. In response to the filtering direction being on the left side of the head line segment and the track being on the left side of the tail line segment, or the filtering direction being on the right side of the head line segment and the track being on the right side of the tail line segment, it is determined that the track is on one side of the filtering direction. In response to the filtering direction being on the left side of the head line segment and the track being on the right side of the tail line segment, or the filtering direction being on the right side of the head line segment and the track being on the left side of the tail line segment, it is determined that the track is not on one side of the filtering direction. In FIG. 11(a), the filtering direction is the northeast side, the filtering direction is on the left side of the head line segment vector, and track 8 is on the right side of the tail line segment vector, so track 8 is not in the filtering direction. In FIG. 11(b), the filtering direction is the northeast side, the filtering direction is on the left side of the head line segment vector, and track 8 is on the left side of the tail line segment vector, so track 8 is in the filtering direction.

[0094] In an embodiment of the present application, in the other area, the vector product of the head line segment vector of the polyline segment and the vector on the horizontal plane is calculated to judge the included - angle range, and the head line segment vector of the polyline segment and the vector are distinguished as acute / obtuse or reverse obtuse angles, and the first judgment rule or the second judgment rule is executed accordingly. That is, when the vector product of the head line segment vector and the vector on the horizontal plane is greater than 0, the corresponding steps for the case where the relationship between the head and tail line segments is an acute / obtuse angle are executed. When the vector product of the head line segment vector and the vector When the vector product on the horizontal plane is less than 0, perform the corresponding steps for the relationship between the head and tail line segments of the previous text being a reverse obtuse angle.

[0095] In an embodiment of the present application, when the shape of the target area is a polygon, during the process of determining whether the track meets the filtering condition, first, determine whether the polygon vertices are arranged in a clockwise or counterclockwise order according to the line integral of the polygon sides. Then, according to the vector heading angle of the first line segment of the polygon and the filtering direction, determine whether the filtering direction is on the left or right side of the first line segment. Next, according to the clockwise / counterclockwise arrangement result of the polygon vertices and the left / right side result of the filtering direction with respect to the first line segment, determine whether the target area corresponds to the inside or outside of the polygon. Secondly, construct a ray starting from the track and horizontally eastward. Calculate the number of intersection points of the ray with all sides of the polygon, and make counting adjustments according to the intersection point types. Determine whether the track is inside or outside the polygon according to the parity of the number of intersection points. When the inside / outside state of the target area corresponding to the polygon is consistent with the inside / outside state of the track located in the polygon, it is determined that the track meets the filtering condition. When the inside / outside state of the target area corresponding to the polygon is inconsistent with the inside / outside state of the track located in the polygon, it is determined that the track does not meet the filtering condition.

[0096] In an embodiment of the present application, through the polygon side integral formula: Calculate the polygon side integral, where S Polygon is the polygon side integral value, N is the number of endpoints of the polygon, is the i-th endpoint p i of the polygon in the east direction value in the northeast celestial coordinate, is the i-th endpoint p i of the polygon in the north direction value in the northeast celestial coordinate, is the (i + 1)-th endpoint p i+1 of the polygon in the north direction value in the northeast celestial coordinate, is the (i + 1)-th endpoint p i+1 of the polygon in the east direction value in the northeast celestial coordinate.

[0097] In an embodiment of the present application, when the polygon side integral value S Polygon is negative, the polygon vertex order is arranged in a clockwise order. Conversely, when the polygon side integral value S Polygon is positive, the polygon vertex order is arranged in a counterclockwise order.

[0098] In an embodiment of the present application, when determining whether the filtering direction is on the left or right side of the first line segment vector of the polygon according to the filtering direction and the vector heading angle θ of the first line segment of the polygon, as shown in Fig. 12(a), in When the filtering direction is the northwest side, it is determined that the filtering direction is on the left side of the first line segment vector; when the filtering direction is the southeast side, it is determined that the filtering direction is on the right side of the first line segment vector. As shown in Fig. 12(b), in When the filtering direction is the northeast side, it is determined that the filtering direction is on the left side of the first line segment vector; when the filtering direction is the southwest side, it is determined that the filtering direction is on the right side of the first line segment vector. As shown in Fig. 12(c), in When the filtering direction is the southeast side, it is determined that the filtering direction is on the left side of the first line segment vector; when the filtering direction is the northwest side, it is determined that the filtering direction is on the right side of the first line segment vector. As shown in Fig. 12(d), in When the filtering direction is the southwest side, it is determined that the filtering direction is on the left side of the first line segment vector; when the filtering direction is the northeast side, it is determined that the filtering direction is on the right side of the first line segment vector.

[0099] In the embodiments of the present application, in the process of determining whether the target area corresponds to the inside or outside of the polygon according to the clockwise / counterclockwise arrangement result of the polygon vertices and the left / right side result of the filtering direction with respect to the first line segment, as shown in Fig. 13(a), when the polygon vertices are arranged in clockwise order, if the filtering direction is on the left side of the first line segment vector, it indicates that the target area corresponds to the outside of the polygon; if the filtering direction is on the right side of the first line segment vector, it indicates that the target area corresponds to the inside of the polygon. As shown in Fig. 13(b), when the polygon vertices are arranged in counterclockwise order, if the filtering direction is on the left side of the first line segment vector, it indicates that the target area corresponds to the inside of the polygon; if the filtering direction is on the right side of the first line segment vector, it indicates that the target area corresponds to the outside of the polygon.

[0100] In the embodiments of the present application, when the target area is a polygon, in the process of adjusting the count according to the intersection type, first, it is judged whether the intersection point is on the line segment of the polygon. In response to the intersection point not being on the line segment of the polygon, no action is taken. In response to the intersection point being on the line segment of the polygon, it is judged whether the intersection point is an endpoint of the polygon. In response to the intersection point not being an endpoint of the polygon, the number of intersection points is incremented by 1. In response to the intersection point being an endpoint of the polygon, it is judged whether the other two endpoints of the two line segments connected to this endpoint are on the same side of the ray. In response to the other two endpoints of the two line segments connected to this endpoint being on the same side of the ray, the number of intersection points is incremented by 2. In response to the other two endpoints of the two line segments connected to this endpoint not being on the same side of the ray, the number of intersection points is incremented by 1.

[0101] In the embodiments of the present application, when the target area is a polygon, the schematic diagram involved in the process of adjusting the count according to the intersection type can be referred to Figure 14 . In Figure 14 When the filtering direction is the northeast side, the number of intersection points N of tracks 1-6 intsectThey are 1, 1, 2, 2, 1, 0 respectively. Therefore, Tracks 1, 2, and 5 are inside the polygon, and the other tracks are outside the polygon.

[0102] In summary, through the above-provided track geographical filtering solution based on computational geometry, the embodiments of the present application obtain the geographical coordinate sequence of the track to be filtered, and the geographical coordinates include longitude, latitude, and altitude, providing a necessary data basis for subsequent filtering operations and enabling filtering to be performed in a three-dimensional space, which is crucial for application scenarios such as air traffic control and UAV obstacle avoidance that require consideration of altitude, improving the accuracy and practicality of filtering. By obtaining the geographical filter definition of the target area, the geographical filter defines the shape, geographical coordinates, size parameters, axial direction, and filtering direction of the target area, allowing users to customize the shape, position, size, and orientation of the area, adapting to various complex geographical space filtering requirements, and by defining the filtering direction, the filtering target is clear and definite, increasing the controllability of the application. By selecting the corresponding relative position relationship judgment algorithm according to the shape of the target area, specialized optimized algorithms can be used for specific shapes, making the calculation process more efficient and the calculation results more accurate. By converting the geographical coordinates of the track and the relevant geographical coordinates of the target area to the same local coordinate system, the error caused by the earth's curvature can be significantly reduced. By judging whether the track meets the filtering conditions based on the calculation results of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, and filtering the track when it meets the filtering conditions, the calculation results are converted into actual filtering actions, achieving the ultimate goal of the entire process.

[0103] Further, in some embodiments, by setting that the target area shape includes at least one of an ellipse, an elliptical ring, a rectangle, a rectangular ring, a polyline, and a polygon, and the filtering direction is inside or outside for an ellipse and a rectangle, and one of the northeast side, northwest side, southeast side, or southwest side for a polyline and a polygon, this makes the target area no longer limited to a polygon, clearly increasing the support for ellipses, elliptical rings, rectangles, and rectangular rings, so that the filter can define more diverse and more practical geographical areas. Introducing the judgment of the northeast side, northwest side, southeast side, or southwest side for polylines and polygons makes the filtering rules more refined and directional, providing a richer information dimension and control ability than simple inside-outside judgment.

[0104] Further, in some embodiments, when the shape of the target area is an ellipse or an elliptical ring, the geographical coordinates of the track points and the geographical coordinates of the ellipse are converted into the same local two-dimensional Cartesian coordinate system centered on the ellipse and axially aligned, reducing the complex geographical space position judgment problem to a simple two-dimensional plane geometry problem, improving the calculation efficiency and the simplicity of the algorithm. And a mathematical criterion for judging whether the converted track point coordinates are inside (or on the boundary) of the ellipse is defined, a composite logic for judging whether the track point is located inside the elliptical ring is defined, and whether the track meets the filtering condition is determined according to the judgment result and the filtering direction (inside / outside) specified by the user, ensuring the accuracy, flexibility and calculation feasibility when filtering the track for the target area.

[0105] Still further, in some embodiments, when the shape of the target area is a polyline, in the process of judging whether the track meets the filtering condition, by calculating the dot product of the head and tail line segment vectors to judge the included angle relationship, the relative directions of the line segments at the starting point and the ending point of the polyline can be analyzed. By constructing a ray perpendicular to the first segment and pointing to the filtering direction, the direction of the ray is directly related to the filtering direction, and its intersection with the polyline can be used to infer which side of the polyline the point is located on. By calculating the intersection points of the ray and each line segment and adjusting the count, situations such as the ray just passing through the endpoint and coinciding with the line segment are considered, avoiding misjudgments caused thereby, and significantly improving the robustness and accuracy of the algorithm. By judging whether the track is on one side of the filtering direction according to the relationship between the head and tail line segments and / or the number of intersection points, the accurate azimuth judgment of the track point relative to the polyline is realized, meeting the finer filtering requirements than simple inside / outside.

[0106] Even still further, in some embodiments, when the shape of the target area is a polygon, in the process of judging whether the track meets the filtering condition, by judging whether the polygon vertices are arranged in a clockwise or counterclockwise order, the inherent directionality can be automatically recognized, providing a guarantee of consistency for subsequent judgments and increasing the robustness of the method. By judging the relative position of the filtering direction and determining the inside and outside corresponding to the target area, the azimuth direction (such as the northeast side, etc.) that the user may initially define is finally mapped to the inside or outside of the corresponding polygon, solving the problem that the user may use azimuth descriptions while geometric judgments are usually based on inside and outside, and establishing a clear mapping relationship. By constructing a ray horizontally eastward, calculating the number of intersection points of the ray and all sides of the polygon, and adjusting the count according to the intersection point type, the special situation where the track ray coincides with the polygon line segment is considered. Through specific counting rules, it is ensured that correct results can be obtained even when the ray is along the polygon edge or partially coincident, greatly improving the robustness of the algorithm. And the special situation where the intersection point passes through the intersection point of two line segments forming the polygon is considered. By adjusting the count, the counting error caused by passing through the vertex is avoided, further enhancing the accuracy and robustness of the algorithm.

[0107] The embodiment of the present application also provides a track geographical filtering system based on computational geometry, which can perform track geographical filtering based on computational geometry by using the aforementioned track geographical filtering method 100 based on computational geometry, or can also use other methods to perform track geographical filtering based on computational geometry, and the present application does not limit this here.

[0108] Figure 15 An exemplary structural block diagram of the track geographical filtering system based on computational geometry according to the embodiment of the present application is shown.

[0109] As Figure 15 shown, the system 1500 includes an acquisition module 1510, a selection module 1520, an execution module 1530, and a filtering module 1540. In the embodiment of the present application, the acquisition module 1510, the selection module 1520, the execution module 1530, and the filtering module 1540 can be separate units, or can be integrated in the same integrated circuit, and the present application does not limit this here.

[0110] Specifically, the acquisition module 1510 is used to acquire the geographical coordinate sequence of the track to be filtered and the geographical filter definition of the target area, where the geographical coordinates include longitude, latitude, and altitude, and the geographical filter defines the shape, geographical coordinates, size parameters, axial direction, and filtering direction of the target area.

[0111] Specifically, the selection module 1520 is used to select a corresponding relative position relationship judgment algorithm according to the shape of the target area.

[0112] Specifically, the execution module 1530 is used to execute the relative position relationship judgment algorithm, where the algorithm includes converting the geographical coordinates of the track and the relevant geographical coordinates of the target area into the same coordinate system.

[0113] Specifically, the filtering module 1540 is used to judge whether the track meets the filtering condition based on the calculation result of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, and filter the track when the track meets the filtering condition.

[0114] When the system 1500 performs track geographical filtering based on computational geometry by using the aforementioned track geographical filtering method 100 based on computational geometry, the acquisition module 1510 executes the aforementioned steps S110 and S120, the selection module 1520 executes the aforementioned step S130, the execution module 1530 executes the aforementioned step S140, and the filtering module 1540 executes the aforementioned step S150. The specific execution process can refer to the foregoing, and will not be elaborated here.

[0115] Although several embodiments of the present application have been shown and described herein, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art can conceive of many changes, alterations, and alternative ways without departing from the spirit and scope of the present application. It should be understood that various alternatives to the embodiments of the present application described herein may be employed in practicing the present application. The appended claims are intended to define the scope of protection of the present application and thus cover equivalents or alternatives within the scope of these claims.

Claims

1. A track geographical filtering method based on computational geometry, characterized in that Including: Obtaining a sequence of geographical coordinates of the track to be filtered, where the geographical coordinates include longitude, latitude, and altitude; Obtaining a geographical filter definition of the target area, where the geographical filter defines the shape, geographical coordinates, dimension parameters, axis direction, and filtering direction of the target area; Selecting a corresponding relative position relationship judgment algorithm according to the shape of the target area; Executing the relative position relationship judgment algorithm, where the algorithm includes converting the geographical coordinates of the track and the relevant geographical coordinates of the target area into the same coordinate system; Judging whether the track meets the filtering conditions based on the calculation result of the relative position relationship judgment algorithm and the filtering direction defined by the geographical filter, and filtering the track when it meets the filtering conditions.

2. The track geographical filtering method based on computational geometry according to claim 1, characterized in that The shape of the target area includes at least one of an ellipse, an elliptical ring, a rectangle, a rectangular ring, a polyline, and a polygon. The filtering direction is inside or outside for an ellipse and a rectangle, and one of the northeast side, northwest side, southeast side, or southwest side for a polyline and a polygon.

3. The track geographic filtering method based on computational geometry according to claim 2, wherein When the shape of the target area is an ellipse or an elliptical ring, the ellipse is determined by the central geographical coordinates, the semi-major axis length, the semi-minor axis length, and the axis direction, and the elliptical ring is defined by two concentric ellipses, an inner ellipse and an outer ellipse; In the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the ellipse or elliptical ring into the same coordinate system, the geographical coordinates of the track are converted into a northeast celestial coordinate with the center of the ellipse as the origin, and then this northeast celestial coordinate is rotated according to the ellipse axis direction to be a local Cartesian coordinate (x1, y1, z1) with the major axis of the ellipse as the X-axis and the minor axis as the Y-axis; When the shape of the target area is an ellipse, judging whether the track meets the filtering conditions includes: Determine whether (x1 / semi-major axis) 2 + (y1 / semi-minor axis) 2 <= 1; In response to satisfying (x1 / semi-major axis) 2 + (y1 / semi-minor axis) 2 <= 1, it is determined that the track is inside the ellipse. When the filtering direction is inside, the track satisfies the filtering condition, and when the filtering direction is outside, the track does not satisfy the filtering condition; In response to not satisfying (x1 / semi-major axis) 2 + (y1 / semi-minor axis) 2 <= 1, it is determined that the track is outside the ellipse. When the filtering direction is internal, the track does not satisfy the filtering condition, and when the filtering direction is external, the track satisfies the filtering condition; When the shape of the target area is an elliptical ring, judging whether the track meets the filtering conditions includes: Judging whether the track simultaneously satisfies being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary; In response to the track simultaneously satisfying being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary, when the filtering direction is inside, the track meets the filtering conditions, and when the filtering direction is outside, the track does not meet the filtering conditions; In response to the track not simultaneously satisfying being inside the outer ellipse including the outer ellipse boundary and outside the ellipse excluding the inner ellipse inner boundary, when the filtering direction is inside, the track does not meet the filtering conditions, and when the filtering direction is outside, the track meets the filtering conditions.

4. The track geographical filtering method based on computational geometry according to claim 2, characterized in that, When the shape of the target area is a rectangle or a rectangular ring, the shape of the target area is determined by the central geographical coordinates, the semi-long side length, the semi-short side length, and the axis direction, and the rectangular ring is defined by two concentric rectangles, an inner rectangle and an outer rectangle; In the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the rectangle or rectangular ring into the same coordinate system, the geographical coordinates of the track are converted into a northeast celestial coordinate with the center of the rectangle as the origin, and then this northeast celestial coordinate is rotated according to the rectangle axis direction to be a local Cartesian coordinate (x2, y2, z2) with the long side direction of the rectangle as the X-axis and the short side direction as the Y-axis; When the shape of the target area is a rectangle, determining whether the track meets the filtering condition includes: Determining whether |x2| <= half of the long side length and |y2| <= half of the short side length are satisfied; In response to |x2| <= half of the long side length and |y2| <= half of the short side length being satisfied, determining that the track is inside the rectangle. When the filtering direction is inside, the track meets the filtering condition; when the filtering direction is outside, the track does not meet the filtering condition; In response to |x2| <= half of the long side length and |y2| <= half of the short side length being satisfied, determining that the track is outside the rectangle. When the filtering direction is inside, the track does not meet the filtering condition; when the filtering direction is outside, the track meets the filtering condition; When the shape of the target area is a rectangular ring, determining whether the track meets the filtering condition includes: Determining whether the track simultaneously meets the conditions of being inside the outer rectangle and outside the inner rectangle; In response to simultaneously meeting the conditions of being inside the outer rectangle and outside the inner rectangle, when the filtering direction is inside, the track meets the filtering condition; when the filtering direction is outside, the track does not meet the filtering condition; In response to not simultaneously meeting the conditions of being inside the outer rectangle and outside the inner rectangle, when the filtering direction is inside, the track does not meet the filtering condition; when the filtering direction is outside, the track meets the filtering condition.

5. The track geographic filtering method based on computational geometry according to claim 2, wherein When the shape of the target area is a polyline, the shape of the polyline is determined by the geographical coordinates of a set of multiple ordered endpoints; During the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the polyline to the same coordinate system, the geographical coordinate set of the track geographical coordinates and all endpoints of the polyline is converted to the northeast - sky coordinate with the first endpoint of the polyline as the origin; During the process of determining whether the track meets the filtering condition, the following steps are executed: Calculating the vector product of the first - segment vector and the last - segment vector of the polyline on the horizontal plane to determine the angle range, and distinguishing the relationship between the head and tail segments as acute / obtuse, reverse - obtuse, or perpendicular; Constructing a ray starting from the track, perpendicular to the first segment and pointing to the filtering direction; Calculating the number of intersection points of the ray and each segment of the polyline, and adjusting the count according to the intersection point type; Based on the relationship between the head and tail segments and / or the number of intersection points, determining whether the track is on one side of the filtering direction, and when the track is on one side of the filtering direction, determining that the track meets the filtering condition.

6. The method for filtering track geography based on computational geometry according to claim 5, wherein During the process of determining whether the track is on one side of the filtering direction based on the relationship between the head and tail segments and / or the number of intersection points, the following steps are executed: When the relationship between the head and tail segments is acute / obtuse, execute the first judgment rule, where the first judgment rule is: Determining whether the corresponding number of intersection points is odd or even; In response to the corresponding number of intersection points being odd, determining that the track is not on one side of the filtering direction; In response to the corresponding number of intersection points being even, determining that the track is on one side of the filtering direction; When the relationship between the head and tail segments is reverse - obtuse, execute the second judgment rule, where the second judgment rule is: determining whether the corresponding number of intersection points is odd or even; In response to the corresponding number of intersection points being odd, determining that the track is on one side of the filtering direction; In response to the number of its corresponding intersection points being even, it is determined that the track is not on one side of the filtering direction.

7. The track geographical filtering method based on computational geometry according to claim 5, characterized in that In the process of determining whether the track is on one side of the filtering direction according to the head and tail line segment relationship and / or the number of intersection points, the following steps are also executed: When the relationship between the head and tail line segments is perpendicular, the target area is divided into a specific area and other areas, where the specific area is vector P N-2 P N-1 The area between the extension line and vector P N-1 P N where N is the number of all endpoints of the polyline, P N-2 is the third-to-last endpoint of the polyline, P N-1 is the second-to-last endpoint of the polyline, P N is the last endpoint of the polyline; In a specific area, respectively determine whether the filtering direction is on the left / right side of the head line segment and whether the track is on the left / right side of the tail line segment; In response to the filtering direction being on the left side of the head line segment and the track being on the left side of the tail line segment or the filtering direction being on the right side of the head line segment and the track being on the right side of the tail line segment, it is determined that the track is on one side of the filtering direction; In response to the filtering direction being on the left side of the head line segment and the track being on the right side of the tail line segment or the filtering direction being on the right side of the head line segment and the track being on the left side of the tail line segment, it is determined that the track is not on one side of the filtering direction; In other regions, calculate the vector product of the first segment vector of the broken line segment and the vector P N-2 P N-1 On the horizontal plane, judge the included angle range through the vector product to distinguish the first segment vector of the broken line segment and the vector P N-2 P N-1 If it is an acute angle / obtuse angle or reverse obtuse angle, execute the first judgment rule or the second judgment rule accordingly.

8. The track geographical filtering method based on computational geometry according to claim 2, characterized in that, When the shape of the target area is a polygon, the shape of the polygon is determined by the geographical coordinates of multiple ordered endpoints; In the process of converting the geographical coordinates of the track and the relevant geographical coordinates of the polygon to the same coordinate system, the set of geographical coordinates of the track and all endpoints of the polygon is converted to the northeast celestial coordinate with the first endpoint of the polygon as the origin; In the process of determining whether the track meets the filtering conditions, the following steps are executed: Judge whether the polygon vertices are arranged in a clockwise or counterclockwise order according to the line integral of the polygon sides; According to the vector heading angle of the head line segment of the polygon and the filtering direction, judge whether the filtering direction is on the left or right side of the head line segment; According to the clockwise / counterclockwise arrangement result of the polygon vertices and the left / right side result of the filtering direction located on the head line segment, determine whether the target area corresponds to the inside or outside of the polygon; Construct a ray starting from the track and horizontally eastward; Calculate the number of intersection points of the ray with all sides of the polygon, and make a counting adjustment according to the intersection point type; Judge whether the track is inside or outside the polygon according to the parity of the number of intersection points; When the inside / outside state of the target area corresponding to the polygon is consistent with the inside / outside state of the track located in the polygon, it is determined that the track meets the filtering conditions; When the inside / outside state of the target area corresponding to the polygon is inconsistent with the inside / outside state of the track located in the polygon, it is determined that the track does not meet the filtering conditions.

9. The method for track geographical filtering based on computational geometry according to claim 5 or 8, characterized in that In the process of making a counting adjustment according to the intersection point type, when the target area is a broken line segment, the following steps are executed: Judge whether the intersection point is on the broken line segment or on the extension line of the head and tail line segments of the broken line segment; In response to the intersection point being on the broken line segment or on the extension line of the head and tail line segments of the broken line segment, judge whether the intersection point is an endpoint; In response to the intersection point not being an endpoint, when the vector is in the same direction as the vector , increment the intersection point count by 1, where P foot is the foot of the perpendicular from the track to the line where the first line segment lies, P Target is the track, and P intsect is the intersection point; In response to the intersection point being an endpoint, on the vector and the vector being in the same direction, determine whether the other two endpoints of the two line segments connected to this endpoint are on the same side of the ray; In response to the other two endpoints of the two line segments connected to this endpoint being on the same side of the ray, increase the number of intersection points by 2; In response to the other two endpoints of the two line segments connected to this endpoint not being on the same side of the ray, increase the number of intersection points by 1; In response to the intersection point not being on the broken line segment or on the extension line of the head and tail line segments of the broken line segment, do not perform any action; When the target area is a polygon, the following steps are executed: Judge whether the intersection point is on the line segment of the polygon; In response to the intersection point not being on the line segment of the polygon, do not perform any action; In response to the intersection point being on the line segment of the polygon, judge whether the intersection point is an endpoint of the polygon; In response to the intersection point not being an endpoint of the polygon, increment the intersection point count by 1; In response to the intersection point being an endpoint of the polygon, determine whether the other two endpoints of the two line segments connected to this endpoint are on the same side of the ray; In response to the other two endpoints of the two line segments connected to this endpoint being on the same side of the ray, increment the intersection point count by 2; In response to the other two endpoints of the two line segments connected to this endpoint not being on the same side of the ray, increment the intersection point count by 1.

10. A track geographical filtering system based on computational geometry, characterized in that, Perform trajectory geographic filtering based on computational geometry using the trajectory geographic filtering method based on computational geometry according to any one of claims 1-9, the system comprising: An acquisition module, configured to acquire a geographic coordinate sequence of a trajectory to be filtered and a geographic filter definition of a target area, wherein the geographic coordinates include longitude, latitude, and altitude, and the geographic filter defines the shape, geographic coordinates, size parameters, axis, and filtering direction of the target area; A selection module, configured to select a corresponding relative position relationship judgment algorithm according to the shape of the target area; An execution module, configured to execute the relative position relationship judgment algorithm, wherein the algorithm includes converting the geographic coordinates of the trajectory and the relevant geographic coordinates of the target area into the same coordinate system; A filtering module, configured to determine whether the trajectory meets the filtering condition based on the calculation result of the relative position relationship judgment algorithm and the filtering direction defined by the geographic filter, and filter the trajectory when the trajectory meets the filtering condition.