Function S2Polygon.isValid

Returns true if this is a valid polygon (including checking whether all the loops are themselves valid). Note that validity is checked automatically during initialization when --s2debug is enabled (true by default in debug binaries).

bool isValid();