Subject: [ggl] Understanding get_turns for linestring/polygon overlay
From: John Swensen (jpswensen)
Date: 2011-02-03 11:28:12
On Feb 3, 2011, at 11:14 AM, Barend Gehrels wrote:
> Hi John,
>> I have a simple case working (where the cut only crosses the boundary of the polygon 2 times). However, I noticed that when I am building it for the iphone simulator things work fine. However, when I build it for the iphone device there are errors. I think it may have to do with the compiler and standard template libraries used for the iphone device. I think it may be more the compiler than the STL because the problem is occurring in deque.tcc and this file is the same for both the simulator and device source trees.
>> The offending line of code is when I try to union one half of my split polygon with a reflected version of the other half (I am "folding" the original polygon along a user defined line).
>> union_(unreflectedPoly, reflectedPoly, ps);
>> I have included the compiler error output below. The last Boost line of code in the error trace is in the traverse function. I don't understand the Boost.Geometry sources fully, but I tried to comment out the offending line:
>> near line 260 of algorithms/detail/overlay/traverse.hpp and things compiled for both simulator and device. Things also appear to still be working fine, but I am sure that random commenting of lines of source code have definitely messed something up.
> [snipped the rest]
> It seems as if the resize method is not supported by that compiler.
> I remember that resize is std::, but added relatively late, such that some compilers do not support it (IIRC).
> .replace might be replaced by something else e.g. an erase call. You might experiment with that. But at least you could comment the resize and check if it compiles (it will of course not run correctly then...)
> Regards, Barend
I can confirm that it does compile if I remove the call to resize. I don't quite understand what you were saying about .replace and erase. Are you saying that instead of using resize, I could use erase to remove objects at the end if the new size is smaller than the existing size and simply append to the end if the new size is larger than the existing size?
Geometry list run by mateusz at loskot.net