Ray method-based world map area alarm algorithm
By using the ray method and vector cross-multiplier method in the area alarm algorithm, the problem of misjudgment and low computational efficiency of traditional algorithms when dealing with complex geographical boundaries and areas across the longitude 0° line is solved, and more efficient and accurate regional alarm judgment is achieved.
Patent Information
- Application Number
- CN202510158100.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-12-05
- Filing Date
- 2025-02-13
- Publication Date
- 2025-06-03
AI Technical Summary
Traditional regional alarm algorithms are prone to misjudgment or misjudgment problems when dealing with complex geographical boundaries and areas across 0° longitude lines, and are inefficient in calculations and cannot accurately deal with irregular areas.
The world map area alarm algorithm based on the ray method is used to determine the counterclockwise nature of the input area through vector cross-multiplier, and the ray method is used to determine whether the current position is within the area. It is suitable for situations such as ships and aircraft where the range of movement is large and will span 0° longitude.
It improves the accuracy and computing efficiency of regional alarm judgments, can be more widely used in regional alarm judgments on world maps, reduces the possibility of user input errors, and is suitable for applications of embedded platforms.
Smart Images

Figure CN120088946A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of security technology, and particularly to a world map area alarm algorithm based on the ray method. Background Art
[0002] With the increasing globalization, the demand in fields such as maritime transportation and air flight has increased significantly. When various ships and airplanes are performing tasks, it is necessary to monitor their locations in real time and issue alarms in a timely manner when entering specific areas. These specific areas often span multiple longitude and latitude ranges, and even cross the 0° longitude line. Traditional area alarm algorithms are prone to misjudgment or missed judgment when dealing with such complex geographical boundaries. Traditional methods such as the rectangular area method, the polygon area method, and the rasterization method have problems such as low computational efficiency, large computational amount, and inability to accurately process irregular areas or areas crossing the 0° longitude line. Therefore, there is an urgent need to develop a world map area alarm algorithm based on the ray method to solve the above technical problems.
[0003] In view of this, the present invention is specifically proposed. Summary of the Invention
[0004] The object of the present invention is to provide a world map area alarm algorithm based on the ray method, which flexibly applies the ray method to the field of map area alarm, can be compatible with the area input across latitudes by users, and is an area alarm scheme applicable to ships, airplanes, etc. with a large range of activities and situations where the driving path crosses the 0° longitude. It has a broad application prospect and is conducive to popularization and application.
[0005] In order to achieve the above object, a world map area alarm algorithm based on the ray method provided by the present invention includes the following steps:
[0006] S1: Input the vertices of the area polygon into the algorithm;
[0007] S2: Determine whether the input area is clockwise. If it is clockwise, it means that there is no problem of crossing longitude and the input is correct; if it is counterclockwise, it means that there may be points crossing longitude, and adjust the area longitude and latitude and the current position longitude and latitude to be in the same reference system;
[0008] S3: Use the ray method to determine whether the current position is within the area;
[0009] S4: Issue an alarm.
[0010] Preferably, the specific steps of S1 are: Input the longitude and latitude of the vertices of the polygon of the area to be judged in a clockwise direction.
[0011] Preferably, the specific steps of S2 are as follows: The world map is a spherical unfolded quadrilateral. The longitude and latitude of the polygon vertices that span the 0° longitude on the sphere are not in clockwise order. It is necessary to first judge the input order, convert the sequentially input longitude and latitude coordinates into vectors, and use the method of vector cross product to judge the clockwise or counterclockwise input. If it is clockwise, it means that there is no problem of spanning longitude and the input is correct; if it is counterclockwise, it means that there may be points spanning longitude, and the regional longitude and latitude and the current position longitude and latitude are adjusted to be in the same reference system.
[0012] Preferably, the specific steps of S3 are as follows: Use the ray method to judge whether the current position is within the region. Take the longitude and latitude coordinates of the position to be judged as the vertex, draw a ray in any direction, mark all the intersections with the sides of the input region polygon, and calculate whether the number of intersections is odd. If it is odd, it is judged that the current position is within the input region; if it is even, it is judged to be outside the region.
[0013] Preferably, the specific steps of S4 are as follows: Control the peripheral device to give an alarm according to the judgment.
[0014] A world map area alarm algorithm based on the ray method provided by the present invention has the following beneficial effects.
[0015] 1. The present invention combines the method of vector cross product to judge the clockwise or counterclockwise input and whether the input is correct, can pre-judge the input, and remove incorrect input.
[0016] 2. The present invention can solve the problem of selecting a range that spans 90° latitude and 180° longitude on the real world map, can be more widely applied to the area alarm judgment of the world map, and improve user friendliness.
[0017] 3. The present invention combines the ray method into the field of navigation area alarm. Compared with other segmentation methods, the ray method has lower performance overhead and is more suitable for application in embedded platforms. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of a world map area alarm algorithm based on the ray method provided by the present invention. DETAILED DESCRIPTION OF THE INVENTION
[0019] The following further describes the present invention with reference to specific embodiments and drawings to help understand the content of the present invention.
[0020] As Figure 1 shown, it is a flowchart of a world map area alarm algorithm based on the ray method provided by the present invention. The world map area alarm algorithm based on the ray method includes the following steps:
[0021] S1: Input the vertices of the regional polygon into the algorithm; the specific steps of S1 are: Input the longitude and latitude of the vertices of the polygon of the area to be judged in a clockwise direction.
[0022] S2: Determine whether the input area is clockwise. If it is clockwise, it means that there is no problem of crossing the longitude and the input is correct; if it is counterclockwise, it means that there may be points crossing the longitude. Adjust the regional longitude and latitude and the current position longitude and latitude to be in the same reference system; the specific steps of S2 are: The world map is a quadrilateral unfolded by a sphere. The longitude and latitude of the polygon vertices enclosing the longitude 0° on the sphere are not clockwise. It is necessary to first judge the input order, convert the sequentially input longitude and latitude coordinates into vectors, and use the method of vector cross product to judge clockwise and counterclockwise input. If it is clockwise, it means that there is no problem of crossing the longitude and the input is correct; if it is counterclockwise, it means that there may be points crossing the longitude. Adjust the regional longitude and latitude and the current position longitude and latitude to be in the same reference system.
[0023] S3: Use the ray method to judge whether the current position is within the area; the specific steps of S3 are: Use the ray method to judge whether the current position is within the area. Take the longitude and latitude coordinates of the position to be judged as the vertex, draw a ray in any direction, mark all the intersections with the sides of the input regional polygon, calculate whether the number of intersections is odd. If it is odd, judge that the current position is within the input area; if it is even, judge that it is outside the area.
[0024] S4: Generate an alarm. The specific steps of S4 are: Control the peripheral device to generate an alarm according to the judgment.
[0025] The present invention combines the method of vector cross product to judge clockwise and counterclockwise input and whether the input is correct, can pre-judge the input, and eliminate incorrect input. The present invention can solve the problem of selecting a range that crosses 90° latitude and 180° longitude on the real world map, and can be more widely applied to the regional alarm judgment of the world map, improving user-friendliness. The present invention combines the ray method into the field of navigation area alarm. Compared with other segmentation methods, the ray method has lower performance overhead and is more suitable for the application of embedded platforms.
[0026] Specific examples are used in this article to elaborate on the inventive concept in detail. The description of the above embodiments is only used to help understand the core idea of the present invention. It should be pointed out that for those of ordinary skill in the art of this technology, any obvious modification, equivalent replacement or other improvement made without departing from the inventive concept shall be included within the protection scope of the present invention.
Claims
1. A world map area alarm algorithm based on ray method, characterized in that: The steps include: S1: Input the vertices of the area polygon to the algorithm; S2: Determine whether the input area is clockwise. If it is clockwise, it means that there is no problem of crossing longitude and the input is correct; If it is counterclockwise, it means that there may be a point that crosses the longitude. Adjust the longitude and latitude of the area and the longitude and latitude of the current location so that they are in the same reference system; S3: Use the ray method to determine whether the current position is within the area; S4: An alarm occurs.
2. A world map area alarm algorithm based on ray method according to claim 1, characterized in that: The specific steps of S1 are: inputting the longitude and latitude of the polygon vertices of the area to be determined in clockwise direction.
3. The world map area alarm algorithm based on ray method according to claim 1 is characterized in that: The specific steps of S2 are as follows: the world map is a quadrilateral unfolded by a sphere. The longitude and latitude of the vertices of the polygon that crosses the longitude 0° on the sphere are not clockwise. It is necessary to first determine the input order, convert the longitude and latitude coordinates input in sequence into vectors, and use the vector cross product method to determine whether the input is clockwise or counterclockwise. If it is clockwise, it means that there is no problem of crossing the longitude and the input is correct. If it is counterclockwise, it means that there may be points that cross longitude. Adjust the longitude and latitude of the area and the longitude and latitude of the current location so that they are in the same reference system.
4. The world map area alarm algorithm based on ray method according to claim 1 is characterized in that: The specific steps of S3 are: use the ray method to determine whether the current position is within the area, use the longitude and latitude coordinates of the position to be determined as the vertex, draw a ray in any direction, mark all intersections with the polygonal edges of the input area, and calculate whether the number of intersections is an odd number. If it is an odd number, the current position is determined to be within the input area, and if it is an even number, it is determined to be outside the area.
5. The world map area alarm algorithm based on ray method according to claim 1 is characterized in that: The specific steps of S4 are: controlling the peripheral device to generate an alarm according to the judgment.