Skip to content

Commit

Permalink
make Relation.replacejwithi operate on geometry like everyone else
Browse files Browse the repository at this point in the history
While there is only one example of replacejwithi being called, it
is clear that the arguments are meant to be type Geometry, not
(Geometry, role) tuple.  So when replacing j with i, preserve the
existing role.
  • Loading branch information
Brian Cavagnolo committed Apr 4, 2013
1 parent d4dd50a commit 0c1716d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ogr2osm.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def __init__(self):
Geometry.__init__(self)
self.members = []
def replacejwithi(self, i, j):
self.members = [i if x == j else x for x in self.members]
self.members = [(i, x[1]) if x[0] == j else x for x in self.members]
j.removeparent(self)
i.addparent(self)

Expand Down

0 comments on commit 0c1716d

Please sign in to comment.