CN110021081B - Line track speed per hour display method and device, electronic equipment and storage medium - Google Patents
Line track speed per hour display method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN110021081B CN110021081B CN201910281269.4A CN201910281269A CN110021081B CN 110021081 B CN110021081 B CN 110021081B CN 201910281269 A CN201910281269 A CN 201910281269A CN 110021081 B CN110021081 B CN 110021081B
- Authority
- CN
- China
- Prior art keywords
- coordinate point
- line
- speed data
- speed
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
- G07C5/00—Registering or indicating the working of vehicles
- G07C5/008—Registering or indicating the working of vehicles communicating information to a remotely located station
-
- G—PHYSICS
- G07—CHECKING-DEVICES
- G07C—TIME OR ATTENDANCE REGISTERS; REGISTERING OR INDICATING THE WORKING OF MACHINES; GENERATING RANDOM NUMBERS; VOTING OR LOTTERY APPARATUS; ARRANGEMENTS, SYSTEMS OR APPARATUS FOR CHECKING NOT PROVIDED FOR ELSEWHERE
- G07C5/00—Registering or indicating the working of vehicles
- G07C5/02—Registering or indicating driving, working, idle, or waiting time only
- G07C5/06—Registering or indicating driving, working, idle, or waiting time only in graphical form
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Controls And Circuits For Display Device (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a method and a device for displaying a line track speed per hour, electronic equipment and a storage medium. According to the line track speed-per-hour display method, two adjacent coordinate points are compared, if the speed-per-hour of the two coordinate points is the same, the point is not required to be drawn, the speed-per-hour comparison of the next coordinate point is carried out, and the drawing of the segmented line is finished until different speed-per-hour coordinate points appear in the adjacent coordinate points.
Description
Technical Field
The present application relates to the field of network technologies, and in particular, to a method and an apparatus for displaying a line trajectory at a speed per hour, an electronic device, and a storage medium.
Background
When the display page shows the speed per hour of a vehicle in the driving process of a certain road, different speeds per hour can be expressed by using different colors. The prior art typically uses Polyline tools from BMap to tie the trajectories traveled by the vehicles into a line. However, the ideal effect is to display the route track of the vehicle as different colors according to different speeds of time, so that the route is segmented, the speed of time from point a to point B is judged according to the data returned by the terminal, and then the color of the route is set.
However, in this way, if there are n points, n-1 lines are repeatedly drawn, and n points may occur, and in n-1 lines, the adjacent coordinate points may be drawn as a plurality of lines at the same time rate, resulting in low operation efficiency and poor display effect.
Therefore, it is desirable to provide a method, an apparatus, an electronic device and a storage medium for displaying a speed per time of a line track to solve the above problems.
Disclosure of Invention
The application provides a method and a device for displaying line track speed per hour, electronic equipment and a storage medium, which are used for solving the problems that in the prior art, the speed per hour of adjacent coordinate points is the same, but the adjacent coordinate points are drawn into a plurality of lines, so that the running efficiency is low, and the display effect is poor.
In a first aspect, the present invention provides a method for displaying a line track speed per hour, the method comprising:
obtaining line track point data of a display object, wherein the line track point data comprises longitude and latitude data of coordinate points and speed data of the display object at the coordinate points;
determining a starting bit coordinate point of the line track according to the longitude and latitude data of the coordinate point;
comparing whether the speed data of the next coordinate point adjacent to the start bit coordinate point in the segmented line is the same as the speed data of the start bit coordinate point;
if the speed data of the next coordinate point adjacent to the start coordinate point in the segmented line is the same as the speed data of the start coordinate point, continuously comparing whether the speed data of the next coordinate point adjacent to the next coordinate point in the segmented line is the same as the speed data of the start coordinate point or not;
if the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start position coordinate point, ending the segmented line and drawing the track of the segmented line;
taking the coordinate point different from the speed data of the start bit coordinate point as a next start bit coordinate point, and repeating the steps to draw the track of the next segmented line;
and configuring different colors for each segmented line according to different speed data of the coordinate points of the segmented lines so as to achieve the page display effect of distinguishing the speed per hour of the line track.
With reference to the first aspect, in a first implementable manner of the first aspect, if the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start bit coordinate point, the segment line is ended, and in the step of drawing the track of the segment line, the track of the segment line is drawn by Polyline.
With reference to the first aspect, in a second implementation manner of the first aspect, in the step of configuring different colors for each segment line according to different speed data of coordinate points of the segment line, so as to achieve a page display effect of distinguishing a line track speed per hour, colors with brightness from low to high are sequentially configured for the segment lines according to the speed data of the segment lines from low to high.
In a second aspect, the present invention provides a line track speed per hour display device, comprising:
the display device comprises an acquisition unit, a display unit and a processing unit, wherein the acquisition unit is used for acquiring line track point data of a display object, and the line track point data comprises longitude and latitude data of coordinate points and speed data of the display object at the coordinate points;
the determining unit is used for determining a starting position coordinate point of the line track according to the longitude and latitude data of the coordinate point;
a comparing unit configured to compare whether speed data of a next coordinate point adjacent to the start bit coordinate point in the segment line is the same as speed data of the start bit coordinate point;
the comparing unit is further used for continuously comparing whether the speed data of the next coordinate point adjacent to the starting bit coordinate point in the segmented line is the same as the speed data of the starting bit coordinate point or not if the speed data of the next coordinate point adjacent to the starting bit coordinate point in the segmented line is the same as the speed data of the starting bit coordinate point;
the drawing unit is used for ending the segmented line and drawing the track of the segmented line when the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start position coordinate point;
the determining unit is further configured to use the coordinate point different from the speed data of the start bit coordinate point as a next start bit coordinate point, and the drawing unit is further configured to repeat the above steps to draw a trajectory of a next segment line;
and the configuration unit is used for configuring different colors for each segmented line according to different speed data of the coordinate points of the segmented line so as to achieve the page display effect of distinguishing the speed per hour of the line track.
With reference to the second aspect, in a first implementable manner of the second aspect, the drawing unit is configured to, when the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start bit coordinate point, end the segment line, and call Polyline to draw the trajectory of the segment line.
With reference to the second aspect, in a second implementation manner of the second aspect, the configuration unit is configured to sequentially configure colors with brightness from low to high for the segment lines according to the segment line speed data from low to high.
In a third aspect, the present invention provides an electronic device comprising:
a memory for storing program instructions;
a processor for calling and executing program instructions in the memory to implement the method of any of the above.
In a fourth aspect, the present invention provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of the above.
According to the technical scheme, the line track speed-per-hour display method, the line track speed-per-hour display device, the electronic equipment and the storage medium have the advantages that two adjacent coordinate points are compared, if the speed-per-hour of the two coordinate points is the same, the point does not need to be drawn, the speed-per-hour comparison of the next coordinate point is carried out, the drawing of the segmented line is finished until the adjacent coordinate points have different speed-per-hour coordinate points, the whole line can be seen as a smoothly-transitional line segment by using the processing mode, the existence of a plurality of coordinate points cannot occur, the user experience is remarkably improved, and the display of a page is optimized.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any inventive exercise.
Fig. 1 is a flowchart of a line trajectory speed-per-hour display method according to an embodiment of the present application.
Fig. 2 is a schematic diagram of a line trace speed-per-hour display device according to an embodiment of the present application.
Fig. 3 is a schematic view of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the specific embodiments of the present invention and the accompanying drawings. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention. The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
Referring to fig. 1, a flowchart of a method for displaying a speed per hour of a line track according to an embodiment of the present application is shown, where the method is used to achieve a page display effect of distinguishing a speed per hour of a line track for display objects such as vehicles. Specifically, the method comprises the following steps:
step S101, obtaining line track point data of a display object, wherein the line track point data comprises longitude and latitude data of coordinate points and speed data of the display object at the coordinate points.
In this embodiment, the line trace point data is requested, and the data format is as follows:
[{flag:‘A’,lat:29.61632614439425,lng:106.7458787117021,speed:23},
{flag:‘B’,lat:29.61632614439425,lng:106.7458787117021,speed:53},
{flag:‘C’,lat:29.61632614439425,lng:106.7458787117021,speed:73},...];
wherein, flag represents the speed data of the display object at the coordinate point, and lat and lng represent the longitude and latitude data of the coordinate point.
And S102, determining a start position coordinate point of the line track according to the longitude and latitude data of the coordinate point.
Step S103, comparing whether the speed data of the next coordinate point adjacent to the start bit coordinate point in the segmented line is the same as the speed data of the start bit coordinate point.
Step S104, if the speed data of the next coordinate point adjacent to the start coordinate point in the segmented line is the same as the speed data of the start coordinate point, continuously comparing whether the speed data of the next coordinate point adjacent to the next coordinate point in the segmented line is the same as the speed data of the start coordinate point.
And step S105, if the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start position coordinate point, ending the segmented line and drawing the track of the segmented line.
In this embodiment, if the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start bit coordinate point, the segment line is ended, and in the step of drawing the track of the segment line, Polyline is used to draw the track of the segment line.
And step S106, taking the coordinate point different from the speed data of the start bit coordinate point as a next start bit coordinate point, and repeating the steps to draw the track of the next segmented line.
In order to optimally show the segmented time rate, judging whether the time rates of two adjacent coordinate points are the same when a Polyline is used for drawing a line, if so, comparing the next coordinate point until the coordinate point with different time rates is the end point of the line segment, and drawing the line according to the time rate of the line segment. Through comparing two adjacent coordinate points, if the speed of time of two coordinate points is the same, then can not draw this point, but carry out the speed of time comparison of next coordinate point, finish the drawing of this segment when appearing different speed of time coordinate points in adjacent coordinate point, use this kind of processing mode to let whole line show as a smooth transition's line segment, and the existence of a plurality of coordinate points can not appear, show promotion user experience, optimize the show of page.
And step S107, configuring different colors for each segmented line according to different speed data of the coordinate points of the segmented lines so as to achieve the page display effect of distinguishing the speed per hour of the line track.
In this embodiment, in the step of configuring different colors for each segment line according to different speed data of the coordinate point of the segment line, so as to achieve the page display effect of distinguishing the speed per hour of the line trajectory, colors with brightness from low to high may be sequentially configured for the segment lines according to the speed data of the segment lines from low to high. For example, the segmented lines with the speed per hour of 30km/h, 40km/h and 50km/h are respectively configured to be light yellow, medium yellow and dark yellow, so that the speed relation among different segmented lines is more intuitively displayed. In addition, the line tracks with different speeds can be distinguished by other types of color distinguishing modes, for example, the line tracks are distinguished by different colors, for example, segmented lines with the speed per hour of 30km/h, 40km/h and 50km/h are respectively configured to be light yellow, blue, red and the like.
Referring to fig. 2, a schematic diagram of a circuit track speed per hour display device provided in an embodiment of the present application is shown, where the device includes:
the acquiring unit 201 is configured to acquire line trajectory point data of a display object, where the line trajectory point data includes longitude and latitude data of a coordinate point and speed data of the display object at the coordinate point.
A determining unit 202, configured to determine a start bit coordinate point of the line trace according to the longitude and latitude data of the coordinate point.
A comparing unit 203, configured to compare whether the speed data of the next coordinate point adjacent to the start bit coordinate point in the segment line is the same as the speed data of the start bit coordinate point.
The comparing unit 203 is further configured to, if the speed data of the next coordinate point adjacent to the start bit coordinate point in the segment line is the same as the speed data of the start bit coordinate point, continue to compare whether the speed data of the next coordinate point adjacent to the next coordinate point in the segment line is the same as the speed data of the start bit coordinate point.
A drawing unit 204, configured to, when the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start bit coordinate point, end the segment line, and draw a trajectory of the segment line.
The determining unit 202 is further configured to use the coordinate point different from the speed data of the start bit coordinate point as a next start bit coordinate point, and the drawing unit 204 is further configured to repeat the above steps to draw a trajectory of a next segment line.
The configuration unit 205 is configured to configure different colors for each segment line according to different speed data of the coordinate points of the segment line, so as to achieve a page display effect of distinguishing a line track speed per hour.
In this embodiment, the drawing unit 204 is configured to, when the speed data of a certain coordinate point is different from the speed data of the start coordinate point by comparison, end the segment line, and call Polyline to draw the trajectory of the segment line.
In this embodiment, the configuration unit 205 is configured to configure colors with brightness from low to high for the segment lines in sequence from low to high according to the segment line speed data.
Please refer to fig. 3, which is a schematic diagram of an electronic device according to an embodiment of the present disclosure, the electronic device includes:
A processor 302 for calling and executing the program instructions in the memory to implement the method described in the above method embodiments.
The embodiment of the present invention further provides a storage medium, and the storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements part or all of the steps in each embodiment of the line trajectory speed-per-hour display method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a Read-only memory (ROM) or a Random Access Memory (RAM).
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. In particular, for the embodiment of the line track speed per hour display device, since it is basically similar to the embodiment of the method, the description is relatively simple, and the relevant points can be referred to the description in the embodiment of the method.
The above-described embodiments of the present invention should not be construed as limiting the scope of the present invention.
Claims (8)
1. A method for displaying a speed per hour of a line track, the method comprising:
obtaining line track point data of a display object, wherein the line track point data comprises longitude and latitude data of coordinate points and speed data of the display object at the coordinate points;
determining a starting bit coordinate point of the line track according to the longitude and latitude data of the coordinate point;
comparing whether the speed data of the next coordinate point adjacent to the start bit coordinate point in the segmented line is the same as the speed data of the start bit coordinate point;
if the speed data of the next coordinate point adjacent to the start coordinate point in the segmented line is the same as the speed data of the start coordinate point, continuously comparing whether the speed data of the next coordinate point adjacent to the next coordinate point in the segmented line is the same as the speed data of the start coordinate point or not;
if the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start position coordinate point, ending the segmented line and drawing the track of the segmented line;
taking the coordinate point different from the speed data of the start bit coordinate point as a next start bit coordinate point, and repeating the steps to draw the track of the next segmented line;
and configuring different colors for each segmented line according to different speed data of the coordinate points of the segmented lines so as to achieve the page display effect of distinguishing the speed per hour of the line track.
2. The method as claimed in claim 1, wherein the step of drawing the trajectory of the segment line by ending the segment line if the speed data of a certain coordinate point obtained by the comparison is different from the speed data of the start coordinate point is performed by using Polyline.
3. The method according to claim 1, wherein in the step of configuring different colors for each segment line according to different speed data of coordinate points of the segment line so as to achieve the page display effect of distinguishing the line track speed per hour, colors with brightness from low to high are sequentially configured for the segment lines according to the speed data of the segment lines from low to high.
4. A line track speed per hour display device, the device comprising:
the display device comprises an acquisition unit, a display unit and a processing unit, wherein the acquisition unit is used for acquiring line track point data of a display object, and the line track point data comprises longitude and latitude data of coordinate points and speed data of the display object at the coordinate points;
the determining unit is used for determining a starting position coordinate point of the line track according to the longitude and latitude data of the coordinate point;
a comparing unit configured to compare whether speed data of a next coordinate point adjacent to the start bit coordinate point in the segment line is the same as speed data of the start bit coordinate point;
the comparing unit is further used for continuously comparing whether the speed data of the next coordinate point adjacent to the starting bit coordinate point in the segmented line is the same as the speed data of the starting bit coordinate point or not if the speed data of the next coordinate point adjacent to the starting bit coordinate point in the segmented line is the same as the speed data of the starting bit coordinate point;
the drawing unit is used for ending the segmented line and drawing the track of the segmented line when the speed data of a certain coordinate point obtained by comparison is different from the speed data of the start position coordinate point;
the determining unit is further configured to use the coordinate point different from the speed data of the start bit coordinate point as a next start bit coordinate point, and the drawing unit is further configured to repeat the above steps to draw a trajectory of a next segment line;
and the configuration unit is used for configuring different colors for each segmented line according to different speed data of the coordinate points of the segmented line so as to achieve the page display effect of distinguishing the speed per hour of the line track.
5. The apparatus as claimed in claim 4, wherein the drawing unit is configured to end the segment line and draw the trace of the segment line by calling Polyline when the speed data of a certain coordinate point is different from the speed data of the start bit coordinate point.
6. The apparatus according to claim 4, wherein the configuration unit is configured to configure colors with brightness from low to high for the segment line in sequence from low to high according to the segment line speed data.
7. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling and executing program instructions in the memory to implement the method of any one of claims 1 to 3.
8. A storage medium, in which a computer program is stored which, when executed by a processor, implements the method of any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910281269.4A CN110021081B (en) | 2019-04-09 | 2019-04-09 | Line track speed per hour display method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910281269.4A CN110021081B (en) | 2019-04-09 | 2019-04-09 | Line track speed per hour display method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110021081A CN110021081A (en) | 2019-07-16 |
CN110021081B true CN110021081B (en) | 2021-05-04 |
Family
ID=67190799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910281269.4A Active CN110021081B (en) | 2019-04-09 | 2019-04-09 | Line track speed per hour display method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110021081B (en) |
Family Cites Families (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7744451B2 (en) * | 2005-11-14 | 2010-06-29 | Microsoft Corporation | Speed-dependent suggested driving lines |
US8370006B2 (en) * | 2006-03-20 | 2013-02-05 | General Electric Company | Method and apparatus for optimizing a train trip using signal information |
EP3446751A4 (en) * | 2016-04-19 | 2019-05-01 | Oh&Lee Medical Robot, Inc. | Method for controlling moving pattern for laser treatment and laser irradiation device using same |
CN106178469A (en) * | 2016-08-08 | 2016-12-07 | 张阳 | Hurry up motion sharing method and system |
CN106507305A (en) * | 2016-11-04 | 2017-03-15 | 四川长虹电器股份有限公司 | A kind of intelligent method for uploading of vehicle GPS position location |
CN108984562B (en) * | 2017-06-02 | 2022-03-08 | 四川理工学院 | Motion data statistical system and method based on Android platform |
JP6279135B1 (en) * | 2017-08-15 | 2018-02-14 | 株式会社テクテック | Position game interface system, program, and control method |
CN207673094U (en) * | 2017-12-28 | 2018-07-31 | 杭州西子智能停车股份有限公司 | A kind of vehicle movement system of plug-type vehicle-carrying plate and stereo garage |
CN108391003A (en) * | 2018-02-06 | 2018-08-10 | 上海康斐信息技术有限公司 | A kind of method and system of movement locus speed color assignment and generation |
CN108434738A (en) * | 2018-03-21 | 2018-08-24 | 网易(杭州)网络有限公司 | Generation method, device, storage medium, processor and the terminal of speed trajectory |
CN108871362A (en) * | 2018-06-12 | 2018-11-23 | 山东理工大学 | A kind of environmentally friendly trip route planing method of automobile dynamic |
CN108960094A (en) * | 2018-06-21 | 2018-12-07 | 吉旗物联科技(上海)有限公司 | A kind of driver's smoking motion detection algorithm based on histograms of oriented gradients |
-
2019
- 2019-04-09 CN CN201910281269.4A patent/CN110021081B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110021081A (en) | 2019-07-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109725975A (en) | Message is by the reminding method, device and electronic equipment of read states | |
CN106092116A (en) | The generation of a kind of optimum travel route based on navigation terminal, air navigation aid and device | |
CN107941226A (en) | Method and apparatus for the direction guide line for generating vehicle | |
CN107678719A (en) | Page display method and device, electronic equipment and storage medium | |
CN109299408A (en) | Information-pushing method, device, vehicle, storage medium and electronic equipment | |
CN110021081B (en) | Line track speed per hour display method and device, electronic equipment and storage medium | |
CN105681199A (en) | Method and device for processing message data in vehicular bus | |
CN110555256A (en) | GPS route simulation data generation method and device | |
CN106445501A (en) | Display method of notification bar, and terminal | |
CN109635972A (en) | Net about vehicle worksheet processing method and apparatus | |
CN111044067A (en) | Path determining method and device | |
CN106651944A (en) | Algorithm and device for obtaining maximal horizontally inscribed rectangle for any connected domain based on run length encoding | |
CN116442787A (en) | Electric automobile energy consumption early warning method, device, medium and equipment | |
CN107665205A (en) | A kind of map rendering intent and device | |
CN111127608A (en) | Rendering method, device and storage medium | |
CN113804196B (en) | Unmanned vehicle path planning method and related equipment | |
CN111831664B (en) | Map data updating method and device | |
CN113128934A (en) | Terminal track processing method and related equipment | |
CN106357519A (en) | Method for prompting information pushing | |
CN110335371A (en) | Rainbow cartoon display method, device, storage medium and system based on speed | |
CN112115215A (en) | Method and device for determining lane center line | |
CN106919356B (en) | Information display method and device | |
CN103019440A (en) | Abnormal touch point removing method and device based on gesture recognition and touch screen | |
CN116263792B (en) | Method and system for crawling complex internet data | |
CN112185141B (en) | Vehicle driving prompting method and device and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |