CN106997355A - Based on Mongodb obtain distance, determine apart from line of shortest length section method and device - Google Patents
Based on Mongodb obtain distance, determine apart from line of shortest length section method and device Download PDFInfo
- Publication number
- CN106997355A CN106997355A CN201610046174.0A CN201610046174A CN106997355A CN 106997355 A CN106997355 A CN 106997355A CN 201610046174 A CN201610046174 A CN 201610046174A CN 106997355 A CN106997355 A CN 106997355A
- Authority
- CN
- China
- Prior art keywords
- line segment
- point
- distance
- shape
- fixing point
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/18—File system types
- G06F16/182—Distributed file systems
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Abstract
The present invention provide based on Mongodb obtain distance, determine apart from line of shortest length section method and device.Obtaining the method for distance includes:When the length between two shape points adjacent on line segment is more than predetermined value, then a shape point is inserted in the centre position of two adjacent shape points on the line segment, until when the length on the line segment between every two adjacent shape points is both less than equal to predetermined value, stopping inserted-shape point;By selected fixing point outside line segment and the minimum value of each shape point distance on the line segment, it is defined as the fixing point to the distance of the line segment.What the inventive method was obtained obtains a distance for arriving line closer to vertical range.
Description
Technical field
Obtain distance the present invention relates to computer realm, more particularly to a kind of Mongodb that is based on, determine
Apart from the method and device of line of shortest length section.
Background technology
Mongodb is one of current most popular Nosq1 databases, and Mongodb is one based on distribution
The database of formula file storage.The storage of Mongodb support vector data and space querying are calculated, and are carried
There are Near functions, can be calculated centered on certain point using Near functions, within the specific limits from center
Point is apart from most short line.
The Near functions that Mongodb is carried calculate point to the distance of line, are by calculating the point to line
Each shape point distance realize.Line is made up of a series of coordinate string, and a shape point is with regard to generation
One coordinate position of table, because some lines are very long and straight, only head and the tail end points is constituted, then point arrives line
Distance is exactly distance of the point to nearest end points.P1, P2 as shown in Figure 1 are line segment P1P2 first and last ends
Point, P be outside line segment a bit, then d1 is the point P to line segment P1P2 that Near functions are provided in Mongodb
Distance.However, point P to line segment P1P2 distance are actually point P to the vertical of line segment P1P2
Apart from d, therefore, the point P to line segment P1P2 obtained using the above method distance often with it is actual
Vertical range d deviations are larger.
The content of the invention
The technical problem to be solved in the present invention is to provide one kind based on Mongodb obtain distance, determine away from
From the method and device of line of shortest length section, for solving in the prior art, the Near letters that Mongodb is carried
Number calculates point to the big defect of the range error of line.
In order to solve the above technical problems, the present invention provides a kind of method that distance is obtained based on Mongodb,
Methods described includes:
When the length between two shape points adjacent on line segment is more than predetermined value, then on the line segment
A shape point is inserted in the centre position of two adjacent shape points, until per adjacent on the line segment
When length between two shape points is both less than equal to predetermined value, stop inserted-shape point;
By selected fixing point outside line segment and the minimum value of each shape point distance on the line segment, it is defined as described
Distance of the fixing point to the line segment.
In order to realize the above method, the present invention provides a kind of device that distance is obtained based on Mongodb,
Including:Judge module, processing module and acquisition module, wherein,
The judge module, for judging length and predetermined value between two shape points adjacent on line segment
Relation;
The processing module, for being more than predetermined value when the length between two shape points adjacent on line segment
When, then a shape point is inserted in the centre position of two adjacent shape points on the line segment, until
When length on the line segment between every two adjacent shape points is both less than equal to predetermined value, stop insertion
Shape point;
The acquisition module, for by selected fixing point outside line segment and each shape point distance on the line segment
Minimum value, is defined as the fixing point to the distance of the line segment.
The present invention also provides a kind of method determined based on Mongodb apart from line of shortest length section, and its feature exists
In methods described includes:
It is determined that the buffering area comprising fixing point;
Select some line segments in the buffering area;
The fixing point is calculated to the distance of every line segment;
By the minimum line segment of fixing point distance described in distance in the buffering area, it is defined as the fixing point
Nearest line segment;
The distance for calculating fixing point to every line segment includes:
When the length between two shape points adjacent on line segment is more than predetermined value, then the institute on the line segment
A shape point is inserted in the centre position for stating two adjacent shape points, until per adjacent two on the line segment
When length between shape point is both less than equal to predetermined value, stop inserted-shape point;
By the minimum value of each shape point distance on the fixing point and the line segment, it is defined as the fixing point and arrives
The distance of the line segment.
Optionally, the buffering area for determining to include fixing point, including:
Determine the fixing point;
Border circular areas delimited by the center of circle of the fixing point by radius of preset value and is used as the buffering area.
In order to realize the above-mentioned method determined based on Mongodb apart from line of shortest length section, the present invention also provides one
Plant the device obtained based on Mongodb apart from line of shortest length section, it is characterised in that described device includes:Obtain
Modulus block, selecting module, computing module, first processing module, Second processing module and the 3rd processing mould
Block;Wherein,
The acquisition module, for the buffering area for determining to include fixing point;
The selecting module, for selecting some line segments in the buffering area;
The computing module, for calculating the fixing point to the distance of every line segment;
The first processing module, for by the minimum line of fixing point distance described in distance in the buffering area
Section, is defined as the nearest line segment of the fixing point;
The Second processing module, for being more than in advance when the length between two shape points adjacent on line segment
During definite value, then a shape point is inserted in the centre position of two adjacent shape points on the line segment, directly
When length on to the line segment between every two adjacent shape points is both less than equal to predetermined value, stop insertion
Shape point;
3rd processing module, for by the minimum of each shape point distance on the fixing point and the line segment
Value, is defined as the fixing point to the distance of the line segment.
Optionally, the acquisition module includes:Selecting unit and processing unit;Wherein,
The selecting unit, for determining the fixing point;
The processing unit, for delimiting border circular areas by the center of circle of the fixing point by radius of preset value
It is used as the buffering area.
Line segment is marked several shape points, and two neighboring shape point by the present invention using mathematic interpolation method
Between length be not more than predetermined value.Calculate each shape on point P to line segment AB successively using the above method
The distance of shape point, using minimum value therein as point P to line segment AB distance.Compared to prior art
Middle acquisition point P to line segment AB distance, using calculating point P provided in an embodiment of the present invention to line segment
Point P to line segment AB that the method for AB distance is obtained distance are closer to point P to line segment AB
Vertical range, accuracy is higher.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes one of the present invention
Point, schematic description and description of the invention is used to explain the present invention, does not constitute to the present invention's
It is improper to limit.In the accompanying drawings:
Fig. 1 is that the Near functions that Mongodb is carried in the prior art calculate point to the signal of the distance of line
Figure;
Fig. 2 is the method flow that distance is obtained based on Mongodb that an alternate embodiment of the present invention is provided
Schematic diagram;
Fig. 3 is being determined based on Mongodb apart from line of shortest length section for an alternate embodiment of the present invention offer
Method schematic diagram;
Fig. 4 is the schematic diagram that an alternate embodiment of the present invention obtains distance based on Mongodb;
Fig. 5 is the method provided in an embodiment of the present invention determined based on Mongodb apart from line of shortest length section
Schematic flow sheet;
Fig. 6 is being determined based on Mongodb apart from line of shortest length section for an alternate embodiment of the present invention offer
Schematic diagram;
Fig. 7 is the structural representation of the device provided in an embodiment of the present invention that distance is obtained based on Mongodb
Figure;
Fig. 8 is that an alternate embodiment of the present invention provides one kind based on Mongodb acquisitions apart from line of shortest length section
Device.
Embodiment
Some vocabulary have such as been used to censure specific components among specification and claim.This area skill
Art personnel are, it is to be appreciated that hardware manufacturer may call same component with different nouns.This explanation
Book and claim be not in the way of the difference of title is used as differentiation component, but with component in function
On difference be used as the criterion of differentiation.Such as " the bag in specification in the whole text and claim mentioned in
Containing " it is an open language, therefore " include but be not limited to " should be construed to." substantially " refer to receive
Error range in, those skilled in the art can solve the technical problem in the range of certain error,
Basically reach the technique effect.Specification subsequent descriptions is implement the better embodiment of the present invention, so
The description is for the purpose of illustrating the rule of the present invention, to be not limited to the scope of the present invention.
Protection scope of the present invention is worked as to be defined depending on the appended claims person of defining.
In the prior art, determined for one outside line segment and line segment a bit, can be using Mongodb certainly
The Near functions of band calculate the distance that obtained point arrives line segment, but the obtained point of use the method is to line
The distance of section and the range deviation of actual point to line are larger, therefore, the embodiment of the present invention provides a kind of accurate
Method of the higher calculating point of true property to the distance of line.
As shown in Fig. 2 a kind of method that distance is obtained based on Mongodb, this method is included:
Step 201, when the length between two shape points adjacent on line segment be more than predetermined value when, then exist
A shape point is inserted in the centre position of two adjacent shape points on the line segment, until the line segment
When length between upper every two adjacent shape points is both less than equal to predetermined value, stop inserted-shape point;
Optionally, shape point can be the coordinate points in rectangular coordinate system, and shape point can be by abscissa value
Determined with ordinate value.
Starting total length between shape point A and ending shape point B can be according to shape point A coordinate
Location and shape point B coordinate position is determined, you can with 2 points of (shape point A under plane coordinate system
And shape point B) between range formula calculate obtain.
The predetermined value can be different according to actual demand, such as predetermined value can be several meters, several decimeters,
Several centimetres, several millimeters etc..
Optionally, judge whether total length is more than predetermined value, if it is, performing step:
The first cut-point C is inserted in the point midway started between shape point A and ending shape point B,
And first cut-point C be located at line segment AB on.
The point midway can be in rectangular coordinate system midpoint, i.e. the point midway can be according to shape point
A and shape point B coordinate position are determined.
In a specific example, above-mentioned steps can be realized in the following way:
The Polyline of vector is imported into Mongodb, Polyline is according to two in Mongodb
The coordinate sequence string storage of dimension, such as:{″_id″:ObjectId (" 535884771dbba31858ad2101 "),
″geo″:{″type″:" Polyline ", " Coordinates ":[[[96.722,38.755], [97.3482,
38.6922], [97.1674,38.0752], [96.5474,38.1383]]] } }, then set up two-dimentional rope
Draw.
Each Polyline objects are traveled through, the distance between each two shape point are calculated, if this is apart from small
Difference operation is then carried out in default predetermined value (such as the predetermined value is 1 meter)
Optionally, this step includes:It is determined that starting first between shape point A and the first cut-point C
Length t1 is not more than predetermined value, and the second length between shape point B and the first cut-point C that ends up
T2 is not more than predetermined value.
T1, t2 can be calculated with the distance between two points formula under plane coordinate system and obtained, i.e. t1 can be according to beginning
Shape point A coordinate value and the first cut-point C coordinate value are obtained, and t2 can be according to ending shape point B
Obtained with the first cut-point C coordinate value.
Starting the first length between shape point A and the first cut-point C can use and step S201 classes
As method obtain, ending shape point B and the first cut-point C between the second length can also use
The method similar with determining the total length between line segment AB beginning shape point A and ending shape point B
Obtain.
Step 202, the minimum value by each shape point distance on selected fixing point outside line segment and the line segment,
Determine the fixing point to the distance of the line segment.
Optionally, in this step, obtain between line segment an outer fixing point P and beginning shape point A
The second spacing d2 and fixing point P between first spacing d1, fixing point P and ending shape point B with
The 3rd spacing d3 between first cut-point C.
D1, d2, d3 can be calculated with the distance between two points formula under plane coordinate system and obtained, i.e. d1 can root
Obtained according to fixing point P coordinate value and beginning shape point A coordinate value, d2 can be according to fixing point P's
The coordinate value of coordinate value and ending shape point B is obtained, and d3 can be according to fixing point P coordinate value and first
Cut-point C coordinate value is obtained.
Optionally, include in this step:Determine between the first spacing d1, the second spacing d2 and the 3rd
Away from distance of the reckling in d3 as fixing point P to line segment AB.
D1 can be compared with d2, d3 successively, find out reckling.
Line segment is marked several shape points by the embodiment of the present invention using mathematic interpolation method, and two neighboring
Length between shape point is not more than predetermined value.Calculated successively on point P to line segment AB using the above method
The distance of each shape point, using minimum value therein as point P to line segment AB distance.Compared to existing
There is the distance that point P to line segment AB is obtained in technology, arrived using calculating point P provided in an embodiment of the present invention
Point P to line segment AB that the method for line segment AB distance is obtained distance are closer to point P to line segment
AB vertical range, accuracy is higher.
Such as Fig. 3, an alternate embodiment of the present invention is provided to be determined apart from the side of line of shortest length section based on Mongodb
Method, comprises the following steps:
Step 301, determination include the buffering area of fixing point;
Some line segments in step 302, the selection buffering area;
The distance of step 303, the calculating fixing point to every line segment;
Step 304, the line segment by fixing point distance minimum described in distance in the buffering area, are defined as institute
State the nearest line segment of fixing point;
Wherein, the distance for calculating fixing point to every line segment includes:
Step 201, when the length between two shape points adjacent on line segment be more than predetermined value when, then exist
A shape point is inserted in the centre position of two adjacent shape points on the line segment, until every on the line segment
When length between two adjacent shape points is both less than equal to predetermined value, stop inserted-shape point;
Step 202, the minimum value by each shape point distance on the fixing point and the line segment, are defined as institute
Fixing point is stated to the distance of the line segment.
It should be noted that being put based on Mongodb acquisitions for other embodiment offer of the present invention is arrived
The method of the distance of line segment, can also comprise the following steps M1-M5:
Step M1:It is determined that the first length t1 started between shape point A and the first cut-point C is more than
The second length t2 between predetermined value and ending shape point B and the first cut-point C is not more than predetermined value.
Step M2:The second point midway insertion the between shape point A and the first cut-point C is started
Two cut-point D.
Here the second point midway can use the similar acquisition of the first point midway in above-described embodiment
Mode is obtained.
According to above-described embodiment, if starting the first length between shape point A and the first cut-point C
The second length t2 between ending shape point B and the first cut-point C is no more than predetermined value, then not
Line segment AB is split again, cut-point is added.
Step M3:It is determined that the 3rd length t3 started between shape point A and the second cut-point D is little
The 4th length t4 between predetermined value and the second cut-point D and the first cut-point C is not more than predetermined value.
T3, t4 can be calculated with the distance between two points formula under plane coordinate system and obtained, i.e. t3 can be according to beginning
Shape point A coordinate value and the second cut-point D coordinate value are obtained, and t4 can be according to the second cut-point D
Obtained with the first cut-point C coordinate value.
If the first length started between shape point A and the first cut-point C is more than predetermined value, after
It is continuous that line segment AB is split, cut-point is added, up to adjacent shapes point all on line segment AB it
Between length be not more than predetermined value.
Step M4:Obtain the 4th spacing d4 between fixing point P and the second cut-point D.
D4 can be calculated with the distance between two points formula under plane coordinate system and obtained, i.e. d4 can be according to fixing point
P coordinate value and the coordinate value acquisition for starting shape point A.
Step M5:Determine the first spacing d1, the second spacing d2, the 3rd spacing d3 and the 4th spacing
Reckling is fixing point P to line segment AB distance in d4.
D4 can be compared with the reckling in d1, d2, d3, find out the reckling in four.
In addition, in other embodiment, it is provided in an embodiment of the present invention that point is obtained based on Mongodb
Method to the distance of line segment can also comprise the following steps N1-N5:
Step N1:It is determined that the second length t2 between ending shape point B and the first cut-point C is not more than
Predetermined value.
Step N2:The 3rd point midway insertion the between shape point B and the first cut-point C at the end of
Three cut-point E.
Here the 3rd point midway can use the similar acquisition of the first point midway in above-described embodiment
Mode is obtained.
Step N3:It is determined that the 5th length t5 between ending shape point B and the 3rd cut-point E is not more than
The 6th length t6 between predetermined value and the first cut-point C and the 3rd cut-point E is not more than predetermined value.
T5, t6 can be calculated with the distance between two points formula under plane coordinate system and obtained, i.e. t5 can be according to ending
Shape point B coordinate value and the 3rd cut-point E coordinate value are obtained, and t6 can be according to the first cut-point C
Obtained with the 3rd cut-point E coordinate value.
If the 5th length t5 between the shape point B and the 3rd cut-point E that ends up is more than predetermined value, and/
Or, the first the 6th length t6 between cut-point C and the 3rd cut-point E is more than predetermined value, then continues
Line segment AB is split, cut-point is added, until between adjacent shapes point all on line segment AB
Length be not more than predetermined value.
Step N4:Obtain the 5th spacing d5 between ending shape point B and the 3rd cut-point E.
D5 can be calculated with the distance between two points formula under plane coordinate system and obtained, i.e. d5 can be according to fixing point
P coordinate value and the coordinate value acquisition for starting shape point A.
Step N5:Determine the first spacing d1, the second spacing d2, the 3rd spacing d3, the 4th spacing d4
And the 5th reckling in spacing d5 be fixing point P to line segment AB distance.
D5 can be compared with the reckling in d1, d2, d3, d4, find out the reckling in five.
The device provided in an embodiment of the present invention that distance is obtained based on Mongodb, using mathematic interpolation side
Line segment is marked the length between several shape points, and two neighboring shape point and is not more than predetermined value by method.
The distance of each shape point on point P to line segment AB is calculated successively using the above method, with minimum therein
It is worth the distance as point P to line segment AB.Compared in the prior art obtain point P to line segment AB away from
From the point P of the method acquisition of the distance using calculating point P provided in an embodiment of the present invention to line segment AB
Distance to line segment AB is closer to point P to line segment AB vertical range, and accuracy is higher.
In addition, an alternate embodiment of the present invention also provides a kind of method that distance is obtained based on Mongodb,
As shown in Figure 5,6, this method may include steps of:
Step S501:It is determined that the buffering area Q comprising fixing point P.
In some embodiments, step S501 can be realized using following steps:
Fixing point P can be determined first;
Then border circular areas can be delimited by radius of preset value and is used as buffering area using fixing point P as the center of circle
Q。
Step S502:Select some line segments in buffering area Q.
There may be many bar line segments in some embodiments, in buffering area Q, can select in these line segments
Whole line segments, a part of line segment in these line segments can also be selected.Wherein, these line segments selected
Can be without fixing point P.
For example in Fig. 6, P1-P12 constitutes many bar line segments, can select line segment P1P2 therein and line
Section P8P9.
Step S503:Calculate the distance of P to every line segment of fixing point.
Point P can be calculated to line using the method based on Mongodb acquisition distances shown in above-mentioned Fig. 2
Section P1P2 distance and point P to line segment P8P9 distance, the point P for example obtained according to the method
Distance to line segment P1P2 is d1, and point P to line segment P8P9 distance is d3.
Step S504:It is determined that being apart from most short line segment to fixing point P apart from the corresponding line segment of reckling.
If d1 is less than d3, P1P2 is apart from most short line segment to fixing point P;Conversely, then P8P9
For to fixing point P distances most short line segment.
The line segment closest to fixing point determined using the above method can be more accurate.
In addition, as shown in fig. 7, an alternate embodiment of the present invention also provide one kind obtained based on Mongodb
The device of distance is taken, as shown in figure 4, the device can include:Judge module 701, processing module 702
And acquisition module 703, wherein,
The judge module 701, for judge the length between two shape points adjacent on line segment with it is pre-
The relation of definite value;
The processing module 702, for being more than in advance when the length between two shape points adjacent on line segment
During definite value, then a shape point is inserted in the centre position of two adjacent shape points on the line segment,
Until when the length on the line segment between every two adjacent shape points is both less than equal to predetermined value, stopping
Inserted-shape point;
The acquisition module 703, for by selected fixing point outside line segment and each shape point on the line segment away from
From minimum value, be defined as the fixing point to the distance of the line segment.
In addition, as shown in figure 8, an alternate embodiment of the present invention provides a kind of based on Mongodb acquisitions
Apart from the device of line of shortest length section.This device includes:Acquisition module 801, selecting module 802, calculating mould
Block 803, first processing module 804, the processing module 806 of Second processing module 805 and the 3rd;Wherein,
The acquisition module 801, for the buffering area for determining to include fixing point;
The selecting module 802, for selecting some line segments in the buffering area;
The computing module 803, for calculating the fixing point to the distance of every line segment;
The first processing module 804, for by fixing point distance is minimum described in distance in the buffering area
Line segment, be defined as the nearest line segment of the fixing point;
The Second processing module 805, for when the length between two shape points adjacent on line segment it is big
When predetermined value, then a shape is inserted in the centre position of two adjacent shape points on the line segment
Point, until when the length on the line segment between every two adjacent shape points is both less than equal to predetermined value, stopping
Only inserted-shape point;
3rd processing module 806, for by each shape point distance on the fixing point and the line segment
Minimum value, is defined as the fixing point to the distance of the line segment.
Optionally, the acquisition module 801 includes:Selecting unit 811 and processing unit 812;Wherein,
The selecting unit 811, for determining the fixing point;
The processing unit 812, it is circular for being delimited by the center of circle of the fixing point by radius of preset value
Region is used as the buffering area.
Some preferred embodiments of the present invention have shown and described in described above, but as it was previously stated, should manage
The solution present invention is not limited to form disclosed herein, is not to be taken as the exclusion to other embodiment,
And available for it is various other combination, modification and environment, and can in invention contemplated scope described herein,
It is modified by the technology or knowledge of above-mentioned teaching or association area.And those skilled in the art are carried out changes
Dynamic and change does not depart from the spirit and scope of the present invention, then all should appended claims of the present invention protection
In the range of.
Claims (6)
1. a kind of method that distance is obtained based on Mongodb, it is characterised in that methods described includes:
When the length between two shape points adjacent on line segment is more than predetermined value, then on the line segment
A shape point is inserted in the centre position of two adjacent shape points, until per adjacent on the line segment
When length between two shape points is both less than equal to predetermined value, stop inserted-shape point;
By selected fixing point outside line segment and the minimum value of each shape point distance on the line segment, it is defined as described
Distance of the fixing point to the line segment.
2. a kind of device that distance is obtained based on Mongodb, it is characterised in that including:Judge module,
Processing module and acquisition module, wherein,
The judge module, for judging length and predetermined value between two shape points adjacent on line segment
Relation;
The processing module, for being more than predetermined value when the length between two shape points adjacent on line segment
When, then a shape point is inserted in the centre position of two adjacent shape points on the line segment, until
When length on the line segment between every two adjacent shape points is both less than equal to predetermined value, stop insertion
Shape point;
The acquisition module, for by selected fixing point outside line segment and each shape point distance on the line segment
Minimum value, is defined as the fixing point to the distance of the line segment.
3. a kind of method determined based on Mongodb apart from line of shortest length section, it is characterised in that the side
Method includes:
It is determined that the buffering area comprising fixing point;
Select some line segments in the buffering area;
The fixing point is calculated to the distance of every line segment;
By the minimum line segment of fixing point distance described in distance in the buffering area, it is defined as the fixing point
Nearest line segment;
The distance for calculating fixing point to every line segment includes:
When the length between two shape points adjacent on line segment is more than predetermined value, then the institute on the line segment
A shape point is inserted in the centre position for stating two adjacent shape points, until per adjacent two on the line segment
When length between shape point is both less than equal to predetermined value, stop inserted-shape point;
By the minimum value of each shape point distance on the fixing point and the line segment, it is defined as the fixing point and arrives
The distance of the line segment.
4. method according to claim 3, it is characterised in that the determination includes fixing point
Buffering area, including:
Determine the fixing point;
Border circular areas delimited by the center of circle of the fixing point by radius of preset value and is used as the buffering area.
5. a kind of device obtained based on Mongodb apart from line of shortest length section, it is characterised in that the dress
Put including:Acquisition module, selecting module, computing module, first processing module, Second processing module and
3rd processing module;Wherein,
The acquisition module, for the buffering area for determining to include fixing point;
The selecting module, for selecting some line segments in the buffering area;
The computing module, for calculating the fixing point to the distance of every line segment;
The first processing module, for by the minimum line of fixing point distance described in distance in the buffering area
Section, is defined as the nearest line segment of the fixing point;
The Second processing module, for being more than in advance when the length between two shape points adjacent on line segment
During definite value, then a shape point is inserted in the centre position of two adjacent shape points on the line segment, directly
When length on to the line segment between every two adjacent shape points is both less than equal to predetermined value, stop insertion
Shape point;
3rd processing module, for by the minimum of each shape point distance on the fixing point and the line segment
Value, is defined as the fixing point to the distance of the line segment.
6. the device according to claim 5 obtained based on Mongodb apart from line of shortest length section, its
It is characterised by, the acquisition module includes:Selecting unit and processing unit;Wherein,
The selecting unit, for determining the fixing point;
The processing unit, for delimiting border circular areas by the center of circle of the fixing point by radius of preset value
It is used as the buffering area.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610046174.0A CN106997355B (en) | 2016-01-25 | 2016-01-25 | Method and device for obtaining distance and determining shortest distance line segment based on Mongodb |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610046174.0A CN106997355B (en) | 2016-01-25 | 2016-01-25 | Method and device for obtaining distance and determining shortest distance line segment based on Mongodb |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106997355A true CN106997355A (en) | 2017-08-01 |
CN106997355B CN106997355B (en) | 2020-06-02 |
Family
ID=59428649
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610046174.0A Active CN106997355B (en) | 2016-01-25 | 2016-01-25 | Method and device for obtaining distance and determining shortest distance line segment based on Mongodb |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106997355B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108994838A (en) * | 2018-08-21 | 2018-12-14 | 智久(厦门)机器人科技有限公司上海分公司 | The relationship calculation method and system of robot location and planning path |
CN109945888A (en) * | 2019-03-11 | 2019-06-28 | 百度在线网络技术(北京)有限公司 | Generation method, device and the computer equipment of navigation guide line |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101447947A (en) * | 2008-12-26 | 2009-06-03 | 北京农业信息技术研究中心 | Linear optimal shortest path search method |
US20120032962A1 (en) * | 2010-08-09 | 2012-02-09 | Verizon Patent And Licensing Inc. | Polyline vertex reduction |
CN104751733A (en) * | 2013-12-25 | 2015-07-01 | 携程计算机技术(上海)有限公司 | Region drawing method, region drawing device, path distance classifying method and path distance classifying system for maps |
-
2016
- 2016-01-25 CN CN201610046174.0A patent/CN106997355B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101447947A (en) * | 2008-12-26 | 2009-06-03 | 北京农业信息技术研究中心 | Linear optimal shortest path search method |
US20120032962A1 (en) * | 2010-08-09 | 2012-02-09 | Verizon Patent And Licensing Inc. | Polyline vertex reduction |
CN104751733A (en) * | 2013-12-25 | 2015-07-01 | 携程计算机技术(上海)有限公司 | Region drawing method, region drawing device, path distance classifying method and path distance classifying system for maps |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108994838A (en) * | 2018-08-21 | 2018-12-14 | 智久(厦门)机器人科技有限公司上海分公司 | The relationship calculation method and system of robot location and planning path |
CN109945888A (en) * | 2019-03-11 | 2019-06-28 | 百度在线网络技术(北京)有限公司 | Generation method, device and the computer equipment of navigation guide line |
Also Published As
Publication number | Publication date |
---|---|
CN106997355B (en) | 2020-06-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102903134B (en) | Fast Drawing is the method for curve repeatedly | |
CN105631936A (en) | Point cloud repair method and system | |
US10867251B2 (en) | Estimation results display system, estimation results display method, and estimation results display program | |
CN110111384A (en) | A kind of scaling method, the apparatus and system of TOF depth mould group | |
CN106997355A (en) | Based on Mongodb obtain distance, determine apart from line of shortest length section method and device | |
Klewicki et al. | Finite Reynolds number properties of a turbulent channel flow similarity solution | |
CA2986396A1 (en) | Calculation method for compressed air-flow rate, calculation device thereof, and storage medium | |
CN101387506A (en) | Point cloud optimum alignment method | |
CN103365778B (en) | A kind of method and apparatus testing control | |
CN109373893A (en) | A kind of method and storage equipment of calculating object package size | |
CN103017749A (en) | Method, apparatus and navigator for converting narrow and long water system surface element into line element | |
CN102680012B (en) | System and method for automatic output of measuring information | |
CN106918377B (en) | For the calibrating installation of virtual flowmeter, sensitivity determining module and correlation method | |
CN104021708B (en) | Coriolis acceleration demonstrator and section's formula inertia force measuring method | |
CN102968305A (en) | Logical processing method, logical processing device and evaluation system | |
CN107273509B (en) | Neural network data memory, data storage method and data search method | |
EP2866205A2 (en) | Three-dimensional model generation apparatus, three-dimensional model generation method, and program | |
CN103424070A (en) | Curved face coordinate system set-up system and method | |
TWI510758B (en) | System and method for measuring contour line of object | |
CN107402986A (en) | The visual presentation method and system of a kind of multi-dimensional data | |
CN103473413B (en) | A kind of comparative approach for various a large amount of Mechanics Calculation results | |
CN107562712A (en) | A kind of statement similarity computational methods and device | |
CN109284328B (en) | Relational data processing method, device, server and medium | |
CN104751005A (en) | Flatness error evaluation method based on orthogonal experiment | |
CN206124553U (en) | Oval chi of drawing |
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 |