mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-11-30 02:07:52 +03:00
parent
4559886d83
commit
23eed4ff2f
@ -87,7 +87,7 @@ def _locate_interpolation(table: SaFromClause) -> SaLabel:
|
|||||||
def _is_address_point(table: SaFromClause) -> SaColumn:
|
def _is_address_point(table: SaFromClause) -> SaColumn:
|
||||||
return sa.and_(table.c.rank_address == 30,
|
return sa.and_(table.c.rank_address == 30,
|
||||||
sa.or_(table.c.housenumber != None,
|
sa.or_(table.c.housenumber != None,
|
||||||
table.c.name.has_key('housename')))
|
table.c.name.has_key('addr:housename')))
|
||||||
|
|
||||||
|
|
||||||
def _get_closest(*rows: Optional[SaRow]) -> Optional[SaRow]:
|
def _get_closest(*rows: Optional[SaRow]) -> Optional[SaRow]:
|
||||||
|
@ -111,7 +111,7 @@ def _filter_by_layer(table: SaFromClause, layers: DataLayer) -> SaColumn:
|
|||||||
orexpr.append(table.c.rank_address.between(1, 29))
|
orexpr.append(table.c.rank_address.between(1, 29))
|
||||||
orexpr.append(sa.and_(table.c.rank_address == 30,
|
orexpr.append(sa.and_(table.c.rank_address == 30,
|
||||||
sa.or_(table.c.housenumber != None,
|
sa.or_(table.c.housenumber != None,
|
||||||
table.c.address.has_key('housename'))))
|
table.c.address.has_key('addr:housename'))))
|
||||||
elif layers & DataLayer.POI:
|
elif layers & DataLayer.POI:
|
||||||
orexpr.append(sa.and_(table.c.rank_address == 30,
|
orexpr.append(sa.and_(table.c.rank_address == 30,
|
||||||
table.c.class_.not_in(('place', 'building'))))
|
table.c.class_.not_in(('place', 'building'))))
|
||||||
|
@ -60,7 +60,8 @@ def test_reverse_ignore_unindexed(apiobj):
|
|||||||
(0.7, napi.DataLayer.RAILWAY, 226),
|
(0.7, napi.DataLayer.RAILWAY, 226),
|
||||||
(0.7, napi.DataLayer.NATURAL, 227),
|
(0.7, napi.DataLayer.NATURAL, 227),
|
||||||
(0.70003, napi.DataLayer.MANMADE | napi.DataLayer.RAILWAY, 225),
|
(0.70003, napi.DataLayer.MANMADE | napi.DataLayer.RAILWAY, 225),
|
||||||
(0.70003, napi.DataLayer.MANMADE | napi.DataLayer.NATURAL, 225)])
|
(0.70003, napi.DataLayer.MANMADE | napi.DataLayer.NATURAL, 225),
|
||||||
|
(5, napi.DataLayer.ADDRESS, 229)])
|
||||||
def test_reverse_rank_30_layers(apiobj, y, layer, place_id):
|
def test_reverse_rank_30_layers(apiobj, y, layer, place_id):
|
||||||
apiobj.add_placex(place_id=223, class_='place', type='house',
|
apiobj.add_placex(place_id=223, class_='place', type='house',
|
||||||
housenumber='1',
|
housenumber='1',
|
||||||
@ -83,6 +84,11 @@ def test_reverse_rank_30_layers(apiobj, y, layer, place_id):
|
|||||||
rank_address=0,
|
rank_address=0,
|
||||||
rank_search=30,
|
rank_search=30,
|
||||||
centroid=(1.3, 0.70005))
|
centroid=(1.3, 0.70005))
|
||||||
|
apiobj.add_placex(place_id=229, class_='place', type='house',
|
||||||
|
name={'addr:housename': 'Old Cottage'},
|
||||||
|
rank_address=30,
|
||||||
|
rank_search=30,
|
||||||
|
centroid=(1.3, 5))
|
||||||
|
|
||||||
assert apiobj.api.reverse((1.3, y), layers=layer).place_id == place_id
|
assert apiobj.api.reverse((1.3, y), layers=layer).place_id == place_id
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user