180-degree-crossing longitude route drawing method, storage medium and electronic equipment
By correcting the longitude values of routes crossing the 180-degree meridian and setting the noWrap parameter, the problem of route reversals in navigation maps was solved, achieving continuous and accurate route drawing.
Patent Information
- Application Number
- CN202510634880.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-16
- Publication Date
- 2025-11-07
AI Technical Summary
Existing navigation maps automatically correct longitude values when drawing routes that cross the 180-degree meridian, causing the trajectory to reverse and disrupting continuity and accuracy.
By determining lngi×lngi+1<0 and |lngi|+|lngi+1|≥360°-Jmax, longitude values greater than -180° and less than 0° are corrected. In the AMap.LngLat class of Amap, the noWrap parameter is set to true to prevent automatic repair. The Polyline class is used to connect the marker points to draw the route.
This avoids the route reversing at the 180-degree meridian, ensuring the continuity and accuracy of the trajectory.
Smart Images

Figure CN120907526A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of route trajectory drawing, in particular to a route drawing method across 180-degree meridian, a storage medium and an electronic device. BACKGROUND
[0002] With the rapid growth of air traffic, passengers and airlines have higher requirements for flight information acquisition and display, especially real-time, accurate and personalized display of flight trajectory, which has become the key to improving service quality and user experience. Due to the essential difference between the three-dimensional characteristics of the earth and the two-dimensional display of the map, when the three-dimensional space of the earth is converted into a two-dimensional map by using the Mercator projection, the longitude range is limited between [-180°, 180°]. When drawing a flight trajectory that crosses this boundary (such as a route from Beijing to Boston), due to the setting of the underlying logic, the existing navigation map (such as Gaode Map) will automatically repair the longitude value of the point whose longitude should be greater than 180° or less than -180° to the set longitude interval of [-180°, 180°] to ensure display in the same map sheet. As a result, the trajectory appears to reverse near the 180-degree meridian, which seriously damages the continuity, directionality and accuracy of the trajectory. SUMMARY
[0003] To solve the above technical problems, the technical scheme adopted by the present application is as follows: According to one aspect of the present application, a route drawing method across 180-degree meridian is provided, characterized in that the method comprises the following steps: If the number of elements in the set of positions to be processed R {A1, A2, …, Ai, …, Az} is greater than 2, then traverse the longitude values in R; Ai is the longitude value lng i and the latitude value lat i of the i-th flight position point collected by the flight in the flight process; z is the total number of flight position points collected by the flight in the flight process, i = 1, 2, …, z; R is the flight position point collected by the flight in a single flight segment; If lng i × lng i+1 <0, and |lng i |+|lng i+1 |≥360°-Jmax, then correct each longitude value greater than -180° in R to generate a corrected longitude value corresponding to each longitude value greater than -180° and less than 0°; wherein the corrected longitude value lng n x satisfies the following condition: lng nx =lng n +360°;Jmax is the maximum longitude difference of two adjacent flight position points in R; The AMap.LngLat class is called to mark the flight position points without correction and the corrected flight position points on the two-dimensional map of the Gaode map; when marking the flight position points without correction, the value of the noWrap parameter in AMap.LngLat is false; when marking the corrected flight position points, the value of the noWrap parameter in AMap.LngLat is true; The Polyline class is called to connect all the marked points on the two-dimensional map to draw the target flight path.
[0004] According to a second aspect of the present application, a non-transitory computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement a flight path drawing method across 180-degree meridians.
[0005] According to a third aspect of the present application, an electronic device is provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements a flight path drawing method across 180-degree meridians when executing the computer program.
[0006] The present application has at least the following beneficial effects: In the present application, whether there is a flight path position point across ±180° in the set of to-be-processed positions R is quickly judged by lng i ×lng i+1 <0 and |lng i |+|lng i+1 |≥360°-Jmax, and after it is determined that there is a flight path position point across ±180°, the longitude value (that is, the longitude value greater than -180° and less than 0°) of the position point across the part is actively corrected, and when marking by using the AMap.LngLat class of the Gaode map, the value of the noWrap parameter is set to true, thereby preventing the AMap.LngLat class from actively repairing the position point across the date limit (that is, across ±180°), and thereby successfully marking the position point corresponding to the longitude position across ±180° into the adjacent next map sheet. Therefore, when connecting the marked points by using the Polyline class, the connection line will also successfully cross the longitude position across ±180° and be connected to the adjacent next map sheet, thereby avoiding the phenomenon that the trajectory reverses near the longitude position of 180 degrees on the map, and ensuring the continuity, directionality and accuracy of the trajectory. BRIEF DESCRIPTION OF DRAWINGS
[0007] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed in the embodiments description. Obviously, the drawings in the following description only show some of the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0008] Figure 1 A flow chart of a route drawing method across 180-degree meridians is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0009] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0010] As a possible embodiment of the present application, as shown in Figure 1 , a route drawing method across 180-degree meridians is provided, and the method comprises the following steps: S100: If the number of elements in the set R of to-be-processed positions {A1, A2, …, Ai, …, Az} is greater than 2, then the longitude values in R are traversed. Ai is the longitude value lng i and the latitude value lat i of the i-th flight position point collected by the flight in the process. z is the total number of flight position points collected by the flight in the process, and i = 1, 2, …, z. R is the flight position points collected by the flight in a single flight segment. The longitude and latitude coordinates in R are coordinates in the Mars coordinate system.
[0011] In the process of air flight, the ADS-B (Automatic Dependent Surveillance-Broadcast, air surveillance technology) is used to collect multiple flight position points of the flight, and the longitude and latitude of these position points form the set R of flight position points.
[0012] Before traversing the longitude values in R, the method further comprises: S101: If the longitude and latitude coordinates in the obtained set of single-segment positions use the Earth coordinate system, then the longitude and latitude coordinates in the set of single-segment positions are converted to generate R. The set of single-segment positions is the flight position points collected by the flight in a single flight segment.
[0013] Since the embodiment is mainly aimed at improving the Gaode map, and the coordinate system used by the Gaode map is the Mars coordinate system. Therefore, if the longitude and latitude coordinates of the flight position points collected initially are not the longitude and latitude coordinates in the Mars coordinate system (such as the longitude and latitude coordinates in the Earth coordinate system), the longitude and latitude in the Earth coordinate system need to be converted into the longitude and latitude in the Mars coordinate system through a specific conversion algorithm, so as to facilitate the normal development of the subsequent steps in the embodiment.
[0014] In addition, since the correction processing in S200 will correct all the longitude values greater than -180° and less than 0° in R, if R is a position point set of multiple flight segments, the position points of other flight segments are easy to be incorrectly corrected, so it is necessary to ensure that R only contains position points of a single flight segment.
[0015] Since when collecting flight position points, not only the position coordinates of the points will be collected, but also other attribute values of the parent generation, such as the collection time, the flight speed, and the position identifier corresponding to the position point, the position identifiers used in the embodiment mainly include the starting airport identifier, the destination airport identifier, and the transfer airport identifier, which can identify special position points on the flight route.
[0016] Specifically, the single flight segment position set R is obtained by splitting the position point set containing multiple flight segments, and the steps are as follows: S102: If the position identifier corresponding to any flight position point in the initial position set is not the transfer airport identifier, the initial position set is determined as the single flight segment position set.
[0017] S103: If the position identifier corresponding to any flight position point in the initial position set is the transfer airport identifier, the initial position set is subjected to flight segment splitting processing.
[0018] The flight segment splitting processing includes: S104: The multiple flight position points between the transfer airport identifier and the adjacent starting airport identifier or destination airport identifier in the initial position set are taken as the coordinate points in the single flight segment position set.
[0019] S200: If lng i ×lng i+1 <0, and |lng i |+|lng i+1 |≥360°-Jmax, the correction processing is performed on each longitude value greater than -180° in R to generate the correction longitude value corresponding to each longitude value greater than -180° and less than 0°. The correction longitude value corresponding to the nth longitude value greater than -180° and less than 0° is lng n x The following conditions are met: lng n xlng n +360°. Jmax is the maximum longitude difference of two adjacent flight position points in R.
[0020] Because in the actual longitude setting, the positive and negative of the longitude points on the left and right sides of the 0° meridian and the left and right sides of the ±180° meridian are different. Therefore, in this step, by lng i ×lng i+1 <0 can determine whether there is a point in R that crosses the 0° or ±180° meridian.
[0021] In addition, because the problem of reversing the flight route only occurs when crossing the ±180° meridian, it is also necessary to determine whether the point in R is a point that crosses the 0° or ±180° meridian by |lng i |+|lng i+1 |≥360°-Jmax. Because in the actual position point collection process, the ADS-B data has a certain collection interval, the above determination conditions are set based on this feature.
[0022] Specifically, taking a longitude span of 5° as an example, if two points cross the 0° meridian, the longitude values are both near 0°, such as A:-3° and B:+2°. If two points cross the ±180° meridian, the longitude values are both near ±180°, such as A:-178° and B:+177°. Correspondingly, |-3°|+|+2°|=5°, |-178°|+|+177°|=365°, so because the absolute value represents the distance of each radial point to the 0° point, if two points cross the 0° meridian, the distance is closer, specifically equal to the corresponding collection interval, and if two points cross the ±180° meridian, the distance is relatively farther, specifically equal to 360° minus the corresponding collection interval. Usually, the collection interval should be much smaller than 180°, so by |lng i |+|lng i+1 |≥360°-Jmax, it can be accurately determined whether there is a point that crosses the ±180° meridian.
[0023] In addition, because the density of ground stations set in different geographical locations is different, or due to signal reception problems, the interval between different two adjacent points in R is different, in order to ensure the accuracy of the determination as much as possible, Jmax is selected for calculation.
[0024] After it is determined that there is a point in R that crosses the ±180° meridian, it is repaired, specifically, according to lng n x =lng n+360°, the longitude value corresponding to the longitude value greater than -180° and less than 0° is corrected, so that the corresponding position point is transferred to the next adjacent map, and the noWrap parameter corresponding to the corrected point is set to true, so as to prevent the automatic repair operation of the Gaode map on the value.
[0025] The parameter is a necessary parameter in the AMap.LngLat class in the Gaode map, which is used to control whether the longitude value is automatically corrected to the interval [-180, 180]. When the default is false, the input [190, 30] is automatically corrected to [-170, 30] when noWrap is false. When noWrap is true, it will not be automatically corrected and can be used for cross-date limit overlay drawing.
[0026] S300: Call AMap.LngLat class to mark the uncorrected flight position point and the corrected flight position point in the two-dimensional map of the Gaode map. When marking the uncorrected flight position point, the value of the noWrap parameter in AMap.LngLat is false. When marking the corrected flight position point, the value of the noWrap parameter in AMap.LngLat is true.
[0027] Therefore, after the above processing, the point crossing the 180-degree meridian can be successfully marked in the next adjacent two-dimensional map, and the 180-degree meridian can be successfully crossed, thereby avoiding the problem of route return.
[0028] S400: Call the Polyline class to connect all the marked points in the two-dimensional map to draw the target route.
[0029] The Polyline class is usually used to draw a polyline on a map and is widely used in map libraries (such as Google Maps API, Leaflet, etc.) and graphics libraries. The Polyline class is also used in the Gaode map, and thus all the marked points can be connected to draw the target route by calling the Polyline class. In this embodiment, the AMap.LngLat class and the Polyline class are both classes provided by the Gaode map, so that the use of the provided classes can greatly improve the development efficiency, stability and safety, and reduce the cost and maintenance difficulty.
[0030] As another possible embodiment of the present application, the method further comprises: S500: If the number of elements in R is equal to 2, and lng 1 ×lng 2 <0, |lng 1 |+|lng 2| ≥ 360° - Jmax, then for the longitude value lng x The correction process is performed to generate lng x The corresponding corrected longitude value lng x x . lng x x The following condition is met: lng x x = lng x + 360°. Jmax is the maximum longitude difference between two adjacent flight position points in R. lng 1 and lng 2 are the first and second longitude values in R, respectively.
[0031] In some use scenarios, only the location coordinates of the departure and destination of the flight are usually given, in which case it is not necessary to accurately draw the flight path, and only the two points need to be connected.
[0032] Usually, due to consideration of flight efficiency and economy, the flight path of a civil aviation flight usually does not exceed 180 degrees of longitude, so in this embodiment, Jmax will not exceed 180 degrees. For a path that crosses the 0° meridian, the departure and destination longitude values are still closer to the 0° meridian, and for a path that crosses the 180° meridian, the departure and destination longitude values are still closer to the 180° meridian, so the judgment condition |lng 1 | + |lng 2 | ≥ 360° - Jmax is still applicable. It is still possible to determine whether the flight path crosses the 180-degree meridian.
[0033] In addition, since the actual flight usually selects a path that reaches the destination in the direction of the shortest flight length when selecting a flight path. In this embodiment, steps S600 and S700 are added to further determine which of the pre-correction position point and the post-correction position point is closer to the other position point (i.e., lng d ), so that it can be determined by the flight distance whether the pre-correction position point or the post-correction position point should be marked on the map.
[0034] By comparing the distance between the point that does not need to be corrected (i.e., the corresponding position point) and the pre-correction point (i.e., the corresponding position point) with the distance between lng d and the post-correction point (i.e., the corresponding position point), it can be determined which of the pre-correction position point and the post-correction position point is closer to the other position point (i.e., lng x ). d x x the distance between the corresponding position points, to further determine whether the longitude value greater than -180° and less than 0° needs to be corrected. Since the latitude values of the points before and after correction are the same, by comparing lng d to lng x and lng d to lng x x the size of the longitude span between the corresponding position points, lng d to lng x to lng d to lng x x to lng x or lng x x ) as the final marker point, which can ensure that the minimum distance selection scheme is marked to ensure the accurate display of the flight trajectory on the map.
[0035] S600: If |lng x x -lng d |<|lng x -lng d |, then call the AMap.LngLat class to mark the two flight position points corresponding to lng x x and lng d respectively in the two-dimensional map of Gaode Map. When marking the flight position point corresponding to lng x x , the value of the noWrap parameter in AMap.LngLat is true. When marking the flight position point corresponding to lng d , the value of the noWrap parameter in AMap.LngLat is false. lng d is the longitude value greater than 0° in R.
[0036] S700: If |lng x -lng d |<|lng x x -lng d |, then call the AMap.LngLat class to mark the two flight position points corresponding to lng x and lng d respectively in the two-dimensional map of Gaode Map. When marking the flight position point corresponding to lng x , the value of the noWrap parameter in AMap.LngLat is false. When marking the flight position point corresponding to lngd The value of the noWrap parameter in AMap.LngLat is false at the corresponding flight position point.
[0037] After marking the two flight position points determined in S700 in the two-dimensional map of Gaode Map, the method further comprises: S800: If the flight path drawing type is a straight line, a Polyline class is called to connect the two marked flight position points in the two-dimensional map to draw the target flight path.
[0038] S900: If the flight path drawing type is an arc, the latitude and longitude coordinates of a plurality of intermediate position points are obtained according to a quadratic Bezier curve formula.
[0039] Specifically, S900 is executed according to the following steps: The two flight position points determined in S700 are obtained as two end points (point1 and point2) in this step, and then the number of generated control points num (such as 40) and the starting angle angle (such as 30 degrees) are set.
[0040] The formula of the quadratic Bezier curve is: ; Wherein, P1 is the starting point point1 (lng1, lat1), P2 is the control point (lat3, lng3); P3 is the end point point2 (lng2, lat2); t is a parameter, the value range is [0, 1], indicating the position on the curve, lng and lat respectively indicate the longitude coordinate and latitude coordinate of the corresponding position point. B1 (t), B2 (t) and B3 (t) are base functions, which are defined as follows: ; 2t ; .
[0041] lat3 and lng3 satisfy the following conditions: ; ; ; h is the distance between P1 and P2, and t is the angle between P1 and P2.
[0042] The latitude and longitude coordinates of each intermediate position point are calculated as follows: ; ; ; Wherein, n = 1, 2, 3, …, num. Thus, as n takes the value of increasing, the expected number (num) of intermediate position points can be generated.
[0043] S901: Invoke AMap.LngLat class to mark each intermediate position point in the two-dimensional map of the Gaode map.
[0044] S902: Invoke Polyline class to connect the two marked flight position points and each intermediate position point in the two-dimensional map to draw the target route.
[0045] In this embodiment, a scheme for drawing an arc line between the two flight position points determined in S700 is also provided. Since the curve drawing class in the Gaode map generates a plurality of intermediate position points on the curve, if these points cross the 180° meridian position, due to the limitation of the underlying logic, the longitude value of the position points crossing the part will also be limited in the same map sheet, that is, these points will be marked on the left side of the same map sheet, and thus the problem of route return will also occur when drawing the arc line.
[0046] Therefore, in this embodiment, other means are selected to generate a plurality of intermediate position points on the curve when drawing the arc route. Specifically, the longitude and latitude coordinates of the plurality of intermediate position points are calculated according to the quadratic Bezier curve formula. This method will not be limited by the underlying logic of Gaode, and thus the longitude value of the points crossing the 180° meridian position can be more accurately generated, and then the AMap.LngLat class is used to successfully mark these points at the corresponding positions of adjacent map sheets. Finally, the Polyline class is invoked to connect these marked points with the starting and ending flight position points, thereby drawing a complete arc route. These technical features solve the problem of how to accurately draw an arc route in a two-dimensional map by accurately marking and connecting flight position points and intermediate points, and avoid the problem of reverse return of the arc route.
[0047] In addition, although the steps of the method in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps can be omitted, a plurality of steps can be combined into one step, and / or one step can be divided into a plurality of steps, etc.
[0048] Those skilled in the art can clearly understand, through the description of the above embodiments, that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a plurality of instructions to make a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
[0049] In the example embodiments of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0050] Those skilled in the art can understand that each aspect of the present disclosure can be implemented as a system, a method or a program product. Therefore, each aspect of the present disclosure can be embodied in the form of a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" herein.
[0051] The electronic device according to this embodiment of the present disclosure. The electronic device is only an example, and should not bring any limitation to the function and use range of the embodiments of the present disclosure.
[0052] The electronic device is in the form of a general computing device. The components of the electronic device can include but are not limited to the above-mentioned at least one processor, the above-mentioned at least one storage, and a bus connecting different system components (including storage and processor).
[0053] The storage stores program code that can be executed by the processor, so that the processor executes the steps according to various example embodiments of the present disclosure described in the above "example method" section of the present specification.
[0054] The storage can include a readable medium in the form of a volatile storage, such as a random access memory (RAM) and / or a cache memory, and can further include a read-only memory (ROM).
[0055] The storage can also include programs / utilities with a set of (at least one) program modules, such as operating systems, one or more application programs, other program modules, and program data, each of which or some combination of which can include the implementation of a network environment.
[0056] The bus can be one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, a graphics bus, a processor or local bus using any of a variety of bus architectures.
[0057] The electronic device can also communicate with one or more external devices such as a keyboard or a pointing device, through an I / O interface. The I / O interface can also include devices such as a Bluetooth device, a camera, a microphone, a speaker, a network interface, etc. The electronic device can communicate with one or more devices that enable user interaction with the electronic device (e.g., display devices, speakers, input devices, etc.). The electronic device can also communicate with one or more devices that enable the electronic device to communicate with one or more other computing devices. Such communication can occur via an I / O interface.
[0058] From the above description of the embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.
[0059] In the example embodiments of the present disclosure, a computer readable storage medium is also provided, and the computer readable storage medium stores a program product capable of implementing the method described above. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing a terminal device to perform the steps described in the “example method” section above according to various example embodiments of the present disclosure when the program product is run on the terminal device.
[0060] The program product can employ any combination of one or more computer-readable media. The computer-readable media can be a computer-readable storage medium or a computer-readable signal medium. The computer-readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0061] The computer-readable signal medium can include a computer-readable storage medium that is communicated, propagated, or transported, for example, over a communication link, a wireless link, or a hard-wired link. The computer-readable signal medium can also be a computer-readable storage medium that is embodied into a computer-readable storage medium or used to manufacture a computer-readable storage medium. The computer-readable storage medium can be any appropriate medium (including the one or more computer-readable media described above) that participates in providing instructions to an instruction execution system, apparatus, or device such that the instructions, which properly render the instruction-execution system, apparatus, or device into a
[0062] The program code embodied on the computer-readable media can be transmitted using any appropriate medium, including but not limited to wireless, wired, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0063] The program code can be executed by one or more programmable processors, which can be individual or grouped processors, to perform the methods disclosed herein. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The program code can also be downloaded to a user's computing device from the remote computing device or server.
[0064] In addition, the above-described flowcharts are merely illustrative of the processes included in the method according to the exemplary embodiments of the present application, and are not intended to limit the present application. It is readily understood that the processes shown in the above-described flowcharts do not indicate or limit the time sequence of the processes. In addition, it is readily understood that the processes can be executed synchronously or asynchronously, for example, in a plurality of modules.
[0065] It should be noted that, although several modules or units of the devices for action execution are mentioned in the above detailed description, the division into such modules or units is not mandatory. Indeed, according to an embodiment of the present disclosure, the features and functionalities of two or more of the above-described modules or units can be embodied in one module or unit. Conversely, the features and functionalities of one of the above-described modules or units can be further divided into several modules or units.
[0066] The above merely shows the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed by the present application can be easily conceived by those skilled in the art, and should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of plotting a course across 180 degrees of meridian, characterized by, The method comprises the following steps: If the number of elements in the set of positions to be processed R {A1, A2, …, Ai, …, Az} is greater than 2, the longitude values in R are traversed; Ai is the longitude value lng corresponding to the i-th flight position point collected by the flight in the flight process i and the latitude value lat i ; z is the total number of flight position points collected by the flight in the flight process, i = 1, 2, …, z; R is the flight position point collected by the flight in the single flight process; lng i ×lng i+1 <0, and |lng i |+|lng i+1 |≥360°-Jmax, then for each longitude value greater than -180° in R, a correction is performed to generate a corrected longitude value corresponding to each longitude value greater than -180° and less than 0°; wherein the corrected longitude value corresponding to the nth longitude value greater than -180° and less than 0° is lng n x satisfies the following condition: lng n x =lng n +360°; Jmax is the maximum longitude difference between two adjacent flight position points in R. The AMap.LngLat class is called to mark the flight position points before and after the correction on the two-dimensional map of the Gaode map; when marking the flight position points before the correction, the value of the noWrap parameter in the AMap.LngLat is false; when marking the flight position points after the correction, the value of the noWrap parameter in the AMap.LngLat is true; The Polyline class is called to connect all the marked points on the two-dimensional map to draw the target flight path.
2. The method of claim 1, wherein, The longitude and latitude coordinates in the R are coordinates in the Mars coordinate system.
3. The method of claim 2, wherein, Before traversing the longitude values in the R, the method further comprises the following steps: If the longitude and latitude coordinates in the obtained single flight section position set use the Earth coordinate system, the longitude and latitude coordinates in the single flight section position set are converted to generate the R; the single flight section position set is the flight position points collected by the flight in a single flight section.
4. The method of claim 3, wherein, The single flight section position set is obtained according to the following steps: If the position identifier corresponding to any flight position point in the initial position set is the transfer airport identifier, the initial position set is subjected to the flight section segmentation processing. The flight section segmentation processing comprises the following steps: The multiple flight position points between the transfer airport identifier and the adjacent starting airport identifier or destination airport identifier in the initial position set are taken as the coordinate points in the single flight section position set.
5. The method of claim 3, wherein, The single flight section position set is obtained according to the following steps: If the position identifier corresponding to any flight position point in the initial position set is not the transfer airport identifier, the initial position set is determined as the single flight section position set.
6. The method of claim 1, wherein, The method further comprises the following steps: If the number of elements in R is equal to 2, and lng 1 × lng 2 <0, |lng 1 |+|lng 2 |≥360°-Jmax, then the longitude value lng x in R greater than -180° and less than 0° is corrected to generate a corresponding corrected longitude value lng x ; and x x ; lng x x satisfies the following condition: lng x x =lng x +360°; Jmax is the maximum longitude difference between two adjacent flight position points in R; and lng 1 and lng 2 are the first and second longitude values in R, respectively. if |lng x x -lng d |<|lng x -lng d |, lng x x and lng d corresponding two flight position points are marked in the two-dimensional map of Gaode map; when marking lng x x corresponding flight position point, the value of noWrap parameter in AMap.LngLat is true; when marking lng d corresponding flight position point, the value of noWrap parameter in AMap.LngLat is false; lng d is the longitude value greater than 0° in R; if |lng x -lng d |<|lng x x -lng d |, then call the AMap.LngLat class to mark the two flight position points corresponding to lng x and lng d on the two-dimensional map of Gaode map; when marking the flight position point corresponding to lng x , the value of the noWrap parameter in AMap.LngLat is false; when marking the flight position point corresponding to lng d , the value of the noWrap parameter in AMap.LngLat is false.
7. The method of claim 6, wherein, After marking the two flight position points on the two-dimensional map of the Gaode map, the method further comprises the following steps: If the flight path drawing type is a straight line, the Polyline class is called to connect the two marked flight position points on the two-dimensional map to draw the target flight path.
8. The method of claim 1, wherein, After marking the two flight position points on the two-dimensional map of the Gaode map, the method further comprises the following steps: If the flight path drawing type is an arc line, the longitude and latitude coordinates of the multiple intermediate position points are obtained according to the quadratic Bezier curve formula; The AMap.LngLat class is called to mark each intermediate position point on the two-dimensional map of the Gaode map; The Polyline class is called to connect the two marked flight position points and each intermediate position point on the two-dimensional map to draw the target flight path. 9.A non-transitory computer-readable storage medium storing a computer program, the computer program comprising instructions configured to cause a processor to perform the method according to any one of claims 1 to 8. The computer program is executed by the processor to implement the flight path drawing method across the 180-degree meridian as claimed in any one of claims 1 to 8.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the flight path drawing method across the 180-degree meridian as claimed in any one of claims 1 to 8.