def cleanPolygon(elem, options):
 global numPointsRemovedFromPolygon
 pts = parseListOfPoints(elem.getAttribute('points'))
 N = (len(pts) / 2)
 if (N >= 2):
  (startx, starty) = pts[:2]
  (endx, endy) = pts[(-2):]
  if ((startx == endx) and (starty == endy)):
   del pts[(-2):]
   numPointsRemovedFromPolygon += 1
 elem.setAttribute('points', scourCoordinates(pts, options, True))

def cleanPolygon ( elem , options ) : global numPointsRemovedFromPolygon pts = parseListOfPoints ( elem . getAttribute ( 'points' ) ) N = ( len ( pts ) / 2 ) if ( N >= 2 ) : ( startx , starty ) = pts [ : 2 ] ( endx , endy ) = pts [ ( - 2 ) : ] if ( ( startx == endx ) and ( starty == endy ) ) : del pts [ ( - 2 ) : ] numPointsRemovedFromPolygon += 1 elem . setAttribute ( 'points' , scourCoordinates ( pts , options , True ) )
remove unnecessary closing point of polygon points attribute .