getCentroid should just return the first point if a linear ring only has less than three components (r=@tschaub)