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
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-25a65...
Visual Studio 2012-13:
https://github.com/awulkiew/graphical-debugging/blob/master/Visual_Studio_20... 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@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users