The content of the invention
In view of this, the present invention provides a kind of method and apparatus of geographical position track optimizing, energy
Enough remove the abnormity point in track;Further, it is also possible to remove track by way of trace compression
In repetition point, reach the purpose for reducing network transmission pressure, saving disk storage space.
To achieve the above object, according to an aspect of the invention, there is provided a kind of geographical position
The method of track optimizing.
The method of the geographical position track optimizing of the present invention includes:Obtain geographical position initial trace
Data;The abnormity point in the geographical position initial trace data is removed, to obtain geographical position
Remove the abnormal locus of points;Compress the geographical position and remove the abnormal locus of points, it is excellent to obtain geographical position
Change track.
Alternatively, the acquisition geographical position initial trace data include:It is spaced at preset timed intervals
The coordinate of gathering geographic position tracing point, the coordinate of the geographical position tracing point is sorted to obtain
To geographical position initial trace data, the coordinate of the geographical position tracing point includes longitude, latitude
Degree, temporal information.
Alternatively, methods described also includes:Obtain after the initial trace data of geographical position, by institute
State the local data base that geographical position initial trace data are temporarily stored in geographical position collecting device
In.
Alternatively, the abnormity point removed in the geographical position initial trace data includes:
Remove the abnormity point that the displacement between consecutive points is more than maximum travel distance.
Alternatively, the abnormity point removed in the geographical position initial trace data includes:
The Euclidean distance for removing consecutive points is more than the abnormity point of road network distance between 2 points.
Alternatively, the compression geographical position goes the abnormal locus of points to include:Pressed using track
Compression algorithm, the deviation value retained with course bearing is more than the characteristic point of predetermined threshold value, and these are special
A track for composition is levied as geographical position and optimizes track.
For up to above-mentioned purpose, there is provided a kind of geographical position track according to another aspect of the present invention
The device of optimization.
The device of the geographical position track optimizing of the present invention includes:Acquisition module, for obtaining ground
Manage position initial trace data;Abnormal point module is removed, it is original for removing the geographical position
Abnormity point in track data, so that the abnormal locus of points must be removed to geographical position;Trace compression module,
The abnormal locus of points is removed for compressing the geographical position, to obtain geographical position optimization track.
Alternatively, the acquisition module is additionally operable to:Gathering geographic position rail is spaced at preset timed intervals
The coordinate of mark point, the coordinate sequence of the geographical position tracing point is original to obtain geographical position
Track data, the coordinate of the geographical position tracing point includes longitude, latitude, temporal information.
Alternatively, described device also includes:Temporary storage module, it is former for obtaining geographical position
After beginning track data, the geographical position initial trace data are temporarily stored in geographical position and adopted
In the local data base for collecting equipment.
Alternatively, the exception point module that removes is additionally operable to:Remove consecutive points between movement away from
From the abnormity point more than maximum travel distance.
Alternatively, the exception point module that removes is additionally operable to:The Euclidean distance for removing consecutive points is big
The abnormity point of road network distance between 2 points.
Alternatively, the trace compression module is additionally operable to:Using trace compression algorithm, retain with
The deviation value of course bearing be more than predetermined threshold value characteristic point, by these feature point groups into track
Optimize track as geographical position.
Technique according to the invention scheme, by removing the abnormity point in initial trace, so as to
Strong Data safeguard is provided to excavate behavior for follow-up data;Pass through wide tight different abnormal points
Mark is accurate, so as to meet the different accuracy requirement of abnormity point removal;Pressed by using track
Contracting counterweight complex point is rejected, so as on the basis of keeping characteristics point, press to greatest extent
Contracting data total amount, reduces network transmission pressure, saves the space of disk storage;By obtaining
To after the track data of geographical position, the data of acquisition are temporarily stored in local SQLITE, from
And can be realized in the case where taking less internal storage space to geographical location track data
Optimization processing.
Embodiment
The one exemplary embodiment of the present invention is explained below in conjunction with accompanying drawing, including this hair
The various details of bright embodiment should think them only exemplary to help understanding.
Therefore, it will be appreciated by those of ordinary skill in the art that, the embodiments described herein can be done
Go out various changes and modifications, without departing from scope and spirit of the present invention.Equally, in order to clear
Chu and simplicity, eliminate the description to known function and structure in following description.
Fig. 1 is the key step of the method for geographical position track optimizing according to embodiments of the present invention
Schematic diagram.
As shown in figure 1, the method for the geographical position track optimizing of the embodiment of the present invention mainly includes
Following steps:
Step S11:Obtain geographical position initial trace data.Geographical location track is carried out excellent
Change, it is necessary first to first obtain geographical position initial trace data.
Geographical position track is typically that (for example can be using the equipment with geographic positioning functionality
GPS (global positioning system) equipment, or Beidou navigation equipment are acquired.Of the invention real
Apply in mode, the collection of geographic position data is carried out using GPS device.Adopt geographical position track
Collection mainly has two ways, is spaced according to time interval or according to distance.Technical solution of the present invention
In, data analysis and track optimizing are carried out for convenience, and the collection of geographical position track data can
To be carried out according to time interval.Specifically, according to prefixed time interval gathering geographic position rail
The coordinate of mark point, by the coordinate of the geographical position tracing point according to time series be ranked up with
Geographical position initial trace data record is obtained, the coordinate of the geographical position tracing point includes
Longitude, latitude, temporal information.In view of carrying out ground using GPS device in embodiment of the present invention
The collection of position data is managed, therefore also the track data of acquisition can be referred to as GPS track data.
In embodiments of the present invention, intelligent acquisition equipment according to default time interval (this when
Between interval can be according to being set the need for collection, such as 15s) gathering geographic position tracing point seat
Mark, and geographical position track point coordinates can be temporarily stored in the sheet of geographical position collecting device
Ground database, in embodiments of the present invention, is temporarily stored in the local SQLite of smart machine
(SQLite, is a light-duty database, is the relational data library management system in accordance with ACID
System, it is included in a relatively small C storehouse.It is the publicly-owned neck that D.RichardHipp is set up
Domain project.Its design object is Embedded, and at present in many embedded products
In used it, it take resource it is very low, in embedded device, may only need to several
Hundred K internal memory is just much of that) in.
In the embodiment of the present invention, by geographical position initial trace data progress interim storage be in order to
Reduce the occupancy to the memory space of smart machine system.Because carrying out geographical position collection at present
Intelligent terminal be WinCE systems mostly, internal storage space is smaller.By geographical position rail
The coordinate data of mark point is temporarily stored in the local SQLite of smart machine, can be in geographical position
Track optimizing is put to complete and after Successful transmissions, local data is deleted.And in smart machine
In go to safeguard the deletions of data in SQLITE, be usually that will not cause the loss of data.
Operated more than, geographical position initial trace data have been obtained and stored, next
From step S12 processing.
Step S12:The abnormity point in the initial trace data of geographical position is removed, to obtain geographical position
Put the abnormal locus of points.
In above-mentioned steps, geographical position initial trace data have been obtained, since this step,
Processing is optimized to initial trace data.The process of optimization mainly includes removing abnormity point and rail
Mark compression (removes and repeats point).This step S12 main purpose is to remove geographical position original
Abnormity point in beginning track.Abnormity point is removed, mainly in the geographical location track point of removal and just
The excessive abnormity point of normal practice mark deviation distance.
Assuming that geographical position initial trace sequence is T { p1, p2 ..., pk }, each point p (lat,
Lngt, is t) tracing point, wherein lat, lngt and t represent respectively record tracing point latitude,
Longitude and temporal information.According to general knowledge, the displacement of consecutive points should be less than maximum in sequence T
Travel distance, therefore, the point that the displacement between consecutive points is more than maximum travel distance is known
Not Wei abnormity point, removed.In another embodiment, in order in guarantee result correctness
Under the premise of make calculating easy, accelerate detection efficiency, it is to avoid strict calculation formula is time-consuming, cost
Source, can suitably relax examination criteria is:Road between consecutive points Euclidean distance is removed more than 2 points
The abnormity point of net distance.
In foregoing description, four distances are respectively:
1st, the displacement between consecutive points:(earth curved surface is geographical for geographic distance between 2 points
Distance), it is considered to earth curved surface factor;
2nd, maximum travel distance:By the road network of starting point to terminal apart from summation;
3rd, the Euclidean distance of consecutive points:, ground is not considered at the distance between 2 points on mathematical concept
Ball curved surface factor;
4th, the road network distance of point-to-point transmission:Along road network apart from summation between adjacent 2 points;
In the specific embodiment of the invention, road network between removing consecutive points Euclidean distance more than 2 points
The abnormity point of distance, it is possible to use 0<d(pi+1,pi)/(pi+1.t,pi.t)<Vmax1 formula carries out different
Often point is calculated.Wherein, pi+1Represent the position of i+1 points, pi+1.t the time of i+1 points, d (p are representedi+1,pi)
For point piAnd pi+1Between Euclidean distance, (pi+1.t, pi.t the time difference between 2 points) is represented,
Both are divided by the speed per hour represented between 2 points within a period of time, Vmax1 for user maximum shifting
Dynamic speed, it is 160km/h that Vmax1 is set herein.With the velocity magnitude reflection in certain time
User movement apart from size.Under normal circumstances, consecutive points Euclidean distance is less than the road of point-to-point transmission
Net distance, using above-mentioned formula by do not meet consecutive points Euclidean distance less than point-to-point transmission road network away from
From abnormity point removed.
Abnormity point is removed using the size of road network distance between the Euclidean distance of consecutive points and at 2 points
Specific calculating process is as follows:
1st, starting point is defined as by first point of data sequence, starting point subsequent point is defined as phase
Adjoint point;
2nd, starting point and consecutive points are participated in 0<d(pi+1,pi)/(pi+1.t, pi.t)<Vmax1 is calculated,
In one embodiment of the invention, Vmax1=160km/h is taken;
If the 3, starting point meets condition 2 to the speed per hour of consecutive points, store, if discontented
Foot, then remove;
4th, using consecutive points as starting point, using the point after consecutive points as consecutive points, second is returned to
Step, so circulation, the then point stored constitute track, the as track after rejecting abnormalities point.
By above-mentioned steps, the abnormity point in the initial trace of geographical position can be removed, obtains ground
The abnormal locus of points is removed in reason position.
Step S13:The abnormal locus of points is removed in compression geographical position, to obtain geographical position optimization track.
Another important process of geographical position track optimizing is that abnormity point rail is removed in compression geographical position
Mark.In the embodiment of the present invention, the process of trace compression includes:The general direction of track is determined,
Then deviation value of all sequences point in the direction is calculated, deviation value is more than recognizing for predetermined threshold value
Be set to track characteristic point, using these feature point groups into track be used as geographical position optimize track.
During trace compression, the calculating standard of predetermined threshold value depending on actual optimization accuracy requirement,
With the geographical position precision of collecting device, the speed of running orbit, the time interval of acquisition trajectories,
The factors such as adjacent 2 points of distances under statistics are relevant.
In embodiments of the present invention, trace compression algorithm comprise the following steps that it is described:
1st, starting point is defined as by first point of data sequence, last point is set to floating point;
2nd, calculate other data points to starting point and float point between line vertical range, find away from
From maximum point;
If the 3, ultimate range is more than given threshold value, former line segment is divided into 2 parts, maximum
Range points are changed into the floating point of previous line segment, while for the starting point of latter section of line segment, storage changes
Ultimate range point;
4th, the 2nd step is returned to, so circulation until all distances are respectively less than threshold value, is then stored
Point constitute track, as compress after track.
All track characteristic points obtained after compression are stored, data compression.Through overcompression
On the one hand geographical position track afterwards remains characteristic point, on the other hand reduces to greatest extent again
Data redundancy.
So far, geographical position track optimizing is completed.
Geographical position track optimizing scheme according to embodiments of the present invention can be seen that by removing
Abnormity point in initial trace, strong data are provided so as to excavate behavior for follow-up data
Ensure;By wide tight different outlier detection standards, removed not so as to meet abnormity point
Same required precision;Rejected by using trace compression counterweight complex point, so as to retain
On the basis of characteristic point, compressed data total amount, reduces network transmission pressure, saves to greatest extent
The space of disk storage;By after geographical position track data is got, by the data of acquisition
It is temporarily stored in local SQLITE, so as to take the situation of less internal storage space
The lower optimization processing realized to geographical location track data.
Fig. 2 is the main modular of the device of geographical position track optimizing according to embodiments of the present invention
Schematic diagram.
As shown in Fig. 2 the device 20 of the geographical position track optimizing of the embodiment of the present invention is mainly wrapped
Include following module:Acquisition module 201, the abnormal point module 202 of removal and trace compression module
203。
Acquisition module 201 is used to obtain geographical position initial trace data;Remove abnormal point module
202 are used to remove the abnormity point in the initial trace data of geographical position, different must be gone to geographical position
The normal locus of points;Trace compression module 203 removes the abnormal locus of points for compressing geographical position, with
Optimize track to geographical position.
Acquisition module 201 can be also used for:Gathering geographic position tracing point is spaced at preset timed intervals
Coordinate, the coordinate of geographical position tracing point is sorted to obtain geographical position initial trace data,
The coordinate of geographical position tracing point includes longitude, latitude, temporal information.
Device 20 may also include:Temporary storage module (not depending on going out in figure) is used to obtain geographical position
Put after initial trace data, geographical position initial trace data are temporarily stored in local data base
In.
Abnormal point module 202 is removed to can be also used for:The displacement removed between consecutive points is big
In the abnormity point of maximum travel distance.
Abnormal point module 202 is removed to can be also used for:The Euclidean distance for removing consecutive points is more than two
The abnormity point of road network distance between point.
Trace compression module 203 can be additionally used in:Using trace compression algorithm, retain and track side
To deviation value be more than predetermined threshold value characteristic point, using these feature point groups into track be used as ground
Manage position optimization track.
From the above, it can be seen that by removing the abnormity point in initial trace, so as to
Behavior is excavated for follow-up data, and strong Data safeguard is provided;Pass through wide tight different outlier detections
Standard, so as to meet the different accuracy requirement of abnormity point removal;By using trace compression
Counterweight complex point is rejected, so as on the basis of keeping characteristics point, compress to greatest extent
Data total amount, reduces network transmission pressure, saves the space of disk storage;By getting
After the track data of geographical position, the data of acquisition are temporarily stored in local SQLITE, so that
It can be realized in the case where taking less internal storage space to the excellent of geographical location track data
Change is handled.
Above-mentioned embodiment, does not constitute limiting the scope of the invention.This area
Technical staff is it is to be understood that depending on design requirement and other factors, can occur various
Modification, combination, sub-portfolio and the replacement of various kinds.It is any within the spirit and principles in the present invention
Modifications, equivalent substitutions and improvements made etc., should be included within the scope of the present invention.