Route drawing method and device, computer device and storage medium

By converting longitude coordinates in the electronic map that are not within the target longitude coordinate range to the target longitude coordinate range, the problem of route drawing errors in the electronic map is solved, and the accuracy of route drawing is achieved.

CN114419269BActive Publication Date: 2025-11-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210070269.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-21
Publication Date
2025-11-21
Estimated Expiration
2042-01-21

AI Technical Summary

Technical Problem

When drawing routes on an electronic map, if the absolute value of the difference in longitude coordinates between adjacent points is greater than the maximum value of the first longitude coordinate range, the drawn route will be incorrect.

Method used

The longitude coordinates of multiple location points that are not within the target longitude coordinate range are transformed to the target longitude coordinate range, so that the longitude coordinates of all location points are within the target longitude coordinate range, thereby changing the longitude coordinates corresponding to the meridians crossed by the route.

Benefits of technology

It improves the accuracy of route drawing, ensuring that the correct shortest route is drawn on the electronic map.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114419269B_ABST
    Figure CN114419269B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a route drawing method and device, computer equipment and a storage medium, and belong to the field of maps. The method comprises: displaying an electronic map; determining a plurality of position points in the electronic map, the longitude coordinates of the plurality of position points belonging to a first longitude coordinate range; in the case that the absolute value of the difference between the longitude coordinates of adjacent position points in the plurality of position points is greater than a first value, converting the longitude coordinates of the plurality of position points that do not belong to a target longitude coordinate range to the target longitude coordinate range; and drawing a route formed by connecting the plurality of position points in the electronic map in the order of the converted longitude coordinates. Converting the longitude coordinates that do not belong to the target longitude coordinate range to the target longitude coordinate range ensures that the longitude coordinates of the plurality of position points all belong to the target longitude coordinate range, and the route formed by connecting the plurality of position points can be drawn according to the converted longitude coordinates, thereby improving the accuracy of route drawing.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the field of map, and particularly relate to a route drawing method and device, computer equipment and storage medium. BACKGROUND

[0002] If the earth is regarded as a sphere, the great circle arc between any two points on the ground is the shortest route between the two points on the ground. With the development of computer technology and the wide application of electronic maps, it is usually necessary to draw a route between two points in an electronic map. Therefore, there is an urgent need to provide a route drawing method. SUMMARY

[0003] Embodiments of the present application provide a route drawing method, device, computer equipment and storage medium, which can improve the accuracy of route drawing. The technical solution is as follows:

[0004] In one aspect, a route drawing method is provided, the method comprising:

[0005] determining a plurality of position points in an electronic map, the electronic map having a first longitude coordinate range and a target longitude coordinate range, and the longitude coordinates of the plurality of position points belonging to the first longitude coordinate range;

[0006] in a case where the absolute value of the difference between the longitude coordinates of adjacent position points in the plurality of position points is greater than a first value, converting the longitude coordinates of the plurality of position points that do not belong to the target longitude coordinate range to the target longitude coordinate range, the first value being the maximum value in the first longitude coordinate range;

[0007] drawing a route connected by the plurality of position points in the electronic map in the order of the converted longitude coordinates.

[0008] Optionally, the step of determining the coordinates of at least one first passing point between the starting point and the ending point according to the coordinates of the starting point and the coordinates of the ending point is executed by a central processing unit, and the step of determining the coordinates of at least one second passing point between each two adjacent position points according to the coordinates of each two adjacent position points among the starting point, the ending point and the at least one first passing point is executed by a graphics processing unit in parallel;

[0009] After the step of determining the coordinates of at least one first passing point between the starting point and the ending point according to the coordinates of the starting point and the coordinates of the ending point, the method further comprises:

[0010] storing the coordinates of the starting point, the coordinates of the ending point and the coordinates of the at least one first passing point in a memory buffer space by the central processing unit;

[0011] The graphics processor obtains the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in the memory buffer space.

[0012] Optionally, the determining the target number based on the maximum longitude coordinate difference, the maximum latitude coordinate difference, the target longitude coordinate difference and the target latitude coordinate difference comprises:

[0013] determining a first ratio between the target longitude coordinate difference and the maximum longitude coordinate difference, and a second ratio between the target latitude coordinate difference and the maximum latitude coordinate difference;

[0014] determining the target number based on the first ratio and the second ratio, the target number being positively correlated with a maximum value of the first ratio and the second ratio.

[0015] In another aspect, a route drawing device is provided, the device comprising:

[0016] a position point determining module configured to determine a plurality of position points in an electronic map, the electronic map having a first longitude coordinate range and a target longitude coordinate range, longitude coordinates of the plurality of position points belonging to the first longitude coordinate range;

[0017] a coordinate converting module configured to, in a case where an absolute value of a difference between longitude coordinates of adjacent position points in the plurality of position points is greater than a first value, convert longitude coordinates of the plurality of position points that do not belong to the target longitude coordinate range to the target longitude coordinate range, the first value being a maximum value in the first longitude coordinate range;

[0018] a route drawing module configured to draw a route connecting the plurality of position points in the electronic map in an order of the converted longitude coordinates.

[0019] Optionally, the first longitude coordinate range comprises a first sub-range and a second sub-range, and the target longitude coordinate range comprises the second sub-range and a third sub-range; the coordinate converting module comprises:

[0020] a coordinate converting unit configured to, in a case where a maximum value in the third sub-range is greater than a maximum value in the first sub-range, add a second value to longitude coordinates of the plurality of position points that do not belong to the second sub-range; or

[0021] the coordinate converting unit configured to, in a case where the maximum value in the third sub-range is less than the maximum value in the first sub-range, subtract the second value from longitude coordinates of the plurality of position points that do not belong to the second sub-range;

[0022] The second value is an absolute value of a difference between a maximum value in the third sub-range and a maximum value in the first sub-range.

[0023] Optionally, the coordinate conversion module comprises:

[0024] The range determination unit is configured to determine a second longitude coordinate range corresponding to the target map region based on a currently displayed target map region in the electronic map, and longitude coordinates in the second longitude coordinate range are sequentially increased.

[0025] The coordinate conversion unit is configured to, for each two adjacent position points in the plurality of position points,

[0026] In a case where an absolute value of a difference between the longitude coordinates of the two position points is greater than the first value, the longitude coordinates of the two position points that do not belong to the target longitude coordinate range are converted to the target longitude coordinate range.

[0027] In a case where the absolute value of the difference between the longitude coordinates of the two position points is not greater than the first value, if the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, the longitude coordinates of the two position points are converted to the target longitude coordinate range.

[0028] Optionally, the first longitude coordinate range comprises a first sub-range and a second sub-range, and the target longitude coordinate range comprises the second sub-range and a third sub-range, and the coordinate conversion unit is configured to:

[0029] The maximum value in the third sub-range is greater than the maximum value in the first sub-range, if the longitude coordinates of the two position points do not belong to the second sub-range and do not belong to the second longitude coordinate range, the longitude coordinates of the two position points are added by a second value; or

[0030] The maximum value in the third sub-range is less than the maximum value in the first sub-range, if the longitude coordinates of the two position points do not belong to the second sub-range and do not belong to the second longitude coordinate range, the longitude coordinates of the two position points are subtracted by the second value.

[0031] The second value is an absolute value of a difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

[0032] Optionally, the first longitude coordinate range comprises positive numbers and negative numbers, and the target longitude coordinate range does not comprise positive numbers or does not comprise negative numbers.

[0033] Optionally, the device further comprises:

[0034] The center point determination module is used to determine the longitude coordinates of the center point of the target map area based on the target map area currently displayed in the electronic map, wherein the longitude coordinates of the center point belong to the first longitude coordinate range;

[0035] The range determination module is used to determine the range of longitude coordinates from 0 degrees to 360 degrees as the target longitude coordinate range when the longitude coordinate of the center point is greater than 0 degrees.

[0036] The range determination module is further configured to determine the range of longitude coordinates from -360 degrees to 0 degrees as the target longitude coordinate range when the longitude coordinates of the center point are not greater than 0 degrees.

[0037] Optionally, the device further includes a coordinate changing module for performing at least one of the following:

[0038] For each of the plurality of location points, if the latitude coordinate of the location point is greater than the maximum latitude coordinate of the electronic map, the latitude coordinate of the location point shall be changed to the maximum latitude coordinate.

[0039] For each of the plurality of location points, if the latitude coordinate of the location point is less than the minimum latitude coordinate of the electronic map, the latitude coordinate of the location point shall be changed to the minimum latitude coordinate.

[0040] Optionally, the route drawing module is used to draw a route connecting the multiple location points on the electronic map in descending order of the converted longitude coordinates, or in ascending order of the converted longitude coordinates.

[0041] Optionally, the plurality of location points includes a start point, an end point, and waypoints between the start point and the end point, and the device further includes:

[0042] The request-response module is used to respond to a route drawing request based on the electronic map and obtain the starting point and the ending point corresponding to the route drawing request;

[0043] The coordinate determination module is used to determine the coordinates of the waypoints between the starting point and the ending point based on the coordinates of the starting point and the ending point, wherein the coordinates include longitude coordinates and latitude coordinates.

[0044] Optionally, the coordinate determination module includes:

[0045] The first determining unit is configured to determine the coordinates of at least one first transit point between the starting point and the ending point based on the coordinates of the starting point and the ending point.

[0046] A second determining unit is configured to determine, in parallel, coordinates of at least one second passing point between each two adjacent position points according to coordinates of the each two adjacent position points from the start point, the end point and the at least one first passing point.

[0047] Optionally, the number of the first passing points is a target number, and the device further comprises:

[0048] A coordinate difference determining module is configured to determine a maximum longitude coordinate difference and a maximum latitude coordinate difference of a target map region currently displayed in the electronic map;

[0049] The coordinate difference determining module is further configured to determine a target longitude coordinate difference between the start point and the end point, and a target latitude coordinate difference between the start point and the end point;

[0050] A number determining module is configured to determine the target number based on the maximum longitude coordinate difference, the maximum latitude coordinate difference, the target longitude coordinate difference and the target latitude coordinate difference.

[0051] Optionally, the number determining module comprises:

[0052] A ratio determining unit is configured to determine a first ratio between the target longitude coordinate difference and the maximum longitude coordinate difference, and a second ratio between the target latitude coordinate difference and the maximum latitude coordinate difference;

[0053] A number determining unit is configured to determine the target number based on the first ratio and the second ratio, the target number being positively correlated with a maximum value of the first ratio and the second ratio.

[0054] Optionally, the step of determining the coordinates of at least one first passing point between the start point and the end point based on the coordinates of the start point and the coordinates of the end point is performed by a central processing unit, and the step of determining, in parallel, coordinates of at least one second passing point between each two adjacent position points according to coordinates of the each two adjacent position points from the start point, the end point and the at least one first passing point is performed by a graphic processing unit;

[0055] The device further comprises:

[0056] A coordinate storage module is configured to store, by the central processing unit, the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in a memory buffer space;

[0057] A coordinate obtaining module is configured to obtain, by the graphic processing unit, the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in the memory buffer space.

[0058] In another aspect, a computer device is provided, which includes a processor and a memory, and the memory has stored therein at least one computer program, which is loaded and executed by the processor to implement the operations performed by the route drawing method according to the above aspect.

[0059] In another aspect, a computer readable storage medium is provided, which has stored therein at least one computer program, which is loaded and executed by a processor to implement the operations performed by the route drawing method according to the above aspect.

[0060] In another aspect, a computer program product is provided, which includes a computer program, which is loaded and executed by a processor to implement the operations performed by the route drawing method according to the above aspect.

[0061] The method and device provided by the embodiments of the present application, the computer device and the storage medium, in the case that the absolute value of the difference between the longitude coordinates of adjacent position points is greater than the maximum value of the first longitude coordinate range, it indicates that the two adjacent position points are located on the two sides of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located. If the route is drawn directly according to the longitude coordinates, the problem of incorrect route drawing will occur. Therefore, in order to draw a correct route, the longitude coordinates of the plurality of position points which do not belong to the target longitude coordinate range are converted to the target longitude coordinate range, so that the longitude coordinates of the plurality of position points all belong to the target longitude coordinate range, so as to change the longitude coordinates corresponding to the meridian which the route between the two position points passes through. At this time, the shortest route connected by the plurality of position points can be drawn according to the converted longitude coordinates, and the accuracy of route drawing is improved. BRIEF DESCRIPTION OF DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0063] Figure 1 is a schematic diagram of a great circle arc line provided by the embodiments of the present application;

[0064] Figure 2 is a schematic diagram of an implementation environment provided by the embodiments of the present application;

[0065] Figure 3 is a flowchart of a route drawing method provided by the embodiments of the present application;

[0066] Figure 4 is a flowchart of another route drawing method provided by an embodiment of the present application;

[0067] Figure 5 is a schematic diagram of a route provided by an embodiment of the present application;

[0068] Figure 6 is a schematic diagram of an electronic map provided by an embodiment of the present application;

[0069] Figure 7 is a schematic diagram of another electronic map provided by an embodiment of the present application;

[0070] Figure 8 is a flowchart of another route drawing method provided by an embodiment of the present application;

[0071] Figure 9 is a flowchart of a coordinate conversion method provided by an embodiment of the present application;

[0072] Figure 10 is a flowchart of another route drawing method provided by an embodiment of the present application;

[0073] Figure 11 is a flowchart of another coordinate conversion method provided by an embodiment of the present application;

[0074] Figure 12 is a flowchart of another route drawing method provided by an embodiment of the present application;

[0075] Figure 13 is a flowchart of a position point determination method provided by an embodiment of the present application;

[0076] Figure 14 is a flowchart of another position point determination method provided by an embodiment of the present application;

[0077] Figure 15 is a flowchart of another route drawing method provided by an embodiment of the present application;

[0078] Figure 16 is a schematic diagram of an electronic map interface provided by an embodiment of the present application;

[0079] Figure 17 is a schematic diagram of another electronic map interface provided by an embodiment of the present application;

[0080] Figure 18 is a structural schematic diagram of a route drawing device provided by an embodiment of the present application;

[0081] Figure 19 is a structural schematic diagram of another route drawing device provided by an embodiment of the present application;

[0082] Figure 20 is a structural schematic diagram of a terminal provided by an embodiment of the present application. DETAILED DESCRIPTION

[0083] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the following further describes the embodiments of the present application with reference to the accompanying drawings.

[0084] It can be understood that the terms “first”, “second”, and the like used in the present application can be used herein to describe various concepts, but unless specifically stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the present application, a first route point can be referred to as a second route point, and similarly, a second route point can be referred to as a first route point.

[0085] In the above embodiments of the present application, at least one refers to one or more than one, for example, at least one location point can be one location point, two location points, three location points, or any integer greater than or equal to one. Multiple refers to two or more than two, for example, multiple location points can be two location points, three location points, or any integer greater than or equal to two. Each refers to each of the at least one, for example, each location point refers to each of the multiple location points, if the multiple location points are three location points, each location point refers to each of the three location points.

[0086] It can be understood that in the embodiments of the present application, data related to user information, coordinates of location points, and the like are involved, and when the above embodiments of the present application are applied to specific products or technologies, user permission or consent needs to be obtained, and the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of countries and regions.

[0087] To facilitate understanding of the embodiments of the present application, the concepts involved are first explained as follows:

[0088] 1. Intelligent Traffic System (ITS), also known as Intelligent Transportation System, is a comprehensive transportation system that effectively integrates advanced scientific technologies (information technology, computer technology, data communication technology, sensor technology, electronic control technology, automatic control theory, operations research, artificial intelligence, etc.) in transportation, service control, and vehicle manufacturing, and strengthens the connection between vehicles, roads, and users, thereby forming a comprehensive transportation system that ensures safety, improves efficiency, improves the environment, and saves energy.

[0089] 2, great circle arc: great circle arc is also called great circle route or geodesic curve, the great circle arc is the shortest route on the ground between any two points on the ground, and is also the shortest geographical route adopted in navigation. The great circle arc is the intersection line of the plane cutting the earth curve formed by two points and the center of the earth. If the earth is regarded as a spherical body, the distance between two points on the ground is the shortest along the great circle arc less than 180 degrees connecting the two points.

[0090] Figure 1 is a schematic diagram of a great circle arc provided by an embodiment of the present application, as shown in Figure 1 The curve AB is the shortest circular arc between A and B points on the spherical surface, that is, the great circle arc between A and B points, which is formed by the intersection line of the plane tangent to the earth's surface formed by O, A and B points. Curve AC is the shortest circular arc between A and B points on the spherical surface, that is, the great circle arc between A and B points, which is formed by the intersection line of the plane tangent to the earth's surface formed by O, A and C points.

[0091] 3, Java Script API GL (a rendering engine): a Web GL (Web Graphics Library) based map web rendering engine, which can provide 3D (3-Dimension) Web (web page) developer to directly call the base map data of the map, and provide point, line, surface, personalized layer and other advanced visualization graphics capabilities.

[0092] 4, Web GL: a technology for drawing and rendering three-dimensional graphics on a web page and allowing users to interact with it, and the underlying GLSL (OpenGL Shading Language) can directly operate and operate on GPU (Graphics Processing Unit).

[0093] 5, vertex shader: a program used to describe the characteristics of a vertex (such as position, color, etc.). Vertex refers to a point in three-dimensional or three-dimensional space, such as the end point or intersection point of a two-dimensional or three-dimensional figure.

[0094] 6, fragment shader: a program used to process color or lighting data per fragment. GPU can handle multiple fragments in parallel, and a fragment can also be understood as a pixel unit.

[0095] Figure 2 is a schematic diagram of an implementation environment provided by an embodiment of the present application, referring to Figure 2The implementation environment includes a terminal 201 and a server 202, and the terminal 201 and the server 202 can be directly or indirectly connected through wired or wireless communication. The server 202 is configured to provide an electronic map to the terminal 201, and the terminal 201 is configured to draw a route connected by a plurality of position points in the electronic map.

[0096] In a possible implementation, the terminal 201 is installed with a target application provided by the server 202, and the terminal 201 can implement functions such as displaying an electronic map and drawing a navigation route through the target application. Optionally, the target application is a target application in an operating system of the terminal 201 or a target application provided by a third party. For example, the target application is an electronic map application. Optionally, the server 202 is a background server of the target application or a cloud server providing cloud computing, cloud storage and the like.

[0097] In a possible implementation, the terminal 201 can be a smart phone, a tablet computer, a notebook computer, a desktop computer, a smart speaker, a smart voice interaction device, a smart watch, a vehicle-mounted terminal, and the like, but is not limited thereto. The server 202 can be a standalone physical server, a server cluster or a distributed system composed of a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs (Content Delivery Networks), and basic cloud computing services such as big data and artificial intelligence platforms.

[0098] Figure 3 is a flowchart of a route drawing method provided by an embodiment of the present application. The execution subject of the embodiment of the present application is a computer device, and the computer device is shown in Figure 3 The method comprises the following steps.

[0099] 301. The computer device determines a plurality of position points in an electronic map.

[0100] The electronic map is a map stored in a digital manner by using computer technology. The electronic map has a first longitude coordinate range and a target longitude coordinate range, and the first longitude coordinate range and the target longitude coordinate range are determined in different longitude coordinate systems. Therefore, although the first longitude coordinate range and the target longitude coordinate range are both used to represent a geographical area in the electronic map, the first longitude coordinate range and the target longitude coordinate range are not the same.

[0101] The electronic map includes position points in any one or more geographical areas. Since the electronic map has the first longitude coordinate range and the target longitude coordinate range, the position points in the electronic map can be described by longitude coordinates in the first longitude coordinate range or by longitude coordinates in the target longitude coordinate range.

[0102] In the embodiments of the present application, the computer device determines a plurality of position points in the electronic map, and the longitude coordinates of the plurality of position points belong to the first longitude coordinate range.

[0103] 302. When the absolute value of the difference between the longitude coordinates of adjacent position points in the plurality of position points is greater than the first value, the computer device converts the longitude coordinates of the plurality of position points that do not belong to the target longitude coordinate range to the target longitude coordinate range.

[0104] The first value is the maximum value in the first longitude coordinate range, that is, the maximum longitude coordinate. Since the electronic map is used to describe the area on the earth, and the earth is a sphere, the meridian where the minimum longitude coordinate in the electronic map is located coincides with the meridian where the maximum longitude coordinate is located. If the absolute value of the difference between the longitude coordinates of adjacent position points is greater than the first value, it indicates that the two adjacent position points are located on the two sides of the meridians where the minimum longitude coordinate and the maximum longitude coordinate are located, and the shortest route between the two position points should be a curve that crosses the meridians where the minimum longitude coordinate and the maximum longitude coordinate are located.

[0105] However, since the curve needs to be drawn according to the order of longitude coordinates in the electronic map, the curve that crosses the meridians where the minimum longitude coordinate and the maximum longitude coordinate are located cannot be drawn, resulting in an incorrect route. Therefore, in this case, the computer device converts the longitude coordinates of the plurality of position points that do not belong to the target longitude coordinate range to the target longitude coordinate range, so as to change the longitude coordinates of the meridians that the route between the two position points crosses.

[0106] It should be noted that since the electronic map has a plurality of longitude coordinate ranges, a position point can be described by longitude coordinates in different longitude coordinate ranges. Therefore, the conversion of longitude coordinates in the embodiments of the present application means converting the longitude coordinates in one longitude coordinate range that are used to describe a position point to longitude coordinates in another longitude coordinate range that are also used to describe the position point.

[0107] 303. The computer device draws the route connected by the plurality of position points in the electronic map according to the order of the converted longitude coordinates.

[0108] The computer device converts longitude coordinates of the multiple position points that do not belong to the target longitude coordinate range to the target longitude coordinate range, changes longitude coordinates corresponding to the meridian line that the route between the two position points passes through, and then draws the shortest route connecting the multiple position points according to the converted longitude coordinates.

[0109] The method provided in the embodiments of the present application can change the longitude coordinates corresponding to the meridian line that the route between the two position points passes through, and then draw the shortest route connecting the multiple position points according to the converted longitude coordinates, thereby improving the accuracy of route drawing.

[0110] Figure 4 FIG. 1 is a flowchart of another route drawing method provided in the embodiments of the present application, and the execution subject of the embodiments of the present application is a computer device. As shown in FIG. 1, the method comprises the following steps. Figure 4

[0111] 401. The computer device displays an electronic map.

[0112] In the embodiments of the present application, the electronic map has multiple longitude coordinate ranges, and the multiple longitude coordinate ranges are determined under different longitude coordinate systems. Therefore, although the multiple longitude coordinate ranges are all used to represent geographical areas in the electronic map, the multiple longitude coordinate ranges are not the same.

[0113] 402. The computer device determines multiple position points in the electronic map.

[0114] The multiple position points include a starting point, an ending point, and a passing point between the starting point and the ending point. The computer device obtains longitude coordinates of the multiple position points, and the longitude coordinates of the multiple position points belong to a first longitude coordinate range in the multiple longitude coordinate ranges. The first longitude coordinate range includes positive numbers and negative numbers. In the embodiments of the present application, the first longitude coordinate range is taken as a longitude coordinate range from -180 degrees to 180 degrees, and in other embodiments, the first longitude coordinate range can also be other longitude coordinate ranges, which are not limited in the embodiments of the present application.

[0115] ​403、The computer device determines a second longitude coordinate range corresponding to the target map region based on the target map region currently displayed in the electronic map.

[0116] The computer device can display the entire electronic map or only a partial region of the electronic map when displaying the electronic map, and thus the computer device determines a target map region currently displayed in the electronic map. The computer device determines a second longitude coordinate range corresponding to the target map region currently displayed, the second longitude coordinate range being used to describe the target map region, and the longitude coordinates in the second longitude coordinate range are sequentially increasing.

[0117] For example, the second longitude coordinate range is "-45 degrees-0 degrees-45 degrees" or "160 degrees-180 degrees-200 degrees", but not "160 degrees-180 degrees / -180 degrees- -160 degrees".

[0118] 404、The computer device converts, for each two adjacent location points in the plurality of location points, a longitude coordinate not belonging to the target longitude coordinate range to the target longitude coordinate range if an absolute value of a difference between the longitude coordinates of the two location points is greater than a first value.

[0119] The computer device sequentially traverses each two adjacent location points in the plurality of location points, and for the currently traversed two adjacent location points, the computer device determines an absolute value of a difference between the longitude coordinates of the two location points. If the absolute value is greater than a first value, i.e., greater than a maximum value in the first longitude coordinate range, the obtained curve will be incorrect if directly drawn based on the longitude coordinates of the two location points as described in step 302. Therefore, the computer device determines a longitude coordinate not belonging to the target longitude coordinate range from the longitude coordinates of the two location points, and converts the longitude coordinate not belonging to the target longitude coordinate range to the target longitude coordinate range, so that the longitude coordinates of the two location points both belong to the target longitude coordinate range.

[0120] In a possible implementation, the first longitude coordinate range includes a first sub-range and a second sub-range, and the target longitude coordinate range includes the second sub-range and a third sub-range. The first longitude coordinate range and the second longitude coordinate range include the coinciding second sub-range, the longitude coordinates of the plurality of location points belong to the first longitude coordinate range, and therefore, among the longitude coordinates of the plurality of location points, the longitude coordinates that do not belong to the second sub-range are the coordinates that do not belong to the target longitude coordinate range, and it is only necessary to convert the longitude coordinates that belong to the first sub-range to the third sub-range in the target longitude coordinate range. The conversion of the longitude coordinates that do not belong to the target longitude coordinate range to the target longitude coordinate range includes the following two cases.

[0121] (1) The maximum value in the third sub-range is greater than the maximum value in the first sub-range, and the computer device adds a second value to the longitude coordinates of the plurality of location points that do not belong to the second sub-range.

[0122] If the maximum value in the third sub-range is greater than the maximum value in the first sub-range, it indicates that the longitude coordinate in the third sub-range corresponding to the same location point is greater than the longitude coordinate in the first sub-range corresponding to the location point, and therefore, in order to convert the longitude coordinate that belongs to the first sub-range to the third sub-range, it is necessary to add a value.

[0123] The second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range. That is, the longitude coordinate in the third sub-range corresponding to the same location point is greater than the longitude coordinate in the first sub-range corresponding to the location point by the second value, and therefore, the longitude coordinate that belongs to the first sub-range is added by the second value, to obtain the longitude coordinate converted to the target longitude coordinate range.

[0124] (2) The maximum value in the third sub-range is less than the maximum value in the first sub-range, and the computer device subtracts a second value from the longitude coordinates of the plurality of location points that do not belong to the second sub-range.

[0125] If the maximum value in the third sub-range is less than the maximum value in the first sub-range, it indicates that the longitude coordinate in the third sub-range corresponding to the same location point is less than the longitude coordinate in the first sub-range corresponding to the location point, and therefore, in order to convert the longitude coordinate that belongs to the first sub-range to the third sub-range, it is necessary to subtract a value.

[0126] The second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range. That is, the longitude coordinate in the third sub-range corresponding to the same location point is less than the longitude coordinate in the first sub-range corresponding to the location point by the second value, and therefore, the longitude coordinate that belongs to the first sub-range is subtracted by the second value, to obtain the longitude coordinate converted to the target longitude coordinate range.

[0127] 405、If the absolute value of the difference between the longitude coordinates of the two position points is not greater than the first value, and the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, the computer device converts the longitude coordinates of the two position points to the target longitude coordinate range.

[0128] If the absolute value of the difference between the longitude coordinates of the two position points is not greater than the first value, the shortest route between the two position points will not cross the curve of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located. The computer device determines whether the longitude coordinates of the two position points belong to the target longitude coordinate range and whether the longitude coordinates of the two position points belong to the second longitude coordinate range.

[0129] If the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, it means that the two position points are located on the same side as the position points whose longitude coordinates are converted in step 404. If the longitude coordinates of the two position points are still kept unchanged, an error will occur when drawing the curve connected by the two position points and the position points whose longitude coordinates are converted in step 404. Therefore, the computer device also converts the longitude coordinates of the two position points to the target longitude coordinate range.

[0130] If the longitude coordinates of the two position points do not belong to the target longitude coordinate range but belong to the second longitude coordinate range, if the longitude coordinates of the two position points are converted to the target longitude coordinate range, the longitude coordinates of the two position points will not belong to the second longitude coordinate range, thereby affecting the route connected by the two position points and other position points in the second longitude coordinate range. Therefore, in this case, the computer device does not need to perform the step of converting the longitude coordinates of the two position points to the target longitude coordinate range.

[0131] If the longitude coordinates of the two position points belong to the target longitude coordinate range, the computer device does not need to perform the step of converting the longitude coordinates of the two position points to the target longitude coordinate range.

[0132] In a possible implementation, the first longitude coordinate range includes a first sub-range and a second sub-range, and the target longitude coordinate range includes the second sub-range and a third sub-range. Converting the longitude coordinates of the two position points to the target longitude coordinate range includes the following two cases.

[0133] (1) The maximum value in the third sub-range is greater than the maximum value in the first sub-range. If the longitude coordinates of the two position points do not belong to the second sub-range and do not belong to the second longitude coordinate range, the longitude coordinates of the two position points are added by the second value.

[0134] (2) If the maximum value in the third sub-range is less than the maximum value in the first sub-range, and if the longitude coordinates of the two position points do not belong to the second sub-range and do not belong to the second longitude coordinate range, then the longitude coordinates of the two position points are reduced by the second value.

[0135] The second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range. The conversion of the longitude coordinates in step 404 is similar and will not be repeated here.

[0136] In the embodiments of the present application, by performing steps 404-405, the longitude coordinates of the multiple position points that do not belong to the target longitude coordinate range are converted to the target longitude coordinate range when the absolute value of the difference between the longitude coordinates of the adjacent position points in the multiple position points is greater than the first value.

[0137] 406. The computer device draws the route formed by connecting the multiple position points in the electronic map according to the order of the converted longitude coordinates.

[0138] Since the computer device has converted the longitude coordinates of the multiple position points that do not belong to the target longitude coordinate range to the target longitude coordinate range, the longitude coordinates corresponding to the meridian line traversed by the route between the two position points are changed, so the correct shortest route can be drawn in the electronic map according to the order of the converted longitude coordinates.

[0139] In a possible implementation, the computer device draws the curve formed by connecting the multiple position points in the electronic map according to the order of the converted longitude coordinates from large to small, or according to the order of the converted longitude coordinates from small to large, to obtain the route between the start point and the end point.

[0140] Figure 5 is a schematic diagram of a route provided by the embodiments of the present application, as shown in Figure 5 The start point is point A and the end point is point B, and there are multiple passing points between point A and point B, which are point C1, point C2 and point C3. The computer device connects the adjacent two position points in order according to the order of the converted longitude coordinates to obtain the polyline segment between the two position points, and the route between point A and point B is essentially formed by splicing the polyline segments between each two position points.

[0141] In a possible implementation manner, the computer device includes a graphics processor including a vertex shader and a fragment shader, the computer device obtains coordinates of the plurality of position points through the vertex shader, the coordinates of the position points include longitude coordinates and latitude coordinates, and the vertex shader is configured to convert the longitude coordinates of the position points, and the converted longitude coordinates and the latitude coordinates are transmitted to the fragment shader, and then the fragment shader is configured to rasterize data between the plurality of position points according to the longitude coordinates and the latitude coordinates, complete pixel-level curve rendering, and draw the route between the start point and the end point on the electronic map, so that the route visualization effect is achieved.

[0142] The method provided in the embodiments of the present application can indicate that the two adjacent position points are located on two sides of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located in the case that the absolute value of the difference between the longitude coordinates of the adjacent position points is greater than the maximum value of the first longitude coordinate range. If the route is directly drawn according to the longitude coordinates, the drawn route may be incorrect. Therefore, in order to draw a correct route, the longitude coordinates of the plurality of position points that do not belong to the target longitude coordinate range are converted to the target longitude coordinate range, so that the longitude coordinates of the plurality of position points all belong to the target longitude coordinate range, so as to change the longitude coordinates of the meridian that the route between the two position points passes through. At this time, the shortest route connected by the plurality of position points can be drawn according to the converted longitude coordinates, and the accuracy of route drawing is improved.

[0143] In addition, the first longitude coordinate range and the target longitude coordinate range have a second sub-range that overlaps, and the first sub-range in the first longitude coordinate range does not overlap with the second sub-range in the target longitude coordinate range. Therefore, the longitude coordinates belonging to the first sub-range are converted to the second range by adding or subtracting the second value, so as to provide a longitude coordinate conversion manner, which can ensure that the longitude coordinates before conversion and the longitude coordinates after conversion indicate the same position, that is, the accuracy of longitude coordinate conversion is ensured.

[0144] In addition, if the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, it indicates that the two position points are located on the same side as the position points whose longitude coordinates have been converted. Therefore, the longitude coordinates of the two position points are also converted to the target longitude coordinate range, so as to ensure that the route connected by the two position points and the position points whose longitude coordinates have been converted is not incorrect, and the accuracy of route drawing is further improved.

[0145] In addition, in the embodiments of the present application, the longitude coordinates of at least one position point in the plurality of position points are converted, so that the correct route can be drawn. Since the processing manner is relatively simple, excessive processing resources are not wasted, and the efficiency of route drawing is ensured.

[0146] In another route drawing method provided by the embodiments of the present application, the first longitude coordinate range includes positive numbers and negative numbers, and the target longitude coordinate range does not include positive numbers or negative numbers.

[0147] Since the first longitude coordinate range includes positive numbers and negative numbers, the minimum longitude coordinate is a negative number and the maximum longitude coordinate is a positive number. Therefore, one side of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located is positive, and the other side is negative. If the absolute value of the difference between the longitude coordinates of the adjacent position points is greater than the first value, it indicates that the two adjacent position points are located on the two sides of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located, one position point has a positive longitude coordinate and the other position point has a negative longitude coordinate, and the shortest route between the two position points should be a curve crossing the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located, instead of a curve crossing the 0-degree meridian. However, since the curve needs to be drawn according to the order of longitude coordinates in the electronic map, and one position point has a positive longitude coordinate and the other position point has a negative longitude coordinate among the adjacent two position points, the curve crossing the 0-degree meridian is obtained during drawing, instead of the curve crossing the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located, resulting in that the drawn shortest route is incorrect.

[0148] Therefore, in this case, the computer device adopts the method provided by the embodiments of the present application to convert the longitude coordinates of the plurality of position points that do not belong to the target longitude coordinate range to the target longitude coordinate range. Since the target longitude coordinate range does not include positive numbers or negative numbers, there is no case that one of the converted longitude coordinates is positive and the other is negative. At this time, the correct shortest route can be drawn according to the converted longitude coordinates, and the accuracy of route drawing is improved.

[0149] For example, the first longitude coordinate range is from -180 degrees to 180 degrees, the target longitude coordinate range is from 0 degrees to 360 degrees, or the target longitude coordinate range is from -360 degrees to 0 degrees, etc. Since the first longitude coordinate range includes positive numbers and negative numbers, the minimum longitude coordinate is a negative number and the maximum longitude coordinate is a positive number. Therefore, one side of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located is positive, and the other side is negative.

[0150] For example, the first longitude coordinate range is from -180 degrees to 180 degrees, the target longitude coordinate range is from 0 degrees to 360 degrees, or the target longitude coordinate range is from -360 degrees to 0 degrees, etc. Since the first longitude coordinate range includes positive numbers and negative numbers, the minimum longitude coordinate is a negative number and the maximum longitude coordinate is a positive number. Therefore, one side of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located is positive, and the other side is negative. Figure 6 and Figure 7The electronic map shown, the longitude coordinate of west longitude is negative, the longitude coordinate of east longitude is positive, the -180 degree meridian coincides with the 180 degree meridian, the 180 degree meridian is positive on one side and negative on the other side. If the absolute value of the difference between the longitude coordinates of two adjacent position points is greater than 180 degrees, it means that the longitude coordinates of the two position points are positive and negative, and the two position points are closer to the 180 degree meridian than to the 0 degree meridian. As shown in Figure 6 and Figure 7 As an example, the longitude of point A is 135 degrees and the longitude of point B is -135 degrees, the shortest route between point A and point B should be a curve crossing the 180 degree meridian, but in the actual drawing process, if the curve between two position points is drawn directly according to the order of the longitude coordinates, a curve crossing the 0 degree meridian will be obtained, which is obviously incorrect. Figure 6 and Figure 7 As an example, the longitude of point A is 135 degrees and the longitude of point B is -135 degrees, the shortest route between point A and point B should be a curve crossing the 180 degree meridian, but in the actual drawing process, if the curve between two position points is drawn directly according to the order of the longitude coordinates, a curve crossing the 0 degree meridian will be obtained, which is obviously incorrect.

[0151] Figure 8 is a flowchart of another route drawing method provided by an embodiment of the present application, and the execution subject of the embodiment of the present application is a computer device. In the embodiment of the present application, the first longitude coordinate range is the longitude coordinate range from -180 degrees to 180 degrees, the target longitude coordinate range is the longitude coordinate range from 0 degrees to 360 degrees, the first sub-range is the range from -180 degrees to 0 degrees, the second sub-range is the range from 0 degrees to 180 degrees, the third sub-range is the range from 180 degrees to 360 degrees, the first value is 180 degrees, and the second value is 360 degrees. Referring to Figure 8 , the method comprises:

[0152] 801, the computer device displays an electronic map.

[0153] 802, the computer device determines a plurality of position points in the electronic map.

[0154] 803, the computer device determines a second longitude coordinate range corresponding to a target map region based on the target map region currently displayed in the electronic map.

[0155] The processes of steps 801-803 are the same as those of steps 401-403 described above, and will not be repeated here.

[0156] 804, the computer device determines the longitude coordinate of the center point of the target map region based on the target map region currently displayed in the electronic map.

[0157] The computer device determines a target map region currently displayed in the electronic map, and determines a longitude coordinate of a center point of the target map region. The longitude coordinate of the center point belongs to the first longitude coordinate range. Since the first longitude coordinate range includes positive numbers and negative numbers, the longitude coordinate of the center point can be greater than 0 degrees or can not be greater than 0 degrees.

[0158] 805、In a case where the longitude coordinate of the center point is greater than 0 degrees, the computer device determines a longitude coordinate range from 0 degrees to 360 degrees as a target longitude coordinate range.

[0159] The computer device determines whether the longitude coordinate of the center point is greater than 0 degrees. In a case where the longitude coordinate of the center point is greater than 0 degrees, the computer device determines a longitude coordinate range from 0 degrees to 360 degrees as a target longitude coordinate range from among a plurality of longitude coordinate ranges possessed by the electronic map. Therefore, the target longitude coordinate range does not include negative numbers.

[0160] 806、The computer device adds 360 degrees to a longitude coordinate that does not belong to the target longitude coordinate range from among longitude coordinates of two adjacent position points in a case where an absolute value of a difference between the longitude coordinates of the two position points is greater than 180 degrees.

[0161] The computer device sequentially traverses each two adjacent position points from among the plurality of position points. For the currently traversed two adjacent position points, the computer device determines an absolute value of a difference between longitude coordinates of the two position points. In a case where the absolute value is greater than 180 degrees, a curve obtained by directly drawing based on the longitude coordinates of the two position points will be erroneous. Therefore, the computer device adds 360 degrees to a longitude coordinate that does not belong to the target longitude coordinate range from among longitude coordinates of the two position points. That is, the computer device adds 360 degrees to a longitude coordinate less than 0 degrees, thereby converting to the target longitude coordinate range so that the longitude coordinates of the two position points both belong to the target longitude coordinate range. Since the target longitude coordinate range in the embodiment of the present application does not include negative numbers, the converted longitude coordinates do not have a case where one is a positive number and the other is a negative number.

[0162] Since the electronic map is used to represent a region on the earth, and the earth can be regarded as a 360-degree sphere, the longitude coordinate of a position point is added by 360 degrees. The obtained longitude coordinate still represents the position point, and only the value of the longitude coordinate is changed. Therefore, the position point is not misplaced while the longitude coordinate is converted.

[0163] 807、If the absolute value of the difference between the longitude coordinates of the two position points is not greater than 180 degrees, and the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, the computer device adds 360 degrees to the longitude coordinates of the two position points.

[0164] If the absolute value of the difference between the longitude coordinates of the two position points is not greater than 180 degrees, the shortest route between the two position points will not cross the 180-degree meridian. The computer device determines whether the longitude coordinates of the two position points belong to the target longitude coordinate range and whether the longitude coordinates of the two position points belong to the second longitude coordinate range.

[0165] If the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, it means that the two position points are on the same side as the position point whose longitude coordinate is converted in step 806. If the longitude coordinates of the two position points are still kept unchanged, an error will occur when drawing the curve connected by the two position points and the position point whose longitude coordinate is converted in step 806. Therefore, the computer device adds 360 degrees to the longitude coordinates of the two position points, so as to be converted to the target longitude coordinate range.

[0166] For example, the two position points in step 806 are A1 and B1, the longitude coordinate of A1 is 170 degrees, the longitude coordinate of B1 is -170 degrees, the target longitude coordinate range is the longitude coordinate range from 0 degrees to 360 degrees, and the second longitude coordinate range is “150 degrees-180 degrees-210 degrees”. The two position points in step 807 are C1 and D1, the longitude coordinate of C1 is -160 degrees, and the longitude coordinate of D1 is -150 degrees. The longitude coordinates of C1 and D1 do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range. If direct drawing is performed without coordinate conversion, the route between A1 and B1 will be incorrect, and the route connected by B1, C1 and D1 will not be incorrect. However, by using the method provided in the embodiment of the present application, the longitude coordinate of B1 is added by 360 degrees to obtain 190 degrees. At this time, if the coordinates of C1 and D1 are still kept unchanged, although the route between A1 and B1 will not be incorrect, the route connected by B1, C1 and D1 will be incorrect. Therefore, in order to ensure the accuracy of the route, the computer device also adds 360 degrees to the longitude coordinates of C1 and D1. At this time, the longitude coordinates of A1, B1, C1 and D1 are 170 degrees, 190 degrees, 200 degrees and 210 degrees respectively. According to the order of the longitude coordinates, the route connected by A1, B1, C1 and D1 will not be incorrect.

[0167] If the longitude coordinates of the two position points do not belong to the target longitude coordinate range but belong to the second longitude coordinate range, if the longitude coordinates of the two position points are converted to the target longitude coordinate range, the longitude coordinates of the two position points will not belong to the second longitude coordinate range, thereby affecting the route connected by the two position points and other position points in the second longitude coordinate range, and therefore, in this case, the computer device does not need to perform the step of converting the longitude coordinates of the two position points to the target longitude coordinate range.

[0168] For example, the target longitude coordinate range is a longitude coordinate range from 0 degree to 360 degree, the second longitude coordinate range is “-40 degree-0 degree-40 degree”, the two position points in step 807 are E1 point and F1 point, the longitude coordinate of E1 point is -30 degree, the longitude coordinate of F1 point is -20 degree, the longitude coordinates of E1 point and F1 point do not belong to the target longitude coordinate range but belong to the second longitude coordinate range. The second longitude coordinate range also includes G1 point, and the longitude coordinate of G1 point is 10 degree. At this time, if the route connected by E1 point, F1 point and G1 point is directly drawn, no error will occur. However, if the computer device converts the coordinates of E1 point and F1 point to the target longitude coordinate range, that is, adds 360 degrees to the coordinates of E1 point and F1 point, at this time, the longitude coordinates of E1 point, F1 point and G1 point are 330 degree, 340 degree and 10 degree respectively, although the route between E1 point and F1 point will not be wrong, the route between F1 point and G1 point will be wrong, and therefore, in this case, the computer device will not convert the longitude coordinates of E1 point and F1 point.

[0169] If the longitude coordinates of the two position points belong to the target longitude coordinate range, the computer device does not need to perform the step of converting the longitude coordinates of the two position points to the target longitude coordinate range.

[0170] Figure 9 is a flowchart of a coordinate conversion method provided by an embodiment of the present application, wherein the first longitude coordinate range is a longitude coordinate range from -180 degree to 180 degree, and the target longitude coordinate range is a longitude coordinate range from 0 degree to 360 degree. Referring to Figure 9 , the method comprises the following steps.

[0171] 901. The computer device acquires longitude coordinates of a plurality of position points.

[0172] 902. The computer device determines whether the longitude coordinate of the center point of the target map region is greater than 0 degree, Figure 7 The longitude coordinate of the center point of the target map region is greater than 0 degree is taken as an example for description.

[0173] 903、the computer device determines whether the absolute value of the difference between the longitude coordinates of two adjacent position points in the plurality of position points is greater than 180 degrees, and if yes, step 904 is performed, and if no, step 905 is performed.

[0174] 904、the computer device adds 360 degrees to the longitude coordinate less than 0 degrees in the longitude coordinates of the two position points.

[0175] 905、the computer device determines whether the longitude coordinates of the two position points are both less than 0 degrees and both outside the screen, and if yes, step 906 is performed, and if no, no processing is performed. The position point outside the screen refers to the longitude coordinate of the position point not belonging to the second longitude coordinate range corresponding to the currently displayed target map region.

[0176] 906、the computer device adds 360 degrees to the longitude coordinates of the two position points.

[0177] 808、the computer device draws the route connected by the plurality of position points in the electronic map according to the converted longitude coordinates.

[0178] The method provided by the embodiment of the present application considers that in the case that the longitude coordinate of the center point is greater than 0 degrees, there are more position points with longitude coordinates greater than 0 degrees in the currently displayed target map region, and thus the longitude coordinate range from 0 degrees to 360 degrees is determined as the target longitude coordinate range, thereby reducing the number of position points in the plurality of position points not belonging to the target longitude coordinate range, i.e., reducing the number of position points needing coordinate conversion, thereby reducing the operation amount in the route drawing process, and being beneficial to improving the efficiency of route drawing.

[0179] Figure 10 is a flowchart of another route drawing method provided by the embodiment of the present application, and the execution subject of the embodiment of the present application is a computer device. In the embodiment of the present application, the first longitude coordinate range is the longitude coordinate range from -180 degrees to 180 degrees, the target longitude coordinate range is the longitude coordinate range from -360 degrees to 0 degrees, the first sub-range is the range from 0 degrees to 180 degrees, the second sub-range is the range from -180 degrees to 0 degrees, the third sub-range is the range from -360 degrees to -180 degrees, the first value is 180 degrees, and the second value is 360 degrees. The route drawing method is described below with reference to Figure 10 , which comprises the following steps.

[0180] 1001、the computer device displays an electronic map.

[0181] 1002、the computer device determines a plurality of position points in the electronic map.

[0182] 1003. The computer device determines a second longitude coordinate range corresponding to the target map region based on the target map region currently displayed in the electronic map.

[0183] The steps 1001-1003 are the same as the steps 401-403 described above, and thus will not be repeated here.

[0184] 1004. The computer device determines a longitude coordinate of a center point of the target map region based on the target map region currently displayed in the electronic map.

[0185] 1005. The computer device determines the target longitude coordinate range as a longitude coordinate range from -360 degrees to 0 degrees in a case where the longitude coordinate of the center point is not greater than 0 degrees.

[0186] The computer device determines whether the longitude coordinate of the center point is greater than 0 degrees. If the longitude coordinate of the center point is not greater than 0 degrees, the computer device determines the longitude coordinate range from -360 degrees to 0 degrees as the target longitude coordinate range from among a plurality of longitude coordinate ranges possessed by the electronic map, and thus the target longitude coordinate range does not include positive numbers.

[0187] 1006. The computer device reduces, by 360 degrees, a longitude coordinate that does not belong to the target longitude coordinate range from among longitude coordinates of each two adjacent position points in the plurality of position points in a case where an absolute value of a difference between the longitude coordinates of the two position points is greater than 180 degrees.

[0188] The computer device sequentially traverses each two adjacent position points in the plurality of position points. For the currently traversed two adjacent position points, the computer device determines an absolute value of a difference between the longitude coordinates of the two position points. If the absolute value is greater than 180 degrees, a curve obtained by directly drawing based on the longitude coordinates of the two position points will be incorrect. Thus, the computer device reduces, by 360 degrees, a longitude coordinate that does not belong to the target longitude coordinate range from among the longitude coordinates of the two position points, that is, reduces, by 360 degrees, a longitude coordinate greater than 0 degrees, thereby converting to the target longitude coordinate range so that the longitude coordinates of the two position points both belong to the target longitude coordinate range. Since the target longitude coordinate range in the embodiment of the present application does not include positive numbers, the converted longitude coordinates do not have a case where one is positive and the other is negative.

[0189] Since the electronic map is used to represent a region on the earth, and the earth can be regarded as a 360-degree sphere, the longitude coordinate of a position point reduced by 360 degrees still represents the position point, and only the value of the longitude coordinate is changed. Thus, the position point is not misplaced while the longitude coordinate is converted.

[0190] 1007、If the absolute value of the difference between the longitude coordinates of the two position points is not greater than 180 degrees, and the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, the computer device reduces the longitude coordinates of the two position points by 360 degrees.

[0191] If the absolute value of the difference between the longitude coordinates of the two position points is not greater than 180 degrees, the shortest route between the two position points will not cross the 180-degree meridian. The computer device determines whether the longitude coordinates of the two position points belong to the target longitude coordinate range and whether the longitude coordinates of the two position points belong to the second longitude coordinate range.

[0192] If the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, it means that the two position points are located on the same side as the position point whose longitude coordinate is converted in step 1006. If the longitude coordinates of the two position points are still kept unchanged, an error will occur when drawing the curve connected by the two position points and the position point whose longitude coordinate is converted in step 1006. Therefore, the computer device reduces the longitude coordinates of the two position points by 360 degrees, thereby converting to the target longitude coordinate range.

[0193] For example, the two position points in step 1006 are A2 and B2, the longitude coordinate of A2 is -170 degrees, the longitude coordinate of B2 is 170 degrees, the target longitude coordinate range is the longitude coordinate range from -360 degrees to 0 degrees, and the second longitude coordinate range is “-210 degrees -180 degrees -150 degrees”. The two position points in step 1007 are C2 and D2, the longitude coordinate of C2 is 160 degrees, and the longitude coordinate of D2 is 150 degrees. The longitude coordinates of C2 and D2 do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range. If direct drawing is performed without coordinate conversion, the route between A2 and B2 will be incorrect, and the route connected by B2, C2 and D2 will not be incorrect. However, by using the method provided in the embodiments of the present application, the longitude coordinate of B2 is reduced by 360 degrees to obtain -190 degrees. At this time, if the coordinates of C2 and D2 are still kept unchanged, although the route between A2 and B2 will not be incorrect, the route connected by B2, C2 and D2 will be incorrect. Therefore, in order to ensure the accuracy of the route, the computer device also reduces the longitude coordinates of C2 and D2 by 360 degrees. At this time, the longitude coordinates of A2, B2, C2 and D2 are -170 degrees, -190 degrees, -200 degrees and -210 degrees respectively. According to the order of the longitude coordinates, the route connected by A2, B2, C2 and D2 will not be incorrect.

[0194] If the longitude coordinates of the two position points do not belong to the target longitude coordinate range but belong to the second longitude coordinate range, if the longitude coordinates of the two position points are converted to the target longitude coordinate range, the longitude coordinates of the two position points will not belong to the second longitude coordinate range, thereby affecting the route connected by the two position points and other position points in the second longitude coordinate range, and therefore, in this case, the computer device does not need to perform the step of converting the longitude coordinates of the two position points to the target longitude coordinate range.

[0195] For example, the target longitude coordinate range is a longitude coordinate range from -360 degrees to 0 degrees, the second longitude coordinate range is "-40 degrees - 0 degrees - 40 degrees", the two position points in step 1007 are E2 and F2, the longitude coordinate of E2 is 30 degrees, the longitude coordinate of F2 is 20 degrees, and the longitude coordinates of E2 and F2 do not belong to the target longitude coordinate range but belong to the second longitude coordinate range. The second longitude coordinate range also includes G2, and the longitude coordinate of G2 is -10 degrees. At this time, if the route connected by E2, F2 and G2 is directly drawn, no error will occur. However, if the computer device converts the coordinates of E2 and F2 to the target longitude coordinate range, that is, reduces 360 degrees, the longitude coordinates of E2, F2 and G2 are -330 degrees, -340 degrees and -10 degrees respectively, although the route between E2 and F2 will not be wrong, the route between F2 and G2 will be wrong, and therefore, in this case, the computer device will not convert the longitude coordinates of E2 and F2.

[0196] If the longitude coordinates of the two position points belong to the target longitude coordinate range, the computer device does not need to perform the step of converting the longitude coordinates of the two position points to the target longitude coordinate range.

[0197] Figure 11 is a flowchart of another coordinate conversion method provided by the embodiment of the present application, wherein the first longitude coordinate range is a longitude coordinate range from -180 degrees to 180 degrees, and the target longitude coordinate range is a longitude coordinate range from -360 degrees to 0 degrees. Referring to Figure 11 , the method comprises the following steps.

[0198] 1101. The computer device acquires longitude coordinates of a plurality of position points.

[0199] 1102. The computer device determines whether the longitude coordinate of the center point of the target map area is greater than 0 degrees, Figure 11 For example, the longitude coordinate of the center point of the target map area is not greater than 0 degrees.

[0200] 1103、The computer device determines whether the absolute value of the difference between the longitude coordinates of two adjacent position points in the plurality of position points is greater than 180 degrees, and if yes, step 1104 is performed, and if no, step 1105 is performed.

[0201] 1104、The computer device subtracts 360 degrees from the longitude coordinate greater than 0 degrees among the longitude coordinates of the two position points.

[0202] 1105、The computer device determines whether the longitude coordinates of the two position points are both less than 0 degrees and both outside the screen, and if yes, step 1106 is performed, and if no, no processing is performed. The position point outside the screen refers to the longitude coordinate of the position point not belonging to the second longitude coordinate range corresponding to the currently displayed target map region.

[0203] 1106、The computer device subtracts 360 degrees from the longitude coordinates of the two position points.

[0204] 1008、The computer device draws the route connected by the plurality of position points in the electronic map according to the order of the converted longitude coordinates.

[0205] The method provided by the embodiment of the present application considers that in the case that the longitude coordinate of the center point is less than 0 degrees, there are many position points with longitude coordinates less than 0 degrees in the currently displayed target map region, and thus the longitude coordinate range from -360 degrees to 0 degrees is determined as the target longitude coordinate range, thereby reducing the number of position points not belonging to the target longitude coordinate range in the plurality of position points, i.e., reducing the number of position points needing coordinate conversion, thereby reducing the operation amount in the route drawing process and being beneficial to improving the efficiency of route drawing.

[0206] Figure 12 is a flowchart of still another route drawing method provided by the embodiment of the present application. The execution subject of the embodiment of the present application is a computer device, and the method comprises the following steps. Figure 12

[0207] 1201、The computer device displays an electronic map.

[0208] 1202、The computer device determines a plurality of position points in the electronic map.

[0209] 1203、The computer device converts the longitude coordinate not belonging to the target longitude coordinate range to the target longitude coordinate range in the case that the absolute value of the difference between the longitude coordinates of two adjacent position points in the plurality of position points is greater than a first value.

[0210] ​The steps 1201-1203 are the same as the steps 401-405, the steps 801-807 or the steps 1001-1007, and will not be repeated here.

[0211] 1204. The computer device changes the latitude coordinate of each location point in the plurality of location points to the maximum latitude coordinate of the electronic map if the latitude coordinate of the location point is greater than the maximum latitude coordinate of the electronic map.

[0212] The computer device also obtains the latitude coordinate of each location point and the maximum latitude coordinate of the electronic map. The computer device sequentially traverses each location point in the plurality of location points. For the currently traversed location point, if the latitude coordinate of the location point is greater than the maximum latitude coordinate of the electronic map, the location point cannot be plotted on the electronic map by the subsequent computer device, resulting in that the route between the location point and other location points cannot be plotted or is incomplete when plotting the route between the start point and the end point. Therefore, the computer device changes the latitude coordinate of the location point to the maximum latitude coordinate of the electronic map, so that the location point and the route between the location point and other location points can be plotted on the electronic map by the subsequent computer device, thereby providing the visualization effect of route plotting.

[0213] 1205. The computer device changes the latitude coordinate of each location point in the plurality of location points to the minimum latitude coordinate of the electronic map if the latitude coordinate of the location point is less than the minimum latitude coordinate of the electronic map.

[0214] If the latitude coordinate of the location point is less than the minimum latitude coordinate of the electronic map, the location point cannot be plotted on the electronic map by the subsequent computer device, resulting in that the route between the location point and other location points cannot be plotted or is incomplete when plotting the route between the start point and the end point. Therefore, the computer device changes the latitude coordinate of the location point to the minimum latitude coordinate of the electronic map, so that the location point and the route between the location point and other location points can be plotted on the electronic map by the subsequent computer device, thereby providing the visualization effect of route plotting.

[0215] The electronic map is obtained by projecting the earth onto a plane, and projecting the surface of a sphere onto a plane will lose some information. For example, the latitude range of the earth is from -90 degrees to 90 degrees, and the electronic map obtained after projection does not include the information of the south and north polar regions of the earth, and the latitude range of the electronic map is from -85 degrees to 85 degrees. If the latitude coordinate of the M point in the plurality of location points is 90 degrees, the computer device changes the latitude coordinate of the M point to 85 degrees, and if the latitude coordinate of the N point in the plurality of location points is -90 degrees, the computer device changes the latitude coordinate of the N point to -85 degrees.

[0216] It should be noted that the embodiments of the present application take the execution of the above steps 1204 and 1205 as an example for illustration, in another embodiment, the computer device can also only execute step 1204, without executing step 1205, or only execute step 1205, without executing step 1204, which is not limited in the embodiments of the present application.

[0217] 1206、The computer device draws the route connected by the plurality of position points in the electronic map according to the order of the converted longitude coordinates.

[0218] The method provided by the embodiments of the present application changes the latitude coordinate of the position point to the maximum latitude coordinate in the case that the latitude coordinate of the position point is greater than the maximum latitude coordinate of the electronic map, so as to draw the position point and the route between the position point and other position points in the electronic map subsequently, thereby improving the visualization effect of the route drawing.

[0219] And, the latitude coordinate of the position point is changed to the minimum latitude coordinate in the case that the latitude coordinate of the position point is less than the minimum latitude coordinate of the electronic map, so as to draw the position point and the route between the position point and other position points in the electronic map subsequently, thereby improving the visualization effect of the route drawing.

[0220] Figure 13 is a flowchart of a position point determination method provided by the embodiments of the present application. The execution subject of the embodiments of the present application is a computer device, in the embodiments of the present application, the plurality of position points include a starting point, an ending point and a passing point between the starting point and the ending point, referring to Figure 13 , the method comprises:

[0221] 1301, the computer device displays an electronic map.

[0222] 1302, the computer device acquires a starting point and an ending point corresponding to a route drawing request in response to the route drawing request based on the electronic map.

[0223] The route drawing request is used to request to draw a route between the starting point and the ending point in the electronic map.

[0224] In a possible implementation manner, the electronic map includes the names of various positions, the route drawing request carries a first position name and a second position name, the first position name indicates the starting point, and the second position name indicates the ending point. The computer device acquires the first position name and the second position name in the route drawing request, queries the starting point corresponding to the first position name and the ending point corresponding to the second position name in the electronic map, and determines the coordinates of the starting point and the coordinates of the ending point, the coordinates including longitude coordinates and latitude coordinates.

[0225] 1303、The computer device determines the target quantity.

[0226] The target quantity indicates a quantity of first passing points determined between the start point and the end point.

[0227] In a possible implementation, the computer device determines a maximum longitude coordinate difference and a maximum latitude coordinate difference of a target map region currently displayed in the electronic map, determines a target longitude coordinate difference between the start point and the end point and a target latitude coordinate difference between the start point and the end point, and determines the target quantity based on the maximum longitude coordinate difference, the maximum latitude coordinate difference, the target longitude coordinate difference, and the target latitude coordinate difference.

[0228] To determine a proper quantity of first passing points between the start point and the end point, the computer device refers to the maximum longitude coordinate difference and the maximum latitude coordinate difference of the target map region currently displayed, and the target longitude coordinate difference and the target latitude coordinate difference between the start point and the end point, and thus the subsequent fitting of the passing points between the start point and the end point according to the obtained target quantity is matched with the size of the currently displayed map region, thereby obtaining a better fitting effect.

[0229] Optionally, the computer device determines the target quantity based on the maximum longitude coordinate difference, the maximum latitude coordinate difference, the target longitude coordinate difference, and the target latitude coordinate difference, including: determining a first ratio between the target longitude coordinate difference and the maximum longitude coordinate difference, and a second ratio between the target latitude coordinate difference and the maximum latitude coordinate difference, and determining the target quantity based on the first ratio and the second ratio. The target quantity is positively correlated with a maximum value of the first ratio and the second ratio.

[0230] For example, the computer device determines the target quantity by using the following formula.

[0231]

[0232] In the formula, Num represents the target quantity, x represents the target longitude coordinate difference, y represents the target latitude coordinate difference, m represents the maximum longitude coordinate difference, n represents the maximum latitude coordinate difference, max(·) represents a maximum value, and [·] represents an integer operation.

[0233] 1304、The computer device determines coordinates of the target quantity of first passing points between the start point and the end point according to coordinates of the start point and coordinates of the end point.

[0234] After the computer device determines the target quantity, the computer device determines coordinates of the target quantity of first passing points between the start point and the end point according to coordinates of the start point and coordinates of the end point. The coordinates include longitude coordinates and latitude coordinates.

[0235] In a possible implementation, the computer device sequentially fits the coordinates of the first passing points between the start point and the end point according to a great circle arc fitting algorithm to obtain the coordinates of the target number of first passing points, and the target number of first passing points are the passing points on the great circle arc between the start point and the end point.

[0236] In another possible implementation, after the computer device obtains the target number of first passing points, the computer device determines the distance between each two adjacent first passing points, and in the case that the distance between the two adjacent first passing points is less than a threshold distance, the computer device discards one of the two first passing points. Since one passing point is still retained, the subsequent drawing effect is not affected, so that the number of passing points is reduced and the calculation amount of route drawing is reduced on the premise of not affecting the drawing effect.

[0237] 1305. The computer device determines, in parallel, coordinates of at least one second passing point between each two adjacent position points from the start point, the end point, and the at least one first passing point according to the coordinates of the two adjacent position points.

[0238] After the computer device determines the start point, the end point, and the first passing points between the start point and the end point, the computer device determines, in parallel, coordinates of at least one second passing point between each two adjacent position points from the plurality of position points according to the coordinates of the two adjacent position points. Therefore, by performing step 1304 and step 1305, the computer device obtains at least one first passing point and at least one second passing point between the start point and the end point.

[0239] The process of determining the first passing points in step 1304 can be regarded as a coarse-precision fitting process, and the process of determining the second passing points in step 1305 can be regarded as a fine-precision fitting process. Since the computer device performs the fitting of the second passing points between each two adjacent position points in parallel in step 1305, a plurality of second passing points can be fitted at the same time. Therefore, the fitting process of the passing points is divided into two stages in the embodiments of the present application, the passing points between the start point and the end point are fitted sequentially in the first stage, and the passing points between adjacent two position points are fitted in parallel in the second stage, so that a plurality of passing points are fitted at the same time, thereby improving the fitting speed of the passing points.

[0240] For example, the start point is point A and the end point is point B, and in the first stage, the computer device fits point C and point D between point A and point B, and at this time, the computer device obtains point A, point C, point D, and point B arranged sequentially. In the second stage, the computer device fits the passing points between point A and point C, the passing points between point C and point D, and the passing points between point D and point B in parallel.

[0241] In the embodiments of the present application, by performing the steps 1304-1305, the coordinates of the passing points between the start point and the end point are determined according to the coordinates of the start point and the coordinates of the end point.

[0242] In a possible implementation, the computer device determines the plurality of passing points between the start point and the end point by cooperation of the central processing unit (CPU) and the graphics processing unit (GPU). Then, as shown in FIG. 14, the steps 1304-1305 can be replaced by the steps 1401-1404. Figure 14

[0243] 1401. The central processing unit determines the coordinates of at least one first passing point between the start point and the end point according to the coordinates of the start point and the coordinates of the end point.

[0244] 1402. The central processing unit stores the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in the memory buffer space.

[0245] Optionally, the coordinates determined by the central processing unit are 64-bit floating-point numerical values, and the central processing unit first converts the coordinates from 64-bit floating-point numerical values to 32-bit floating-point numerical values, and stores the converted coordinates in the memory buffer space.

[0246] 1403. The graphics processing unit obtains the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in the memory buffer space.

[0247] 1404. The graphics processing unit determines the coordinates of at least one second passing point between each two adjacent position points from the start point, the end point and the at least one first passing point according to the coordinates of each two adjacent position points in parallel.

[0248] Considering that the graphics processing unit has the ability to fit position points in parallel, the complex position point fitting operation is transferred to the graphics processing unit, and the fitting speed of the position points is improved by the multi-channel parallel processing of the graphics processing unit.

[0249] Optionally, the graphics processing unit includes a vertex shader and a fragment shader, the computer device performs the position point fitting operation by the vertex shader to obtain the coordinates of at least one second passing point between each two position points. Then, by the vertex shader, the coordinates of at least one position point in the plurality of position points including the start point, the end point, the first passing point and the second passing point are converted by the method in the above embodiments, and the converted coordinates are transmitted into the fragment shader, and the fragment shader draws a curve connected by the plurality of position points in the electronic map according to the coordinates of the plurality of position points, so as to obtain the route between the start point and the end point.​

[0250] The method provided by the embodiments of the present application divides the fitting process of the passing points into two stages, fitting the passing points between the start point and the end point in sequence in the first stage, and fitting the passing points between two adjacent position points in parallel in the second stage, so that the effect of fitting multiple passing points at the same time is achieved, the fitting time of the passing points is shortened, and the fitting speed of the passing points is improved.

[0251] In addition, when determining the number of the first passing points to be fitted, the maximum longitude coordinate difference and the maximum latitude coordinate difference of the currently displayed target map region, and the target longitude coordinate difference and the target latitude coordinate difference between the start point and the end point are referred to, and then the passing points between the start point and the end point are fitted according to the obtained target number, so that the fitting effect is better matched with the size of the currently displayed map region.

[0252] In addition, in the case where the distance between two adjacent first passing points is less than the threshold distance, one of the two first passing points is discarded. Since one passing point is still retained, the subsequent drawing effect is not affected, so that the number of the passing points is reduced, and the calculation amount of route drawing is reduced without affecting the drawing effect.

[0253] The route drawing method provided by the embodiments of the present application can be applied to any scenario of drawing a route in an electronic map.

[0254] For example, in the scenario of drawing the shortest navigation route in an electronic map. Generally, an airplane or a ship navigates according to the shortest navigation route between a start point and an end point, and the shortest navigation route is the great circle route between the start point and the end point. If the start point and the end point cross the 180-degree meridian, there is a sudden change of 180 degrees to -180 degrees between the longitude coordinates of the start point and the end point, one of the longitude coordinates of the start point and the end point is positive, and one is negative, and when the great circle route is drawn according to the size of the longitude coordinates, the position of the drawn route will be offset or disordered.

[0255] Therefore, the route drawing method provided by the embodiments of the present application can be used to convert the longitude coordinate less than 0 in the longitude coordinates of the start point and the end point to a positive number, so that the longitude coordinates of the start point and the end point are all constrained between 0 degrees and 360 degrees, or convert the longitude coordinate greater than 0 in the longitude coordinates of the start point and the end point to a negative number, so that the longitude coordinates of the start point and the end point are all constrained between -360 degrees and 0 degrees, and there is no sudden change between the converted longitude coordinates. Therefore, when the converted longitude coordinates are used for drawing, the correct great circle route can be obtained.

[0256] The route drawing method provided by the embodiments of the present application can include various implementation manners. For example, a route drawing interface is developed in a Web open map engine JavaScript API GL, the route drawing interface is provided with route drawing capability, the route drawing interface is introduced into an API (Application Programming Interface) framework of an electronic map of a terminal, and subsequently the terminal can draw a route by using the route drawing interface. As shown in Figure 15 The route drawing method includes the following steps.

[0257] 1501. The terminal calls a route drawing interface.

[0258] 1502. The terminal inputs data of an electronic map and style data of a route.

[0259] 1503. The terminal requests to draw a great circle arc line between a starting point and an ending point.

[0260] 1504. The terminal displays the great circle arc line drawn between the starting point and the ending point in the electronic map.

[0261] Therefore, the ending point can realize visualization of the great circle arc line between the starting point and the ending point in the electronic map by calling the route drawing interface. For example, a visualization scheme of a flight route of an airplane or a visualization scheme of a sailing route of a ship is provided. For example, the terminal can display the drawn great circle arc line in an interface such as a small program, a webpage or a WebView of an APP (Application).

[0262] Figure 16 is a schematic diagram of an electronic map interface provided by the embodiments of the present application, the electronic map interface displays an electronic map and a plurality of great circle arc lines drawn in the electronic map, as shown in Figure 16 Since the electronic map is obtained by projecting the surface of the earth onto a plane, the great circle arc line between two position points is not a straight line between the two position points, but a curve with an arc. Figure 17 is another schematic diagram of an electronic map interface of the embodiments of the present application, the electronic map interface displays an electronic map and great circle arc lines between various starting points and ending points in historical travels of a user corresponding to a user account, and the historical travel times of the user are 891 times, the historical travel distance of the user is 12316175 kilometers, and the number of cities reached by the user is 38.

[0263] Figure 18 is a structural schematic diagram of a route drawing device provided by the embodiments of the present application. As shown in Figure 18 The device includes:

[0264] The position point determination module 1801 is configured to determine a plurality of position points in an electronic map, the electronic map having a first longitude coordinate range and a target longitude coordinate range, and longitude coordinates of the plurality of position points belonging to the first longitude coordinate range.

[0265] The coordinate conversion module 1802 is configured to, when an absolute value of a difference between longitude coordinates of adjacent position points in the plurality of position points is greater than a first value, convert longitude coordinates that do not belong to the target longitude coordinate range in the longitude coordinates of the plurality of position points to the target longitude coordinate range, and the first value is a maximum value in the first longitude coordinate range.

[0266] The route drawing module 1803 is configured to draw a route connected by the plurality of position points in the electronic map according to an order of the converted longitude coordinates.

[0267] The route drawing device provided by the embodiment of the present application, when the absolute value of the difference between the longitude coordinates of the adjacent position points is greater than the maximum value in the first longitude coordinate range, it indicates that the two adjacent position points are located on two sides of the meridian where the minimum longitude coordinate and the maximum longitude coordinate are located. If the route is directly drawn according to the longitude coordinates, an error will occur in the drawn route. Therefore, in order to draw a correct route, the longitude coordinates that do not belong to the target longitude coordinate range in the longitude coordinates of the plurality of position points are converted to the target longitude coordinate range, so that the longitude coordinates of the plurality of position points all belong to the target longitude coordinate range, so as to change the longitude coordinates corresponding to the meridian crossed by the route between the two position points. At this time, the route is drawn according to the converted longitude coordinates, so that the shortest route connected by the plurality of position points can be drawn, and the accuracy of the route drawing is improved.

[0268] Optionally, referring to Figure 19 , the first longitude coordinate range includes a first sub-range and a second sub-range, the target longitude coordinate range includes the second sub-range and a third sub-range, and the coordinate conversion module 1802 includes:

[0269] The coordinate conversion unit 1812 is configured to, when the maximum value in the third sub-range is greater than the maximum value in the first sub-range, add a second value to the longitude coordinates that do not belong to the second sub-range in the longitude coordinates of the plurality of position points; or

[0270] The coordinate conversion unit 1812 is configured to, when the maximum value in the third sub-range is less than the maximum value in the first sub-range, subtract the second value from the longitude coordinates that do not belong to the second sub-range in the longitude coordinates of the plurality of position points.

[0271] The second value is an absolute value of a difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

[0272] Optionally, referring to Figure 19 , the coordinate conversion module 1802 comprises:

[0273] The range determination unit 1822 is configured to determine a second longitude coordinate range corresponding to the target map region based on the target map region currently displayed in the electronic map, and longitude coordinates in the second longitude coordinate range are sequentially increasing;

[0274] The coordinate conversion unit 1812 is configured to, for each two adjacent position points in the plurality of position points,

[0275] if the absolute value of the difference between the longitude coordinates of the two position points is greater than the first value, convert the longitude coordinate of the two position points that does not belong to the target longitude coordinate range to the target longitude coordinate range;

[0276] if the absolute value of the difference between the longitude coordinates of the two position points is not greater than the first value, and if the longitude coordinates of the two position points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, convert the longitude coordinates of the two position points to the target longitude coordinate range.

[0277] Optionally, referring to Figure 19 , the first longitude coordinate range comprises a first sub-range and a second sub-range, the target longitude coordinate range comprises the second sub-range and a third sub-range, and the coordinate conversion unit 1812 is configured to:

[0278] the maximum value in the third sub-range is greater than the maximum value in the first sub-range, and if the longitude coordinates of the two position points do not belong to the second sub-range and do not belong to the second longitude coordinate range, add a second value to the longitude coordinates of the two position points; or

[0279] the maximum value in the third sub-range is less than the maximum value in the first sub-range, and if the longitude coordinates of the two position points do not belong to the second sub-range and do not belong to the second longitude coordinate range, subtract the second value from the longitude coordinates of the two position points.

[0280] wherein the second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

[0281] Optionally, the first longitude coordinate range comprises positive numbers and negative numbers, and the target longitude coordinate range does not comprise positive numbers or does not comprise negative numbers.

[0282] Optionally, referring to Figure 19 , the apparatus further comprises:

[0283] The center point determination module 1804 is configured to determine a longitude coordinate of a center point of the target map region based on the target map region currently displayed in the electronic map, and the longitude coordinate of the center point belongs to the first longitude coordinate range.

[0284] The range determination module 1805 is configured to determine, in a case where the longitude coordinate of the center point is greater than 0 degrees, a longitude coordinate range from 0 degrees to 360 degrees as the target longitude coordinate range.

[0285] The range determination module 1805 is further configured to determine, in a case where the longitude coordinate of the center point is not greater than 0 degrees, a longitude coordinate range from -360 degrees to 0 degrees as the target longitude coordinate range.

[0286] Optionally, referring to Figure 19 The apparatus further includes a coordinate modification module 1806 configured to perform at least one of the following:

[0287] For each of the plurality of position points, in a case where the latitude coordinate of the position point is greater than the maximum latitude coordinate of the electronic map, the latitude coordinate of the position point is modified to the maximum latitude coordinate of the electronic map.

[0288] For each of the plurality of position points, in a case where the latitude coordinate of the position point is less than the minimum latitude coordinate of the electronic map, the latitude coordinate of the position point is modified to the minimum latitude coordinate of the electronic map.

[0289] Optionally, referring to Figure 19 The route drawing module 1803 is configured to draw a route connecting the plurality of position points in the electronic map in an order from large to small according to the converted longitude coordinates, or in an order from small to large according to the converted longitude coordinates.

[0290] Optionally, referring to Figure 19 The plurality of position points include a starting point, an ending point, and a passing point between the starting point and the ending point, and the apparatus further includes:

[0291] The request response module 1807 is configured to acquire the starting point and the ending point corresponding to the route drawing request in response to a route drawing request based on the electronic map.

[0292] The coordinate determination module 1808 is configured to determine coordinates of the passing point between the starting point and the ending point according to the coordinates of the starting point and the coordinates of the ending point, and the coordinates include longitude coordinates and latitude coordinates.

[0293] Optionally, referring to Figure 19 The coordinate determination module 1808 includes:

[0294] The first determining unit 1818 is configured to determine coordinates of at least one first passing point between the start point and the end point according to the coordinates of the start point and the coordinates of the end point.

[0295] The second determining unit 1828 is configured to determine, in parallel, coordinates of at least one second passing point between each two adjacent position points according to the coordinates of each two adjacent position points from the start point, the end point and the at least one first passing point.

[0296] Optionally, referring to Figure 19 , the number of the first passing points is a target number, and the device further includes:

[0297] The coordinate difference determining module 1809 is configured to determine a maximum longitude coordinate difference and a maximum latitude coordinate difference of a target map region currently displayed in the electronic map.

[0298] The coordinate difference determining module 1809 is further configured to determine a target longitude coordinate difference between the start point and the end point, and a target latitude coordinate difference between the start point and the end point.

[0299] The number determining module 18010 is configured to determine the target number based on the maximum longitude coordinate difference, the maximum latitude coordinate difference, the target longitude coordinate difference and the target latitude coordinate difference.

[0300] Optionally, referring to Figure 19 , the number determining module 18010 includes:

[0301] The ratio determining unit 18110 is configured to determine a first ratio between the target longitude coordinate difference and the maximum longitude coordinate difference, and a second ratio between the target latitude coordinate difference and the maximum latitude coordinate difference.

[0302] The number determining unit 18210 is configured to determine the target number based on the first ratio and the second ratio, and the target number is positively correlated with a maximum value of the first ratio and the second ratio.

[0303] Optionally, referring to Figure 19 , the step of determining the coordinates of the at least one first passing point between the start point and the end point according to the coordinates of the start point and the coordinates of the end point is executed by the central processing unit, and the step of determining, in parallel, the coordinates of the at least one second passing point between each two adjacent position points according to the coordinates of each two adjacent position points from the start point, the end point and the at least one first passing point is executed by the graphic processing unit.

[0304] The device further includes:

[0305] The coordinate storage module 18011 is configured to store, by the central processing unit, the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in a memory buffer space.

[0306] The coordinate obtaining module 18012 is configured to obtain, by the graphic processor, the coordinates of the start point, the coordinates of the end point and the coordinates of the at least one first passing point in the memory buffer space.

[0307] It should be noted that the route drawing device provided in the above embodiments is only used for drawing a route by way of example of the above-mentioned division of functional modules. In actual applications, the above-mentioned functions can be completed by different functional modules according to needs, that is, the internal structure of the computer device is divided into different functional modules to complete all or part of the functions described above. In addition, the route drawing device and the route drawing method provided in the above embodiments belong to the same concept, and the specific implementation process is described in the method embodiments, which will not be described here.

[0308] The embodiments of the present application further provide a computer device, which comprises a processor and a memory. The memory stores at least one computer program. The at least one computer program is loaded and executed by the processor to implement the operations performed in the route drawing method of the above embodiments.

[0309] Optionally, the computer device is provided as a terminal. Figure 20 A structure diagram of a terminal 2000 provided by an example embodiment of the present application is shown.

[0310] The terminal 2000 comprises a processor 2001 and a memory 2002.

[0311] The processor 2001 can include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The processor 2001 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processing), an FPGA (Field Programmable Gate Array), a PLA (Programmable Logic Array). The processor 2001 can also include a main processor and a coprocessor. The main processor is a processor for processing data in an awake state, also known as a CPU (Central Processing Unit). The coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 2001 can be integrated with a GPU (Graphics Processing Unit) for rendering and drawing content required to be displayed by the display screen. In some embodiments, the processor 2001 can further include an AI (Artificial Intelligence) processor for processing machine learning related computing operations.

[0312] The memory 2002 can include one or more computer-readable storage media that can be non-transitory. The memory 2002 can also include high-speed random access memory and nonvolatile memory such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 2002 is used to store at least one computer program for being executed by the processor 2001 to implement the route drawing method provided by the method embodiments in the present application.

[0313] In some embodiments, the terminal 2000 can also optionally include a peripheral device interface 2003 and at least one peripheral device. The processor 2001, the memory 2002, and the peripheral device interface 2003 can be connected through a bus or a signal line. Each peripheral device can be connected to the peripheral device interface 2003 through a bus, a signal line, or a circuit board. Optionally, the peripheral device includes at least one of a radio frequency circuit 2004, a display screen 2005, a camera assembly 2006, an audio circuit 2007, and a power supply 2008.

[0314] The peripheral interface 2003 can be used to connect at least one I / O (Input / Output) related peripheral device to the processor 2001 and the memory 2002. In some embodiments, the processor 2001, the memory 2002 and the peripheral interface 2003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2001, the memory 2002 and the peripheral interface 2003 can be implemented on a separate chip or circuit board, and the present embodiments are not limited in this regard.

[0315] The radio frequency circuit 2004 is configured to receive and send RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 2004 communicates with communication networks and other communication devices through electromagnetic signals. The radio frequency circuit 2004 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 2004 includes an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and the like. The radio frequency circuit 2004 can communicate with other devices through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 2004 can also include NFC (Near Field Communication) related circuitry, and the present application is not limited in this regard.

[0316] The display screen 2005 is configured to display a UI (User Interface). The UI can include graphics, text, icons, video, and any combination thereof. When the display screen 2005 is a touch display screen, the display screen 2005 is further configured to capture touch signals on or above the surface of the display screen 2005. The touch signals can be input to the processor 2001 as control signals for processing. In this case, the display screen 2005 can also be configured to provide virtual buttons and / or virtual keyboard, also known as soft buttons and / or soft keyboard. In some embodiments, the display screen 2005 can be one, disposed on the front panel of the terminal 2000; in other embodiments, the display screen 2005 can be at least two, respectively disposed on different surfaces of the terminal 2000 or in a folding design; in other embodiments, the display screen 2005 can be a flexible display screen, disposed on a curved surface or a folding surface of the terminal 2000. Even, the display screen 2005 can also be disposed in an irregular shape other than a rectangle, i.e., a special-shaped screen. The display screen 2005 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc.

[0317] The camera assembly 2006 is configured to capture images or videos. Optionally, the camera assembly 2006 includes a front-facing camera and a rear-facing camera. The front-facing camera is disposed on the front panel of the terminal 2000, and the rear-facing camera is disposed on the back of the terminal 2000. In some embodiments, the rear-facing camera is at least two, which is any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, to realize the background blur function by fusing the main camera and the depth-of-field camera, the panoramic shooting and VR (Virtual Reality) shooting function by fusing the main camera and the wide-angle camera, or other fusion shooting functions. In some embodiments, the camera assembly 2006 can further include a flash. The flash can be a single-color-temperature flash or a dual-color-temperature flash. The dual-color-temperature flash refers to the combination of a warm light flash and a cold light flash, which can be used for light compensation under different color temperatures.

[0318] The audio circuit 2007 can include a microphone and a speaker. The microphone is used to collect sound waves of a user and an environment, and convert the sound waves into an electrical signal input to the processor 2001 for processing, or input to the radio frequency circuit 2004 to realize voice communication. For the purpose of stereo sound collection or noise reduction, the microphone can be multiple, respectively arranged at different parts of the terminal 2000. The microphone can also be an array microphone or an omnidirectional collection type microphone. The speaker is used to convert the electrical signal from the processor 2001 or the radio frequency circuit 2004 into sound waves. The speaker can be a conventional diaphragm speaker, or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, not only can the electrical signal be converted into a sound wave audible to humans, but also can be converted into a sound wave inaudible to humans for ranging purposes. In some embodiments, the audio circuit 2007 can also include a headphone jack.

[0319] The power supply 2008 is used to supply power to each component in the terminal 2000. The power supply 2008 can be alternating current, direct current, disposable battery or rechargeable battery. When the power supply 2008 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.

[0320] Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the terminal 2000, and can include more or fewer components than shown, or combine certain components, or use different component arrangements. Figure 20 Those skilled in the art can understand that the structure shown in the above embodiments does not constitute a limitation on the terminal 2000, and can include more or fewer components than shown, or combine certain components, or use different component arrangements.

[0321] The embodiments of the present application also provide a computer readable storage medium, which stores at least one computer program. The at least one computer program is loaded and executed by a processor to implement the operations performed in the route drawing method of the above embodiments.

[0322] The embodiments of the present application also provide a computer program product, which includes a computer program. The computer program is loaded and executed by a processor to implement the operations performed in the route drawing method of the above embodiments. In some embodiments, the computer program related by the embodiments of the present application can be deployed to execute on one computer device, or execute on multiple computer devices located in one place, or execute on multiple computer devices distributed in multiple places and interconnected through a communication network. The multiple computer devices distributed in multiple places and interconnected through a communication network can constitute a blockchain system.

[0323] Those skilled in the art can understand that all or part of the steps of the above-mentioned embodiments can be completed by hardware, or can be instructed to relevant hardware by program. The program can be stored in a computer readable storage medium, and the storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0324] The above only describes optional embodiments of the present application, and is not intended to limit the embodiments of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the embodiments of the present application shall be included in the protection scope of the present application.

Claims

1. A route drawing method, characterized in that, The method includes: Multiple location points are determined in an electronic map, which has a first longitude coordinate range, a target longitude coordinate range, and a second longitude coordinate range corresponding to the target map area currently displayed in the electronic map. The longitude coordinates of the multiple location points belong to the first longitude coordinate range, and the longitude coordinates in the second longitude coordinate range increase sequentially. Among the plurality of location points, if the absolute value of the difference between the longitude coordinates of two adjacent location points is greater than a first value, the longitude coordinates of the two location points that do not belong to the target longitude coordinate range are converted to the target longitude coordinate range, where the first value is the maximum value within the first longitude coordinate range; if the absolute value of the difference between the longitude coordinates of two location points is not greater than the first value, and if the longitude coordinates of the two location points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, then the longitude coordinates of the two location points are converted to the target longitude coordinate range. The route connecting the multiple location points is drawn on the electronic map according to the order of the converted longitude coordinates.

2. The method according to claim 1, characterized in that, The first longitude coordinate range is composed of a continuous first sub-range and a second sub-range, and the target longitude coordinate range is composed of a continuous second sub-range and a third sub-range. The second sub-range in the first longitude coordinate range is the same as the second sub-range in the target longitude coordinate range. The step of converting the longitude coordinates that do not belong to the target longitude coordinate range to the target longitude coordinate range includes: If the maximum value in the third sub-range is greater than the maximum value in the first sub-range, then the longitude coordinates of the plurality of location points that do not belong to the second sub-range are added to a second value; or... If the maximum value in the third sub-range is less than the maximum value in the first sub-range, the second value is subtracted from the longitude coordinates of the multiple location points that do not belong to the second sub-range. Wherein, the second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

3. The method according to claim 1, characterized in that, The first longitude coordinate range is composed of a continuous first sub-range and a second sub-range, and the target longitude coordinate range is composed of a continuous second sub-range and a third sub-range. The second sub-range in the first longitude coordinate range is the same as the second sub-range in the target longitude coordinate range. If the longitude coordinates of the two location points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, then converting the longitude coordinates of the two location points to the target longitude coordinate range includes: If the maximum value in the third sub-range is greater than the maximum value in the first sub-range, and the longitude coordinates of the two locations do not belong to the second sub-range and do not belong to the second longitude coordinate range, then the longitude coordinates of the two locations are added to the second value; or, If the maximum value in the third sub-range is less than the maximum value in the first sub-range, and the longitude coordinates of the two locations do not belong to the second sub-range and do not belong to the second longitude coordinate range, then the longitude coordinates of the two locations are reduced by the second value. Wherein, the second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

4. The method according to claim 1, characterized in that, The first longitude coordinate range includes positive and negative numbers, while the target longitude coordinate range does not include positive or negative numbers.

5. The method according to claim 4, characterized in that, The method further includes: Based on the target map area currently displayed in the electronic map, determine the longitude coordinates of the center point of the target map area, wherein the longitude coordinates of the center point belong to the first longitude coordinate range; If the longitude coordinate of the center point is greater than 0 degrees, the range of longitude coordinates from 0 degrees to 360 degrees will be determined as the target longitude coordinate range. If the longitude coordinate of the center point is not greater than 0 degrees, the longitude coordinate range from -360 degrees to 0 degrees will be determined as the target longitude coordinate range.

6. The method according to any one of claims 1-5, characterized in that, Before drawing the route connecting the multiple location points on the electronic map according to the converted longitude coordinates, the method further includes at least one of the following: For each of the plurality of location points, if the latitude coordinate of the location point is greater than the maximum latitude coordinate of the electronic map, the latitude coordinate of the location point shall be changed to the maximum latitude coordinate. For each of the plurality of location points, if the latitude coordinate of the location point is less than the minimum latitude coordinate of the electronic map, the latitude coordinate of the location point shall be changed to the minimum latitude coordinate.

7. The method according to any one of claims 1-5, characterized in that, The step of drawing the route connecting the multiple location points on the electronic map according to the order of the converted longitude coordinates includes: The route connecting the multiple location points is drawn on the electronic map in descending order of the converted longitude coordinates, or in ascending order of the converted longitude coordinates.

8. The method according to any one of claims 1-5, characterized in that, The plurality of location points includes a start point, an end point, and waypoints between the start point and the end point; the method further includes: In response to a route drawing request based on the electronic map, the starting point and the ending point corresponding to the route drawing request are obtained; Based on the coordinates of the starting point and the coordinates of the ending point, determine the coordinates of the waypoints between the starting point and the ending point, wherein the coordinates include longitude coordinates and latitude coordinates.

9. The method according to claim 8, characterized in that, Determining the coordinates of the waypoints between the starting point and the ending point based on the coordinates of the starting point and the ending point includes: Based on the coordinates of the starting point and the coordinates of the ending point, determine the coordinates of at least one first waypoint between the starting point and the ending point; In parallel, from the starting point, the ending point, and the at least one first waypoint, the coordinates of at least one second waypoint between each pair of adjacent location points are determined based on the coordinates of each pair of adjacent location points.

10. The method according to claim 9, characterized in that, The number of the first path points is the target number; before determining the coordinates of at least one first path point between the starting point and the ending point based on the coordinates of the starting point and the ending point, the method further includes: Based on the target map area currently displayed in the electronic map, determine the maximum longitude coordinate difference and the maximum latitude coordinate difference of the target map area; Determine the target longitude coordinate difference between the starting point and the ending point, and the target latitude coordinate difference between the starting point and the ending point; The number of targets is determined based on the maximum longitude difference, the maximum latitude difference, the target longitude difference, and the target latitude difference.

11. A route drawing device, characterized in that, The device includes: The location point determination module is used to determine multiple location points in an electronic map. The electronic map has a first longitude coordinate range, a target longitude coordinate range, and a second longitude coordinate range corresponding to the target map area currently displayed in the electronic map. The longitude coordinates of the multiple location points belong to the first longitude coordinate range, and the longitude coordinates in the second longitude coordinate range increase sequentially. The coordinate transformation module is used to, among the plurality of location points, if the absolute value of the difference between the longitude coordinates of two adjacent location points is greater than a first value, transform the longitude coordinates of the two location points that do not belong to the target longitude coordinate range to the target longitude coordinate range, where the first value is the maximum value within the first longitude coordinate range; if the absolute value of the difference between the longitude coordinates of two location points is not greater than the first value, and if the longitude coordinates of the two location points do not belong to the target longitude coordinate range and do not belong to the second longitude coordinate range, then transform the longitude coordinates of the two location points to the target longitude coordinate range. The route drawing module is used to draw a route connecting the multiple location points on the electronic map according to the order of the converted longitude coordinates.

12. The apparatus according to claim 11, characterized in that, The first longitude coordinate range is composed of a continuous first sub-range and a second sub-range, and the target longitude coordinate range is composed of a continuous second sub-range and a third sub-range. The second sub-range in the first longitude coordinate range is the same as the second sub-range in the target longitude coordinate range. The coordinate transformation module includes: A coordinate transformation unit is used to add a second value to the longitude coordinates of the plurality of location points that do not belong to the second sub-range, when the maximum value in the third sub-range is greater than the maximum value in the first sub-range; or... The coordinate transformation unit is also used to subtract the second value from the longitude coordinates of the plurality of location points that do not belong to the second sub-range when the maximum value in the third sub-range is less than the maximum value in the first sub-range. Wherein, the second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

13. The apparatus according to claim 11, characterized in that, The first longitude coordinate range is composed of a continuous first sub-range and a second sub-range, and the target longitude coordinate range is composed of a continuous second sub-range and a third sub-range. The second sub-range in the first longitude coordinate range is the same as the second sub-range in the target longitude coordinate range. The coordinate transformation module includes: The coordinate transformation unit is used to: if the maximum value in the third sub-range is greater than the maximum value in the first sub-range, and if the longitude coordinates of the two location points do not belong to the second sub-range and do not belong to the second longitude coordinate range, then add a second value to the longitude coordinates of the two location points; or... The coordinate transformation unit is also used to subtract the second value from the longitude coordinates of the two location points if the maximum value in the third sub-range is less than the maximum value in the first sub-range and the longitude coordinates of the two location points do not belong to the second sub-range and do not belong to the second longitude coordinate range. Wherein, the second value is the absolute value of the difference between the maximum value in the third sub-range and the maximum value in the first sub-range.

14. The apparatus according to claim 11, characterized in that, The first longitude coordinate range includes positive and negative numbers, while the target longitude coordinate range does not include positive or negative numbers.

15. The apparatus according to claim 14, characterized in that, The device further includes: The center point determination module is used to determine the longitude coordinates of the center point of the target map area based on the target map area currently displayed in the electronic map, wherein the longitude coordinates of the center point belong to the first longitude coordinate range; The range determination module is used to determine the range of longitude coordinates from 0 degrees to 360 degrees as the target longitude coordinate range when the longitude coordinate of the center point is greater than 0 degrees. The range determination module is further configured to determine the range of longitude coordinates from -360 degrees to 0 degrees as the target longitude coordinate range when the longitude coordinates of the center point are not greater than 0 degrees.

16. The apparatus according to any one of claims 11-15, characterized in that, The device further includes a coordinate changing module for performing at least one of the following: For each of the plurality of location points, if the latitude coordinate of the location point is greater than the maximum latitude coordinate of the electronic map, the latitude coordinate of the location point shall be changed to the maximum latitude coordinate. For each of the plurality of location points, if the latitude coordinate of the location point is less than the minimum latitude coordinate of the electronic map, the latitude coordinate of the location point shall be changed to the minimum latitude coordinate.

17. The apparatus according to any one of claims 11-15, characterized in that, The route drawing module is used for: The route connecting the multiple location points is drawn on the electronic map in descending order of the converted longitude coordinates, or in ascending order of the converted longitude coordinates.

18. The apparatus according to any one of claims 11-15, characterized in that, The plurality of location points includes a start point, an end point, and waypoints between the start point and the end point; the device further includes: The request-response module is used to respond to a route drawing request based on the electronic map and obtain the starting point and the ending point corresponding to the route drawing request; The coordinate determination module is used to determine the coordinates of the waypoints between the starting point and the ending point based on the coordinates of the starting point and the ending point, wherein the coordinates include longitude coordinates and latitude coordinates.

19. The apparatus according to claim 18, characterized in that, The coordinate determination module includes: The first determining unit is configured to determine the coordinates of at least one first transit point between the starting point and the ending point based on the coordinates of the starting point and the ending point. The second determining unit is used to determine, in parallel, the coordinates of at least one second waypoint between each pair of adjacent location points from the starting point, the ending point, and the at least one first waypoint, based on the coordinates of each pair of adjacent location points.

20. The apparatus according to claim 19, characterized in that, The number of the first path points is the target number; the device further includes: The coordinate difference determination module is used to determine the maximum longitude coordinate difference and the maximum latitude coordinate difference of the target map area based on the target map area currently displayed in the electronic map; The coordinate difference determination module is further configured to determine the target longitude coordinate difference between the starting point and the ending point, and the target latitude coordinate difference between the starting point and the ending point; The quantity determination module is used to determine the target quantity based on the maximum longitude coordinate difference, the maximum latitude coordinate difference, the target longitude coordinate difference, and the target latitude coordinate difference.

21. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer program, which is loaded and executed by the processor to implement the route drawing method as described in any one of claims 1 to 10.

22. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one computer program, which is loaded and executed by a processor to implement the route drawing method as described in any one of claims 1 to 10.

23. A computer program product, comprising a computer program, characterized in that, The computer program is loaded and executed by a processor to implement the route drawing method as described in any one of claims 1 to 10.

Citation Information

Patent Citations

  • Route drawing method and apparatus, computer device, storage medium and program product

    WO2023138199A1