Stephan Plepelits <sk...@xover.htu.tuwien.ac.at> writes:

> On Sun, Jun 27, 2010 at 07:11:53PM -0500, Nolan Darilek wrote:
>> 3. In dusting off my disused (and never that good to begin with :) math
>> skills from over a decade in my past, I'm thinking that a vector-based
>> solution might work. I am already calculating a node's neighbors if it
>> is on one or more ways, so I think that if I create vectors between the
>> nearest node and each of its neighbors, then determine which segment has
>> the least distance to the user's current location, then I've figured out
>> the user's new way with minimal complexity. Before I go off and
>> implement this (or rather, before I figure out which vector operations
>> apply here and *then* implement this :) can anyone tell me why this may
>> be a bad idea?
> I think this is a very good idea :) Check out the "Hesse normal form"[5] how
> to calculate the distance of a point to a line.

The nearest road does not need to have a node near your location.

Matthias

_______________________________________________
dev mailing list
dev@openstreetmap.org
http://lists.openstreetmap.org/listinfo/dev

Reply via email to