From dd0c7f47517f04388da6b48d15fe0b6f69b94fbd Mon Sep 17 00:00:00 2001 From: Ilya Zverev Date: Thu, 24 May 2018 20:12:10 +0300 Subject: [PATCH] nwr for overpass --- CHANGELOG.md | 4 ++++ conflate/conflate.py | 11 ++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b9d1cdf..ae18b1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## master branch +* Added a simple kd-tree based geocoder for countries and regions. Controlled by the `regions` parameter in a profile. +* Using the new `nwr` query type of Overpass API. +* Reduced default `max_request_boxes` to four. + ## 1.3.3 _Released 2018-04-26_ diff --git a/conflate/conflate.py b/conflate/conflate.py index d585153..612a713 100755 --- a/conflate/conflate.py +++ b/conflate/conflate.py @@ -363,18 +363,15 @@ class OsmConflator: for bbox in bboxes: bbox_str = '' if bbox is None else '(' + ','.join([str(x) for x in bbox]) + ')' for tag_str in tag_strs: - for t in ('node', 'way', 'relation["type"="multipolygon"]'): - query += t + tag_str + bbox_str + ';' + query += 'nwr' + tag_str + bbox_str + ';' if self.ref is not None: if not self.profile.get('bounded_update', False): - for t in ('node', 'way', 'relation'): - query += t + '["' + self.ref + '"];' + query += 'nwr["' + self.ref + '"];' else: for bbox in bboxes: bbox_str = '' if bbox is None else '(' + ','.join( [str(x) for x in bbox]) + ')' - for t in ('node', 'way', 'relation'): - query += t + '["' + self.ref + '"]' + bbox_str + ';' + query += 'nwr["' + self.ref + '"]' + bbox_str + ';' query += '); out meta qt center;' return query @@ -479,7 +476,7 @@ class OsmConflator: if area * 100 < initial_area: # Stop splitting when the area decrease is less than 1% break - logging.debug('Splitting bbox %s at %s %s-%s; area decrease %s%%', + logging.debug('Splitting bbox %s at %s %s..%s; area decrease %s%%', get_bbox(candidate_box), 'longs' if point_array == 3 else 'lats', candidate_box[point_array][point_id][0],