Question

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?

Was it helpful?

Solution 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.

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top