nwr for overpass
This commit is contained in:
parent
1e034bafa4
commit
dd0c7f4751
2 changed files with 8 additions and 7 deletions
|
@ -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_
|
||||
|
|
|
@ -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],
|
||||
|
|
Loading…
Add table
Reference in a new issue