mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 01:47:57 +00:00
Compare commits
6 Commits
06d5ab4c2d
...
1aeb8a262c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1aeb8a262c | ||
|
|
ef7e842702 | ||
|
|
ec42fda1bd | ||
|
|
287ba2570e | ||
|
|
4711deeccb | ||
|
|
cf9e8d6b8e |
@@ -638,8 +638,10 @@ BEGIN
|
||||
|
||||
-- Add it to the list of search terms
|
||||
{% if not db.reverse_only %}
|
||||
IF location.rank_address != 11 AND location.rank_address != 5 THEN
|
||||
nameaddress_vector := array_merge(nameaddress_vector,
|
||||
location.keywords::integer[]);
|
||||
END IF;
|
||||
{% endif %}
|
||||
|
||||
INSERT INTO place_addressline (place_id, address_place_id, fromarea,
|
||||
|
||||
@@ -88,6 +88,10 @@ BEGIN
|
||||
area := area / 3;
|
||||
ELSIF country_code IN ('bo', 'ar', 'sd', 'mn', 'in', 'et', 'cd', 'mz', 'ly', 'cl', 'zm') THEN
|
||||
area := area / 2;
|
||||
ELSIF country_code IN ('sg', 'ws', 'st', 'kn') THEN
|
||||
area := area * 5;
|
||||
ELSIF country_code IN ('dm', 'mt', 'lc', 'gg', 'sc', 'nr') THEN
|
||||
area := area * 20;
|
||||
END IF;
|
||||
|
||||
IF area > 1 THEN
|
||||
|
||||
@@ -374,14 +374,17 @@ async def deletable_endpoint(api: NominatimAPIAsync, params: ASGIAdaptor) -> Any
|
||||
"""
|
||||
fmt = parse_format(params, RawDataList, 'json')
|
||||
|
||||
results = RawDataList()
|
||||
async with api.begin() as conn:
|
||||
for osm_type in ('N', 'W', 'R'):
|
||||
sql = sa.text(""" SELECT p.place_id, country_code,
|
||||
name->'name' as name, i.*
|
||||
FROM placex p, import_polygon_delete i
|
||||
WHERE p.osm_id = i.osm_id AND p.osm_type = i.osm_type
|
||||
WHERE i.osm_type = :osm_type
|
||||
AND p.osm_id = i.osm_id AND p.osm_type = :osm_type
|
||||
AND p.class = i.class AND p.type = i.type
|
||||
""")
|
||||
results = RawDataList(r._asdict() for r in await conn.execute(sql))
|
||||
results.extend(r._asdict() for r in await conn.execute(sql, {'osm_type': osm_type}))
|
||||
|
||||
return build_response(params, params.formatting().format_result(results, fmt, {}))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user