From 0c1716da065182ee72f4b350cd9bf24ef70fb885 Mon Sep 17 00:00:00 2001 From: Brian Cavagnolo Date: Thu, 4 Apr 2013 13:05:28 -0700 Subject: [PATCH] make Relation.replacejwithi operate on geometry like everyone else 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. --- ogr2osm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ogr2osm.py b/ogr2osm.py index 345f8c6..81d6024 100755 --- a/ogr2osm.py +++ b/ogr2osm.py @@ -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)