Category "polygon"

Testing whether a polygon is simple or complex

For a polygon defined as a sequence of (x,y) points, how can I detect whether it is complex or not? A complex polygon has intersections with itself, as shown:

OSM to Google Maps polygons

I want to draw a city district area on Google Maps using Polygon class and an array of lat/lng coordinates. OpenStreetMap provides me all data I need — i