_write_osm_id(out, result.osm_object)
- out.keyval('lat', result.centroid.lat)\
- .keyval('lon', result.centroid.lon)\
+ out.keyval('lat', f"{result.centroid.lat}")\
+ .keyval('lon', f"{result.centroid.lon}")\
.keyval(class_label, result.category[0])\
.keyval('type', result.category[1])\
.keyval('place_rank', result.rank_search)\
out.key('admin').start_object()
if result.address_rows:
for line in result.address_rows:
- if line.isaddress and (line.admin_level or 15) < 15 and line.local_name:
+ if line.isaddress and (line.admin_level or 15) < 15 and line.local_name \
+ and line.category[0] == 'boundary' and line.category[1] == 'administrative':
out.keyval(f"level{line.admin_level}", line.local_name)
out.end_object().next()