From e12ea4ebbae848bd727e2ec47f97c238329b8569 Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Tue, 16 May 2017 18:39:59 +0300 Subject: [PATCH] =?UTF-8?q?Rename=20priority=20=E2=86=92=20weight?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conflate.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/conflate.py b/conflate.py index 3fb84bc..60c3682 100755 --- a/conflate.py +++ b/conflate.py @@ -289,8 +289,8 @@ class OsmConflator: coord[i] += nodes[nd.get('ref')][i] ways[way.get('id')] = [coord[0] / count, coord[1] / count] - # For calculating priority of OSM objects - priority_fn = self.profile.get_raw('priority') + # For calculating weight of OSM objects + weight_fn = self.profile.get_raw('weight') max_distance = self.profile.get('max_distance', MAX_DISTANCE) for el in xml: @@ -327,10 +327,10 @@ class OsmConflator: pt = OSMPoint(el.tag, int(el.get('id')), int(el.get('version')), coord[0], coord[1], tags) pt.members = members if pt.is_poi(): - if callable(priority_fn): - priority = priority_fn(pt) - if priority: - pt.dist_offset = priority if abs(priority) >= 5 else priority * max_distance + if callable(weight_fn): + weight = weight_fn(pt) + if weight: + pt.dist_offset = weight if abs(weight) >= 5 else weight * max_distance self.osmdata[pt.id] = pt def register_match(self, dataset_key, osmdata_key, keep=False, retag=None):