[OSM-dev] Algorithm help

Richard Duivenvoorde rdmailings at duif.net
Wed May 28 21:35:14 BST 2008


Richard Fairhurst wrote:
> Can anybody point me in the direction of an algorithm that will  
> determine whether a closed way (polyline) is clockwise or anti- 
> clockwise?
> 
> cheers
> Richard
> 
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev

Richard,
there is a good set of (explanations of) algorithms here:

http://www.faqs.org/faqs/graphics/algorithms-faq/

There is no copy and paste code there, but the explanation how to do it 
in "Subject 2.07: How do I find the orientation of a simple polygon?" 
can maybe help you further?

Richard Duivenvoorde




More information about the dev mailing list