mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-09 11:34:07 +00:00
revert importing of housenumber interpolations
This commit is contained in:
@@ -378,8 +378,8 @@ Feature: Import of address interpolations
|
||||
|
||||
Scenario: Ways without node entries are ignored
|
||||
Given the interpolations
|
||||
| osm | type | geometry |
|
||||
| W1 | even | 1 1, 1 1.001 |
|
||||
| osm | type | geometry | nodes |
|
||||
| W1 | even | 1 1, 1 1.001 | 34,45 |
|
||||
And the named places
|
||||
| osm | class | type | geometry |
|
||||
| W10 | highway | residential | 1 1, 1 1.001 |
|
||||
|
||||
@@ -287,38 +287,6 @@ Feature: Searching of house numbers
|
||||
| N1 |
|
||||
|
||||
|
||||
Scenario: Interpolations are found according to their type
|
||||
Given the grid
|
||||
| 10 | | 11 |
|
||||
| 100 | | 101 |
|
||||
| 20 | | 21 |
|
||||
And the places
|
||||
| osm | class | type | name | geometry |
|
||||
| W100 | highway | residential | Ringstr | 100, 101 |
|
||||
And the places
|
||||
| osm | class | type | addr+interpolation | geometry |
|
||||
| W10 | place | houses | even | 10, 11 |
|
||||
| W20 | place | houses | odd | 20, 21 |
|
||||
And the places
|
||||
| osm | class | type | housenr | geometry |
|
||||
| N10 | place | house | 10 | 10 |
|
||||
| N11 | place | house | 20 | 11 |
|
||||
| N20 | place | house | 11 | 20 |
|
||||
| N21 | place | house | 21 | 21 |
|
||||
And the ways
|
||||
| id | nodes |
|
||||
| 10 | 10, 11 |
|
||||
| 20 | 20, 21 |
|
||||
When importing
|
||||
When geocoding "Ringstr 12"
|
||||
Then the result set contains
|
||||
| object |
|
||||
| W10 |
|
||||
When geocoding "Ringstr 13"
|
||||
Then the result set contains
|
||||
| object |
|
||||
| W20 |
|
||||
|
||||
Scenario: A housenumber with interpolation is found
|
||||
Given the places
|
||||
| osm | class | type | housenr | addr+interpolation | geometry |
|
||||
|
||||
@@ -20,9 +20,9 @@ Feature: Import of interpolations
|
||||
| object | class | type |
|
||||
| W13002 | place | city |
|
||||
And place_interpolation contains exactly
|
||||
| object | type | address!dict | nodes!ints | geometry!wkt |
|
||||
| W13001 | odd | "street": "Blumenstrasse" | 1,2 | 1,2 |
|
||||
| W13002 | even | - | 1,2 | 1,2 |
|
||||
| osm_id | type | address!dict | nodes!ints | geometry!wkt |
|
||||
| 13001 | odd | "street": "Blumenstrasse" | 1,2 | 1,2 |
|
||||
| 13002 | even | - | 1,2 | 1,2 |
|
||||
|
||||
Scenario: Address interpolation with housenumber
|
||||
When loading osm data
|
||||
@@ -33,12 +33,10 @@ Feature: Import of interpolations
|
||||
n4
|
||||
w34 Taddr:interpolation=all,addr:housenumber=2-4,building=yes Nn1,n2,n3,n4,n1
|
||||
w35 Taddr:interpolation=all,addr:housenumber=5,building=yes Nn1,n2,n3,n4,n1
|
||||
w36 Taddr:interpolation=all,addr:housenumber=2a-c,building=yes Nn1,n2,n3,n4,n1
|
||||
w36 Taddr:interpolation=all,addr:housenumber=2a-c Nn1,n2,n3,n4,n1
|
||||
"""
|
||||
Then place contains exactly
|
||||
| object | class | type | address!dict |
|
||||
| w35 | building | yes | "housenumber" : "5", "interpolation": "all" |
|
||||
| w36 | building | yes | "housenumber" : "2a-c", "interpolation": "all" |
|
||||
Then place_interpolation contains exactly
|
||||
| object | type | address!dict | nodes!ints | geometry!wkt |
|
||||
| W34 | all | "housenumber": "2-4" | - | (1,2,3,4,1) |
|
||||
| object | class | type | address!dict |
|
||||
| W35 | building | yes | "housenumber": "5", "interpolation": "all" |
|
||||
| W34 | building | yes | "housenumber": "2-4", "interpolation": "all" |
|
||||
| W36 | place | house | "housenumber": "2a-c", "interpolation": "all" |
|
||||
|
||||
@@ -30,8 +30,8 @@ Feature: Updates of address interpolation objects
|
||||
| N2 | place | house |
|
||||
| W33 | highway | residential |
|
||||
And place_interpolation contains exactly
|
||||
| object | type |
|
||||
| W99 | odd |
|
||||
| osm_id | type |
|
||||
| 99 | odd |
|
||||
When indexing
|
||||
Then placex contains exactly
|
||||
| object | class | type |
|
||||
@@ -55,8 +55,8 @@ Feature: Updates of address interpolation objects
|
||||
| N1 | place | house |
|
||||
| N2 | place | house |
|
||||
And place_interpolation contains exactly
|
||||
| object | type |
|
||||
| W99 | odd |
|
||||
| osm_id | type |
|
||||
| 99 | odd |
|
||||
|
||||
When updating osm data
|
||||
"""
|
||||
@@ -67,7 +67,7 @@ Feature: Updates of address interpolation objects
|
||||
| N1 | place | house |
|
||||
| N2 | place | house |
|
||||
And place_interpolation contains exactly
|
||||
| object |
|
||||
| osm_id |
|
||||
When indexing
|
||||
Then placex contains exactly
|
||||
| object | class | type |
|
||||
@@ -92,7 +92,7 @@ Feature: Updates of address interpolation objects
|
||||
| W33 | highway | residential |
|
||||
| W99 | highway | residential |
|
||||
And place_interpolation contains exactly
|
||||
| object |
|
||||
| osm_id |
|
||||
|
||||
When updating osm data
|
||||
"""
|
||||
@@ -104,8 +104,8 @@ Feature: Updates of address interpolation objects
|
||||
| N2 | place | house |
|
||||
| W33 | highway | residential |
|
||||
And place_interpolation contains exactly
|
||||
| object | type |
|
||||
| W99 | odd |
|
||||
| osm_id | type |
|
||||
| 99 | odd |
|
||||
When indexing
|
||||
Then placex contains exactly
|
||||
| object | class | type |
|
||||
@@ -129,8 +129,8 @@ Feature: Updates of address interpolation objects
|
||||
| N1 | place | house |
|
||||
| N2 | place | house |
|
||||
And place_interpolation contains exactly
|
||||
| object | type |
|
||||
| W99 | odd |
|
||||
| osm_id | type |
|
||||
| 99 | odd |
|
||||
|
||||
When updating osm data
|
||||
"""
|
||||
@@ -142,7 +142,7 @@ Feature: Updates of address interpolation objects
|
||||
| N2 | place | house |
|
||||
| W99 | highway | residential |
|
||||
And place_interpolation contains exactly
|
||||
| object |
|
||||
| osm_id |
|
||||
When indexing
|
||||
Then placex contains exactly
|
||||
| object | class | type |
|
||||
|
||||
@@ -113,8 +113,8 @@ Feature: Update of postcode only objects
|
||||
| N1 | place | house |
|
||||
| N2 | place | house |
|
||||
And place_interpolation contains exactly
|
||||
| object | type |
|
||||
| W34 | odd |
|
||||
| osm_id | type |
|
||||
| 34 | odd |
|
||||
|
||||
When updating osm data
|
||||
"""
|
||||
@@ -128,7 +128,7 @@ Feature: Update of postcode only objects
|
||||
| object | postcode |
|
||||
| W34 | 4456 |
|
||||
And place_interpolation contains exactly
|
||||
| object |
|
||||
| osm_id |
|
||||
When indexing
|
||||
Then location_property_osmline contains exactly
|
||||
| osm_id |
|
||||
@@ -163,8 +163,8 @@ Feature: Update of postcode only objects
|
||||
| N2 | place | house |
|
||||
| W33 | highway | residential |
|
||||
And place_interpolation contains exactly
|
||||
| object | type |
|
||||
| W34 | odd |
|
||||
| osm_id | type |
|
||||
| 34 | odd |
|
||||
And place_postcode contains exactly
|
||||
| object |
|
||||
When indexing
|
||||
|
||||
@@ -135,15 +135,12 @@ def import_place_interpolations(row_factory, datatable, node_grid):
|
||||
"""
|
||||
for row in datatable[1:]:
|
||||
data = PlaceColumn(node_grid).add_row(datatable[0], row, False)
|
||||
assert data.columns['osm_type'] == 'W'
|
||||
|
||||
if 'nodes' in data.columns:
|
||||
nodes = [int(x) for x in data.columns['nodes'].split(',')]
|
||||
else:
|
||||
nodes = None
|
||||
|
||||
params = {'osm_type': data.columns['osm_type'], 'osm_id': data.columns['osm_id'],
|
||||
params = {'osm_id': data.columns['osm_id'],
|
||||
'type': data.columns['type'],
|
||||
'address': data.columns.get('address'), 'nodes': nodes,
|
||||
'address': data.columns.get('address'),
|
||||
'nodes': [int(x) for x in data.columns['nodes'].split(',')],
|
||||
'geometry': pysql.SQL(data.get_wkt())}
|
||||
|
||||
row_factory('place_interpolation', **params)
|
||||
@@ -275,15 +272,12 @@ def update_place_interpolations(db_conn, row_factory, update_config, datatable,
|
||||
"""
|
||||
for row in datatable[1:]:
|
||||
data = PlaceColumn(node_grid).add_row(datatable[0], row, False)
|
||||
assert data.columns['osm_type'] == 'W'
|
||||
|
||||
if 'nodes' in data.columns:
|
||||
nodes = [int(x) for x in data.columns['nodes'].split(',')]
|
||||
else:
|
||||
nodes = None
|
||||
|
||||
params = {'osm_type': data.columns['osm_type'], 'osm_id': data.columns['osm_id'],
|
||||
params = {'osm_id': data.columns['osm_id'],
|
||||
'type': data.columns['type'],
|
||||
'address': data.columns.get('address'), 'nodes': nodes,
|
||||
'address': data.columns.get('address'),
|
||||
'nodes': [int(x) for x in data.columns['nodes'].split(',')],
|
||||
'geometry': pysql.SQL(data.get_wkt())}
|
||||
|
||||
row_factory('place_interpolation', **params)
|
||||
@@ -310,8 +304,8 @@ def do_delete_place(db_conn, update_config, node_grid, otype, oid):
|
||||
cur.execute('TRUNCATE place_to_be_deleted')
|
||||
cur.execute('DELETE FROM place WHERE osm_type = %s and osm_id = %s',
|
||||
(otype, oid))
|
||||
cur.execute('DELETE FROM place_interpolation WHERE osm_type = %s and osm_id = %s',
|
||||
(otype, oid))
|
||||
cur.execute('DELETE FROM place_interpolation WHERE osm_id = %s',
|
||||
(oid, ))
|
||||
cur.execute('SELECT flush_deleted_places()')
|
||||
if otype == 'N':
|
||||
cur.execute('DELETE FROM place_entrance WHERE osm_id = %s',
|
||||
|
||||
@@ -251,8 +251,7 @@ def place_interpolation_table(temp_db_with_extensions, table_factory):
|
||||
""" Create an empty version of the place_interpolation table.
|
||||
"""
|
||||
table_factory('place_interpolation',
|
||||
"""osm_type char(1) NOT NULL,
|
||||
osm_id bigint NOT NULL,
|
||||
"""osm_id bigint NOT NULL,
|
||||
type TEXT,
|
||||
address HSTORE,
|
||||
nodes BIGINT[],
|
||||
@@ -266,9 +265,9 @@ def place_interpolation_row(place_interpolation_table, temp_db_cursor):
|
||||
"""
|
||||
idseq = itertools.count(30001)
|
||||
|
||||
def _insert(osm_type='N', osm_id=None, typ='odd', address=None,
|
||||
def _insert(osm_id=None, typ='odd', address=None,
|
||||
nodes=None, geom='LINESTRING(0.1 0.21, 0.1 0.2)'):
|
||||
params = {'osm_type': osm_type, 'osm_id': osm_id or next(idseq),
|
||||
params = {'osm_id': osm_id or next(idseq),
|
||||
'type': typ, 'address': address, 'nodes': nodes,
|
||||
'geometry': _with_srid(geom)}
|
||||
temp_db_cursor.insert_row('place_interpolation', **params)
|
||||
@@ -319,11 +318,10 @@ def osmline_table(temp_db_with_extensions, load_sql):
|
||||
def osmline_row(osmline_table, temp_db_cursor):
|
||||
idseq = itertools.count(20001)
|
||||
|
||||
def _add(osm_type='W', osm_id=None, geom='LINESTRING(12.0 11.0, 12.003 11.0)'):
|
||||
def _add(osm_id=None, geom='LINESTRING(12.0 11.0, 12.003 11.0)'):
|
||||
return temp_db_cursor.insert_row(
|
||||
'location_property_osmline',
|
||||
place_id=pysql.SQL("nextval('seq_place')"),
|
||||
osm_type=osm_type,
|
||||
osm_id=osm_id or next(idseq),
|
||||
geometry_sector=pysql.Literal(20),
|
||||
partition=pysql.Literal(0),
|
||||
|
||||
@@ -169,8 +169,7 @@ async def test_load_data(dsn, place_row, place_interpolation_row, placex_table,
|
||||
temp_db_cursor, threads):
|
||||
for oid in range(100, 130):
|
||||
place_row(osm_id=oid)
|
||||
place_interpolation_row(osm_type='W', osm_id=342, typ='odd',
|
||||
geom='LINESTRING(0 0, 10 10)')
|
||||
place_interpolation_row(osm_id=342, typ='odd', geom='LINESTRING(0 0, 10 10)')
|
||||
|
||||
temp_db_cursor.execute("""
|
||||
CREATE OR REPLACE FUNCTION placex_insert() RETURNS TRIGGER AS $$
|
||||
|
||||
Reference in New Issue
Block a user