take care of the case when a polygon has a hole.
also made a decision to make it fails loudly when a ring is not closed.