문제

I have a large database of locations, all with lat/long. I use GeoKit and Rails to trivially get locations within a set radius of any other location. All that works great.

My goal is to specify 2 locations (say, A and B), and find all other locations within a radius of Xmi on the path between A and B.

What are some ways in which you could approach this issue? I thought about performing my nearby search at some regular interval on the path, but then I am concerned about performance and the flip-side--missing locations near to the path just because I chose a poor interval.

Thoughts?

도움이 되었습니까?

해결책 2

I didn't find an elegant answer here, but sadiqxs was on the right track I suppose. GeoKit doesn't support non-rectangular searches, so I ended up with a solution similar to sadiqxs's but optimized to apply a maximum number of searches based on distance.

다른 팁

Just Calculate at end points,

At at intervals of radius length along the path

enter image description here

as shown in the diagram.

may this will solve your problem

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top