[GRASS-user] Finding Nearest Intersection (point) on Road Network

Ryan Rosario uclamathguy at gmail.com
Mon Jan 5 14:44:46 EST 2009



Moritz Lennert wrote:
> 
> 
> Thanks for the reply. Sorry for the delay...out of town.
> 
> On Wed, December 24, 2008 05:55, Ryan R. Rosario wrote:
>>
>> GRASS simply returns the same point back, since the closest node to A is
>> A.
> 
> In grass6.4 you have the dmin option to avoid that.
> 

That is good to know. Apparently it is not in the tcl/tk GUI.



>> If I use patch first, then the from and to maps in v.distance must be the
>> same, unless I am misunderstanding something.
> 
> That is correct.
> 
>>
>> The vector map containing the intersections (the set of points B)
>> contains
>> both points (created using v.net nodes) and lines (the original road
>> network). I can get the nearest point using v.distance, but this uses
>> straight-line distance, not the distance along the road.
>>
>> Although v.distance offers the "to_along" option, there does not appear
>> to
>> be anywhere to specify which vector contains the road network.
> 
> IIUC, to_along works if your from_map is a point map and your to_map is a
> line map.
> 
>> And it
>> seems
>> that v.net.path requires that both the start and end points must be known
>> a
>> priori, and I only have the start point. I am trying to find the end
>> point
>> (the nearest intersection). I am stuck, but I think I am missing
>> something
>> important here.
> 
> As a reminder, here's your original question:
> "I have two vector maps consisting of points and a vector map containing a
> road network. Given a point A, I want to find the nearest point B along
> the
> road network, for each A."
> 
> There is a definite need for a v.net.distance, i.e. a v.distance on a
> network. Maybe you could file a wish for that on trac.
> 

Will do. I am glad you mentioned this. I suspected that what I was
attempting was not easy, or not yet possible, but kept chasing my tail.



> Here's an algorithm I imagine could help you get closer to an answer
> (untested):
> 
> - Use v.net.iso on your road network with one point A as starting point
> setting "costs" to a sufficiently fine-grained resolution of distances.
> - Run v.distance with from_map=B to_map=VNetIsoOutput upload=cat
> - Find point in B with lowest cat (through SQL query on the attribute
> table)
> 

I will try this.



> Quite convulted, but might work, depending on the number of points and the
> complexity of your road network. Note that currently the v.net.* modules
> in GRASS do not work very well, and hardly at all once the network becomes
> too big. Rewriting these modules to be more scalable and reliable would be
> a nice Google Summer of Code project for next year.
> 

That would be excellent. Now that I know this, I might take a look at the
code, as what I am trying to do relates to my dissertation. 


R.
-- 
View this message in context: http://n2.nabble.com/Finding-Nearest-Intersection-%28point%29-on-Road-Network-tp1886245p2114512.html
Sent from the Grass - Users mailing list archive at Nabble.com.



More information about the grass-user mailing list