I finally found a solution for determining if I have a self- intersecting polygon. I translated the following C++ file into flex, customized it a bit and it worked beautifully. Thanks to Damian Coventry!
Solution: http://local.wasp.uwa.edu.au/~pbourke/geometry/lineline2d/example.cpp On Mar 19, 10:38 pm, pamela fox <[email protected]> wrote: > Hi Aaron- > > You'd need to check whether any line in the polygon intersected any > other one. There are various line intersection algorithms on the web, > and it may be easier for you to use them after performing > fromLatLngToPoint on the vertices of the polyline. > > Here's an example function I found for processing that could be > adapted:http://snippets.dzone.com/posts/show/2087 > > There's also a thread in the JS API group which discusses some hacks > that could work most of the > time:http://groups.google.com/group/Google-Maps-API/browse_frm/thread/9a39... > > - pamela > > On Thu, Mar 19, 2009 at 10:48 AM, Aaron Donohue <[email protected]> > wrote: > > > I have created an application that allows a user to draw a polygon on > > a google map. When the user is 'done' drawing the polygon I need to > > be able to confirm that no lines within that single polygon > > intersect. Does anyone know how I might accomplish this (I literally > > only need a boolean whether they intesect)? I see how I would go > > about verifying if two polygons intersect but nothing about whether > > two lines within a single polygon intersect. I have attempted > > leveraging the LatLngBounds.intersects(other:LatLngBounds):Boolean > > method without success. > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API For Flash" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-maps-api-for-flash?hl=en -~----------~----~----~----~------~----~------~--~---
