Boost logo

Boost Users :

Subject: Re: [Boost-users] measuring distance between a point and a segment
From: Juliette Pera (juliette.pera_at_[hidden])
Date: 2016-04-21 09:45:57


Actually it was for point inside the polygon so it explains the problem.

But can I access the elements of the polygon if I declare it as ring?
Then I can use the distance between the point and each segment to finally
take the smallest value.

Thank you
Juliette

2016-04-21 15:42 GMT+02:00 Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>:

> Juliette Pera wrote:
>
> Thank you very much it works very well now!
>
> I was considering using a ring type at first but I was having a wrong
> result too.
> I was using the *append* function and then the *correct *one.
> Maybe I was missing something to "close" the polygon?
>
>
> correct() should reverse and close the Ring for you if needed so it
> probably wasn't it.
> What was wrong with the result?
> Have in mind that for Points contained inside a Ring the distance is 0.
>
>
> You could debug your code and see if the data stored in your objects is
> correct before passing it into an algorithm.
> In order to debug Boost.Geometry conveniently you could use debugging
> visualizers/helpers:
>
> Visual Studio 2015:
>
> https://visualstudiogallery.msdn.microsoft.com/4b81868b-8901-408f-a28e-25a6580788fb
>
> Visual Studio 2012-13:
>
> https://github.com/awulkiew/graphical-debugging/blob/master/Visual_Studio_2015/GraphicalDebugging/BoostGeometry.natvis
> How to use it:
> https://msdn.microsoft.com/en-us/library/jj620914%28v=vs.110%29.aspx
>
> QtCreator:
> https://github.com/awulkiew/debugging-helpers
>
> Regards,
> Adam
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net