Skip to content

Commit

Permalink
fix #5429
Browse files Browse the repository at this point in the history
  • Loading branch information
namdre committed Apr 16, 2024
1 parent 390b79c commit 7af62cb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tools/sumolib/shapes/polygon.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ def getBoundingBox(shape):

class Polygon:

def __init__(self, id, type=None, color=None, layer=None, fill=None, shape=None):
def __init__(self, id, type=None, color=None, layer=None, fill=None,
shape=None, geo=None, angle=None, lineWidth=None, imgFile=None):
self.id = id
self.type = type
self.color = color
Expand All @@ -47,6 +48,10 @@ def __init__(self, id, type=None, color=None, layer=None, fill=None, shape=None)
self.layer = layer
self.fill = fill
self.shape = shape
self.geo = geo
self.angle = angle
self.lineWidth = lineWidth
self.imgFile = imgFile
self.attributes = {}

def getBoundingBox(self):
Expand Down Expand Up @@ -103,7 +108,9 @@ def startElement(self, name, attrs):
if name == 'poly' and not self._includeTaz:
c = color.decodeXML(attrs['color'])
poly = Polygon(attrs['id'], attrs.get('type'), c,
attrs.get('layer'), attrs.get('fill'), cshape)
attrs.get('layer'), attrs.get('fill'), cshape,
attrs.get('geo'), attrs.get('angle'),
attrs.get('lineWidth'), attrs.get('imgFile'))
else:
poly = Polygon(attrs['id'], color=attrs.get('color'), shape=cshape)
self._id2poly[poly.id] = poly
Expand Down

0 comments on commit 7af62cb

Please sign in to comment.