mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 05:14:07 +00:00
adapt BDD tests to separate interpolation table
This commit is contained in:
@@ -69,16 +69,13 @@ BEGIN
|
|||||||
-- finally update/insert place_interpolation itself
|
-- finally update/insert place_interpolation itself
|
||||||
|
|
||||||
IF existing.osm_type is not NULL THEN
|
IF existing.osm_type is not NULL THEN
|
||||||
IF existing.type != NEW.type
|
-- Always updates as the nodes with the housenumber might be the reason
|
||||||
OR coalesce(existing.address, ''::hstore) != coalesce(NEW.address, ''::hstore)
|
-- for the change.
|
||||||
OR existing.geometry::text != NEW.geometry::text
|
UPDATE place_interpolation p
|
||||||
THEN
|
SET type = NEW.type,
|
||||||
UPDATE place_interpolation p
|
address = NEW.address,
|
||||||
SET type = NEW.type,
|
geometry = NEW.geometry
|
||||||
address = NEW.address,
|
WHERE p.osm_type = NEW.osm_type AND p.osm_id = NEW.osm_id;
|
||||||
geometry = NEW.geometry
|
|
||||||
WHERE p.osm_type = NEW.osm_type AND p.osm_id = NEW.osm_id;
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
RETURN NULL;
|
RETURN NULL;
|
||||||
END IF;
|
END IF;
|
||||||
@@ -114,17 +111,21 @@ BEGIN
|
|||||||
RETURN in_address;
|
RETURN in_address;
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
SELECT nodes INTO waynodes FROM planet_osm_ways WHERE id = wayid;
|
SELECT nodes INTO waynodes FROM place_interpolation
|
||||||
FOR location IN
|
WHERE osm_type = 'W' AND osm_id = wayid;
|
||||||
SELECT placex.address, placex.osm_id FROM placex
|
|
||||||
WHERE osm_type = 'N' and osm_id = ANY(waynodes)
|
IF array_upper(waynodes, 1) IS NOT NULL THEN
|
||||||
and placex.address is not null
|
FOR location IN
|
||||||
and (placex.address ? 'street' or placex.address ? 'place')
|
SELECT placex.address, placex.osm_id FROM placex
|
||||||
and indexed_status < 100
|
WHERE osm_type = 'N' and osm_id = ANY(waynodes)
|
||||||
LOOP
|
and placex.address is not null
|
||||||
-- mark it as a derived address
|
and (placex.address ? 'street' or placex.address ? 'place')
|
||||||
RETURN location.address || coalesce(in_address, '{}'::hstore) || hstore('_inherited', '');
|
and indexed_status < 100
|
||||||
END LOOP;
|
LOOP
|
||||||
|
-- mark it as a derived address
|
||||||
|
RETURN location.address || coalesce(in_address, ''::hstore) || hstore('_inherited', '');
|
||||||
|
END LOOP;
|
||||||
|
END IF;
|
||||||
|
|
||||||
RETURN in_address;
|
RETURN in_address;
|
||||||
END;
|
END;
|
||||||
@@ -285,7 +286,7 @@ BEGIN
|
|||||||
ELSE
|
ELSE
|
||||||
-- classic interpolation way
|
-- classic interpolation way
|
||||||
SELECT nodes INTO waynodes
|
SELECT nodes INTO waynodes
|
||||||
FROM planet_osm_ways WHERE id = NEW.osm_id;
|
FROM place_interpolation WHERE osm_type = NEW.osm_type AND osm_id = NEW.osm_id;
|
||||||
|
|
||||||
IF array_upper(waynodes, 1) IS NULL THEN
|
IF array_upper(waynodes, 1) IS NULL THEN
|
||||||
RETURN NEW;
|
RETURN NEW;
|
||||||
|
|||||||
@@ -241,8 +241,8 @@ Feature: Address computation
|
|||||||
Scenario: buildings with only addr:postcodes do not appear in the address of a way
|
Scenario: buildings with only addr:postcodes do not appear in the address of a way
|
||||||
Given the grid with origin DE
|
Given the grid with origin DE
|
||||||
| 1 | | | | | 8 | | 6 | | 2 |
|
| 1 | | | | | 8 | | 6 | | 2 |
|
||||||
| |10 |11 | | | | | | | |
|
| | | | | | | | | | |
|
||||||
| |13 |12 | | | | | | | |
|
| |13 | | | | | | | | |
|
||||||
| 20| | | 21| | | | | | |
|
| 20| | | 21| | | | | | |
|
||||||
| | | | | | | | | | |
|
| | | | | | | | | | |
|
||||||
| | | | | | 9 | | | | |
|
| | | | | | 9 | | | | |
|
||||||
@@ -255,9 +255,9 @@ Feature: Address computation
|
|||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W93 | highway | residential | 20,21 |
|
| W93 | highway | residential | 20,21 |
|
||||||
And the places
|
And the postcodes
|
||||||
| osm | class | type | addr+postcode | geometry |
|
| osm | postcode | centroid |
|
||||||
| W22 | place | postcode | 11234 | (10,11,12,13,10) |
|
| W22 | 11234 | 13 |
|
||||||
When importing
|
When importing
|
||||||
Then place_addressline contains exactly
|
Then place_addressline contains exactly
|
||||||
| object | address |
|
| object | address |
|
||||||
|
|||||||
@@ -8,12 +8,9 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2 |
|
| W1 | even | 1,2 | 1,2 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to no interpolation
|
Then W1 expands to no interpolation
|
||||||
|
|
||||||
@@ -25,15 +22,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2 |
|
| W1 | even | 1,2 | 1,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -47,15 +41,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 8 |
|
| N2 | place | house | 8 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 2,1 |
|
| W1 | even | 2,1 | 2,1 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 2,1 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -69,15 +60,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 1 |
|
| N1 | place | house | 1 |
|
||||||
| N2 | place | house | 11 |
|
| N2 | place | house | 11 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | odd | 1,2 |
|
| W1 | odd | 1,2 | 1,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -91,15 +79,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 1 |
|
| N1 | place | house | 1 |
|
||||||
| N2 | place | house | 4 |
|
| N2 | place | house | 4 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | all | 1,2 |
|
| W1 | all | 1,2 | 1,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -113,15 +98,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 12 |
|
| N2 | place | house | 12 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,3,2 |
|
| W1 | even | 1,3,2 | 1,3,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -135,15 +117,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 10 |
|
| N2 | place | house | 10 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,3,2 |
|
| W1 | even | 1,3,2 | 1,3,3,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3,3,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -158,15 +137,12 @@ Feature: Import of address interpolations
|
|||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 14 |
|
| N2 | place | house | 14 |
|
||||||
| N3 | place | house | 10 |
|
| N3 | place | house | 10 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,3,2 |
|
| W1 | even | 1,3,2 | 1,3,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -184,15 +160,12 @@ Feature: Import of address interpolations
|
|||||||
| N2 | place | house | 14 |
|
| N2 | place | house | 14 |
|
||||||
| N3 | place | house | 10 |
|
| N3 | place | house | 10 |
|
||||||
| N4 | place | house | 18 |
|
| N4 | place | house | 18 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,3,2,4 |
|
| W1 | even | 1,3,2,4 | 1,3,2,4 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 1,3,2,4 |
|
| W10 | highway | residential | 1,3,2,4 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3,2,4 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -209,15 +182,12 @@ Feature: Import of address interpolations
|
|||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 14 |
|
| N2 | place | house | 14 |
|
||||||
| N3 | place | house | 10 |
|
| N3 | place | house | 10 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 2,3,1 |
|
| W1 | even | 2,3,1 | 2,3,1 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 2,3,1 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -233,15 +203,12 @@ Feature: Import of address interpolations
|
|||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 8 |
|
| N2 | place | house | 8 |
|
||||||
| N3 | place | house | 7 |
|
| N3 | place | house | 7 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,3,2 |
|
| W1 | even | 1,3,2 | 1,3,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -257,15 +224,12 @@ Feature: Import of address interpolations
|
|||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
| N3 | place | house | 10 |
|
| N3 | place | house | 10 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2,3,2 |
|
| W1 | even | 1,2,3,2 | 1,2,3,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 1,2,3 |
|
| W10 | highway | residential | 1,2,3 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2,3,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -281,15 +245,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2,3,2 |
|
| W1 | even | 1,2,3,2 | 1,2,3,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 1,2,3 |
|
| W10 | highway | residential | 1,2,3 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2,3,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -306,18 +267,14 @@ Feature: Import of address interpolations
|
|||||||
| N2 | place | house | 6 | 2 |
|
| N2 | place | house | 6 | 2 |
|
||||||
| N3 | place | house | 12 | 1 |
|
| N3 | place | house | 12 | 1 |
|
||||||
| N4 | place | house | 16 | 2 |
|
| N4 | place | house | 16 | 2 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | street | geometry |
|
| osm | type | street | nodes | geometry | nodes |
|
||||||
| W10 | place | houses | even | | 1,2 |
|
| W10 | even | | 1,2 | 1,2 | 1,2 |
|
||||||
| W11 | place | houses | even | Cloud Street | 1,2 |
|
| W11 | even | Cloud Street | 3,4 | 1,2 | 3,4 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | tertiary | Sun Way | 10,11 |
|
| W2 | highway | tertiary | Sun Way | 10,11 |
|
||||||
| W3 | highway | tertiary | Cloud Street | 20,21 |
|
| W3 | highway | tertiary | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
| 11 | 3,4 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -351,18 +308,14 @@ Feature: Import of address interpolations
|
|||||||
| N2 | place | house | 6 | | 2 |
|
| N2 | place | house | 6 | | 2 |
|
||||||
| N3 | place | house | 12 | Cloud Street | 1 |
|
| N3 | place | house | 12 | Cloud Street | 1 |
|
||||||
| N4 | place | house | 16 | Cloud Street | 2 |
|
| N4 | place | house | 16 | Cloud Street | 2 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W10 | place | houses | even | 1,2 |
|
| W10 | even | 1,2 | 1,2 |
|
||||||
| W11 | place | houses | even | 1,2 |
|
| W11 | even | 1,2 | 3,4 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | tertiary | Sun Way | 10,11 |
|
| W2 | highway | tertiary | Sun Way | 10,11 |
|
||||||
| W3 | highway | tertiary | Cloud Street | 20,21 |
|
| W3 | highway | tertiary | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
| 11 | 3,4 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -391,15 +344,12 @@ Feature: Import of address interpolations
|
|||||||
| N1 | place | house | 10 | 144.9632341 -37.76163 |
|
| N1 | place | house | 10 | 144.9632341 -37.76163 |
|
||||||
| N2 | place | house | 6 | 144.9630541 -37.7628174 |
|
| N2 | place | house | 6 | 144.9630541 -37.7628174 |
|
||||||
| N3 | shop | supermarket | 2 | 144.9629794 -37.7630755 |
|
| N3 | shop | supermarket | 2 | 144.9629794 -37.7630755 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755 |
|
| W1 | even | 144.9632341 -37.76163,144.9630541 -37.7628172,144.9629794 -37.7630755 | 1,2,3 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 144.9632341 -37.76163,144.9629794 -37.7630755 |
|
| W10 | highway | residential | 144.9632341 -37.76163,144.9629794 -37.7630755 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2,3 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -415,24 +365,21 @@ Feature: Import of address interpolations
|
|||||||
| N1 | place | house | 23 |
|
| N1 | place | house | 23 |
|
||||||
| N2 | amenity | school | |
|
| N2 | amenity | school | |
|
||||||
| N3 | place | house | 29 |
|
| N3 | place | house | 29 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | odd | 1,2,3 |
|
| W1 | odd | 1,2,3 | 1,2,3 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2,3 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
| 25 | 27 | 0.0000166 0,0.00002 0,0.0000333 0 |
|
| 25 | 27 | 0.0000166 0,0.00002 0,0.0000333 0 |
|
||||||
|
|
||||||
Scenario: Ways without node entries are ignored
|
Scenario: Ways without node entries are ignored
|
||||||
Given the places
|
Given the interpolations
|
||||||
| osm | class | type | housenr | geometry |
|
| osm | type | geometry |
|
||||||
| W1 | place | houses | even | 1 1, 1 1.001 |
|
| W1 | even | 1 1, 1 1.001 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 1 1, 1 1.001 |
|
| W10 | highway | residential | 1 1, 1 1.001 |
|
||||||
@@ -447,9 +394,9 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type |
|
| osm | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
Given the places
|
Given the interpolations
|
||||||
| osm | class | type | housenr | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2 |
|
| W1 | even | 1,2 | 1,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
@@ -464,15 +411,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 0 |
|
| N1 | place | house | 0 |
|
||||||
| N2 | place | house | 10 |
|
| N2 | place | house | 10 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2 |
|
| W1 | even | 1,2 | 1,2 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W10 | highway | residential | London Road |4,5 |
|
| W10 | highway | residential | London Road |4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -497,12 +441,9 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W1 | highway | residential | Vert St | 1,2 |
|
| W1 | highway | residential | Vert St | 1,2 |
|
||||||
| W2 | highway | residential | Horiz St | 2,3 |
|
| W2 | highway | residential | Horiz St | 2,3 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | addr+inclusion | geometry |
|
| osm | type | addr+inclusion | geometry | nodes |
|
||||||
| W10 | place | houses | even | actual | 8,9 |
|
| W10 | even | actual | 8,9 | 8,9 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 8,9 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -521,15 +462,12 @@ Feature: Import of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | <value> | 1,2 |
|
| W1 | <value> | 1,2 | 1,2 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to no interpolation
|
Then W1 expands to no interpolation
|
||||||
|
|
||||||
@@ -549,15 +487,12 @@ Feature: Import of address interpolations
|
|||||||
| N2 | place | house | 18 | 3 |
|
| N2 | place | house | 18 | 3 |
|
||||||
| N3 | place | house | 24 | 9 |
|
| N3 | place | house | 24 | 9 |
|
||||||
| N4 | place | house | 42 | 4 |
|
| N4 | place | house | 42 | 4 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,2,3,4 |
|
| W1 | even | 1,2,3,4 | 1,2,3,4 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 1,4 |
|
| W10 | highway | residential | 1,4 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2,3,4 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end |
|
| start | end |
|
||||||
@@ -576,15 +511,12 @@ Feature: Import of address interpolations
|
|||||||
| N2 | place | house | 6 | 8 |
|
| N2 | place | house | 6 | 8 |
|
||||||
| N3 | place | house | 10 | 8 |
|
| N3 | place | house | 10 | 8 |
|
||||||
| N4 | place | house | 14 | 9 |
|
| N4 | place | house | 14 | 9 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 7,8,8,9 |
|
| W1 | even | 7,8,8,9 | 1,2,3,4 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 4,5 |
|
| W10 | highway | residential | 4,5 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2,3,4 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
@@ -601,15 +533,12 @@ Feature: Import of address interpolations
|
|||||||
| N2 | place | house | 8 |
|
| N2 | place | house | 8 |
|
||||||
| N3 | place | house | 12 |
|
| N3 | place | house | 12 |
|
||||||
| N4 | place | house | 14 |
|
| N4 | place | house | 14 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 8,9 |
|
| W1 | even | 8,9 | 1,8,9,2,3,4 |
|
||||||
And the named places
|
And the named places
|
||||||
| osm | class | type | geometry |
|
| osm | class | type | geometry |
|
||||||
| W10 | highway | residential | 1,4 |
|
| W10 | highway | residential | 1,4 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,8,9,2,3,4 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| start | end | geometry |
|
| start | end | geometry |
|
||||||
|
|||||||
@@ -297,25 +297,21 @@ Feature: Linking of places
|
|||||||
| R1 | LabelPlace |
|
| R1 | LabelPlace |
|
||||||
|
|
||||||
|
|
||||||
|
@skip
|
||||||
Scenario: Linked places expand default language names
|
Scenario: Linked places expand default language names
|
||||||
Given the grid with origin CO
|
Given the grid
|
||||||
| 1 | | 2 | | 5 | | 6 |
|
| 1 | | 2 |
|
||||||
| | 9 | | | | 10 | |
|
| | 9 | |
|
||||||
| 4 | | 3 | | 8 | | 7 |
|
| 4 | | 3 |
|
||||||
And the places
|
Given the places
|
||||||
| osm | class | type | name+name | geometry |
|
| osm | class | type | name+name | geometry |
|
||||||
| N9 | place | city | Popayán | 9 |
|
| N9 | place | city | Popayán | 9 |
|
||||||
And the places
|
Given the places
|
||||||
| osm | class | type | name+name:en | geometry |
|
|
||||||
| N10 | place | city | Open | 10 |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | name+name | geometry | admin |
|
| osm | class | type | name+name | geometry | admin |
|
||||||
| R1 | boundary | administrative | Perímetro Urbano Popayán | (1,2,3,4,1) | 8 |
|
| R1 | boundary | administrative | Perímetro Urbano Popayán | (1,2,3,4,1) | 8 |
|
||||||
| R2 | boundary | administrative | Abre | (5,6,7,8,5) | 8 |
|
|
||||||
And the relations
|
And the relations
|
||||||
| id | members |
|
| id | members |
|
||||||
| 1 | N9:label |
|
| 1 | N9:label |
|
||||||
| 2 | N10:label |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | linked_place_id |
|
| object | linked_place_id |
|
||||||
|
|||||||
@@ -378,4 +378,3 @@ Feature: Searching of house numbers
|
|||||||
Then the result set contains
|
Then the result set contains
|
||||||
| object |
|
| object |
|
||||||
| W10 |
|
| W10 |
|
||||||
|
|
||||||
|
|||||||
@@ -11,16 +11,13 @@ Feature: Query of address interpolations
|
|||||||
Given the places
|
Given the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W10 | highway | primary | Nickway | 10,12,13 |
|
| W10 | highway | primary | Nickway | 10,12,13 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | odd | 1,3 |
|
| W1 | odd | 1,3 | 1,3 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | housenr | geometry |
|
| osm | class | type | housenr | geometry |
|
||||||
| N1 | place | house | 1 | 1 |
|
| N1 | place | house | 1 | 1 |
|
||||||
| N3 | place | house | 5 | 3 |
|
| N3 | place | house | 5 | 3 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3 |
|
|
||||||
When importing
|
When importing
|
||||||
When reverse geocoding at node 2
|
When reverse geocoding at node 2
|
||||||
Then the result contains
|
Then the result contains
|
||||||
@@ -36,16 +33,13 @@ Feature: Query of address interpolations
|
|||||||
Given the places
|
Given the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W10 | highway | primary | Nickway | 10,12,13 |
|
| W10 | highway | primary | Nickway | 10,12,13 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W1 | place | houses | even | 1,3 |
|
| W1 | even | 1,3 | 1,3 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | housenr | geometry |
|
| osm | class | type | housenr | geometry |
|
||||||
| N1 | place | house | 2 | 1 |
|
| N1 | place | house | 2 | 1 |
|
||||||
| N3 | place | house | 18 | 3 |
|
| N3 | place | house | 18 | 3 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,3 |
|
|
||||||
When importing
|
When importing
|
||||||
When reverse geocoding at node 2
|
When reverse geocoding at node 2
|
||||||
Then the result contains
|
Then the result contains
|
||||||
@@ -55,3 +49,32 @@ Feature: Query of address interpolations
|
|||||||
Then all results contain
|
Then all results contain
|
||||||
| object | display_name | centroid!wkt |
|
| object | display_name | centroid!wkt |
|
||||||
| W1 | 10, Nickway | 2 |
|
| W1 | 10, Nickway | 2 |
|
||||||
|
|
||||||
|
|
||||||
|
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 interpolations
|
||||||
|
| osm | type | geometry | nodes |
|
||||||
|
| W10 | even | 10, 11 | 10, 11 |
|
||||||
|
| W20 | odd | 20, 21 | 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 |
|
||||||
|
When importing
|
||||||
|
When geocoding "Ringstr 12"
|
||||||
|
Then the result set contains
|
||||||
|
| object |
|
||||||
|
| W10 |
|
||||||
|
When geocoding "Ringstr 13"
|
||||||
|
Then the result set contains
|
||||||
|
| object |
|
||||||
|
| W20 |
|
||||||
|
|||||||
@@ -11,18 +11,15 @@ Feature: Update of address interpolations
|
|||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Sun Way | 10,11 |
|
| W2 | highway | unclassified | Sun Way | 10,11 |
|
||||||
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W10 expands to no interpolation
|
Then W10 expands to no interpolation
|
||||||
When updating places
|
When updating places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And updating places
|
And updating interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W10 | place | houses | even | 1,2 |
|
| W10 | even | 1,2 | 1,2 |
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
| N1 | W2 |
|
| N1 | W2 |
|
||||||
@@ -41,16 +38,13 @@ Feature: Update of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W10 | place | houses | even | 1,2 |
|
| W10 | even | 1,2 | 1,2 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Sun Way | 10,11 |
|
| W2 | highway | unclassified | Sun Way | 10,11 |
|
||||||
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -59,9 +53,9 @@ Feature: Update of address interpolations
|
|||||||
And W10 expands to interpolation
|
And W10 expands to interpolation
|
||||||
| parent_place_id | start | end |
|
| parent_place_id | start | end |
|
||||||
| W2 | 4 | 4 |
|
| W2 | 4 | 4 |
|
||||||
When updating places
|
When updating interpolations
|
||||||
| osm | class | type | addr+interpolation | street | geometry |
|
| osm | type | street | nodes | geometry |
|
||||||
| W10 | place | houses | even | Cloud Street | 1,2 |
|
| W10 | even | Cloud Street | 1,2 | 1,2 |
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
| N1 | W3 |
|
| N1 | W3 |
|
||||||
@@ -80,16 +74,13 @@ Feature: Update of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W10 | place | houses | even | 1,2 |
|
| W10 | even | 1,2 | 1,2 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Sun Way | 10,11 |
|
| W2 | highway | unclassified | Sun Way | 10,11 |
|
||||||
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -120,16 +111,13 @@ Feature: Update of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
| osm | type | geometry | nodes |
|
||||||
| W10 | place | houses | even | 1,2 |
|
| W10 | even | 1,2 | 1,2 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Sun Way | 10,11 |
|
| W2 | highway | unclassified | Sun Way | 10,11 |
|
||||||
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -155,15 +143,12 @@ Feature: Update of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | street | geometry |
|
| osm | type | street | geometry | nodes |
|
||||||
| W10 | place | houses | even | Cloud Street| 1,2 |
|
| W10 | even | Cloud Street| 1,2 | 1,2 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Sun Way | 10,11 |
|
| W2 | highway | unclassified | Sun Way | 10,11 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -193,16 +178,13 @@ Feature: Update of address interpolations
|
|||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
And the places
|
And the interpolations
|
||||||
| osm | class | type | addr+interpolation | street | geometry |
|
| osm | type | street | geometry | nodes |
|
||||||
| W10 | place | houses | even | Cloud Street| 1,2 |
|
| W10 | even | Cloud Street| 1,2 | 1,2 |
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Sun Way | 10,11 |
|
| W2 | highway | unclassified | Sun Way | 10,11 |
|
||||||
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
| W3 | highway | unclassified | Cloud Street | 20,21 |
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 10 | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then placex contains
|
Then placex contains
|
||||||
| object | parent_place_id |
|
| object | parent_place_id |
|
||||||
@@ -220,67 +202,6 @@ Feature: Update of address interpolations
|
|||||||
| parent_place_id | start | end |
|
| parent_place_id | start | end |
|
||||||
| W2 | 4 | 4 |
|
| W2 | 4 | 4 |
|
||||||
|
|
||||||
Scenario: building becomes interpolation
|
|
||||||
Given the grid
|
|
||||||
| 10 | | | | 11 |
|
|
||||||
| | 1 | | 2 | |
|
|
||||||
| | 4 | | 3 | |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | housenr | geometry |
|
|
||||||
| W1 | place | house | 3 | (1,2,3,4,1) |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | name | geometry |
|
|
||||||
| W2 | highway | unclassified | Cloud Street | 10,11 |
|
|
||||||
When importing
|
|
||||||
Then placex contains
|
|
||||||
| object | parent_place_id |
|
|
||||||
| W1 | W2 |
|
|
||||||
Given the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
When updating places
|
|
||||||
| osm | class | type | housenr |
|
|
||||||
| N1 | place | house | 2 |
|
|
||||||
| N2 | place | house | 6 |
|
|
||||||
And updating places
|
|
||||||
| osm | class | type | addr+interpolation | street | geometry |
|
|
||||||
| W1 | place | houses | even | Cloud Street| 1,2 |
|
|
||||||
Then placex has no entry for W1
|
|
||||||
And W1 expands to interpolation
|
|
||||||
| parent_place_id | start | end |
|
|
||||||
| W2 | 4 | 4 |
|
|
||||||
|
|
||||||
Scenario: interpolation becomes building
|
|
||||||
Given the grid
|
|
||||||
| 10 | | | | 11 |
|
|
||||||
| | 1 | | 2 | |
|
|
||||||
| | 4 | | 3 | |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | housenr |
|
|
||||||
| N1 | place | house | 2 |
|
|
||||||
| N2 | place | house | 6 |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | name | geometry |
|
|
||||||
| W2 | highway | unclassified | Cloud Street | 10,11 |
|
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 1 | 1,2 |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | addr+interpolation | street | geometry |
|
|
||||||
| W1 | place | houses | even | Cloud Street| 1,2 |
|
|
||||||
When importing
|
|
||||||
Then placex has no entry for W1
|
|
||||||
And W1 expands to interpolation
|
|
||||||
| parent_place_id | start | end |
|
|
||||||
| W2 | 4 | 4 |
|
|
||||||
When updating places
|
|
||||||
| osm | class | type | housenr | geometry |
|
|
||||||
| W1 | place | house | 3 | (1,2,3,4,1) |
|
|
||||||
Then placex contains
|
|
||||||
| object | parent_place_id |
|
|
||||||
| W1 | W2 |
|
|
||||||
And W1 expands to no interpolation
|
|
||||||
|
|
||||||
Scenario: housenumbers added to interpolation
|
Scenario: housenumbers added to interpolation
|
||||||
Given the grid
|
Given the grid
|
||||||
| 10 | | | | 11 |
|
| 10 | | | | 11 |
|
||||||
@@ -288,18 +209,18 @@ Feature: Update of address interpolations
|
|||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W2 | highway | unclassified | Cloud Street | 10,11 |
|
| W2 | highway | unclassified | Cloud Street | 10,11 |
|
||||||
And the ways
|
And the interpolations
|
||||||
| id | nodes |
|
| osm | type | geometry | nodes |
|
||||||
| 1 | 1,2 |
|
| W1 | even | 1,2 | 1,2 |
|
||||||
And the places
|
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
|
||||||
| W1 | place | houses | even | 1,2 |
|
|
||||||
When importing
|
When importing
|
||||||
Then W1 expands to no interpolation
|
Then W1 expands to no interpolation
|
||||||
When updating places
|
When updating places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N1 | place | house | 2 |
|
| N1 | place | house | 2 |
|
||||||
| N2 | place | house | 6 |
|
| N2 | place | house | 6 |
|
||||||
|
And updating interpolations
|
||||||
|
| osm | type | geometry | nodes |
|
||||||
|
| W1 | even | 1,2 | 1,2 |
|
||||||
Then W1 expands to interpolation
|
Then W1 expands to interpolation
|
||||||
| parent_place_id | start | end |
|
| parent_place_id | start | end |
|
||||||
| W2 | 4 | 4 |
|
| W2 | 4 | 4 |
|
||||||
@@ -311,12 +232,9 @@ Feature: Update of address interpolations
|
|||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
||||||
And the ways
|
And the interpolations
|
||||||
| id | nodes |
|
| osm | type | geometry | nodes |
|
||||||
| 2 | 3,4,5 |
|
| W2 | even | 3,4,5 | 3,4,5 |
|
||||||
And the places
|
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
|
||||||
| W2 | place | houses | even | 3,4,5 |
|
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N3 | place | house | 2 |
|
| N3 | place | house | 2 |
|
||||||
@@ -328,12 +246,14 @@ Feature: Update of address interpolations
|
|||||||
When updating places
|
When updating places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N4 | place | house | 6 |
|
| N4 | place | house | 6 |
|
||||||
|
And updating interpolations
|
||||||
|
| osm | type | geometry | nodes |
|
||||||
|
| W2 | even | 3,4,5 | 3,4,5 |
|
||||||
Then W2 expands to interpolation
|
Then W2 expands to interpolation
|
||||||
| parent_place_id | start | end |
|
| parent_place_id | start | end |
|
||||||
| W1 | 4 | 4 |
|
| W1 | 4 | 4 |
|
||||||
| W1 | 8 | 8 |
|
| W1 | 8 | 8 |
|
||||||
|
|
||||||
@skip
|
|
||||||
Scenario: housenumber removed in middle of interpolation
|
Scenario: housenumber removed in middle of interpolation
|
||||||
Given the grid
|
Given the grid
|
||||||
| 1 | | | | | 2 |
|
| 1 | | | | | 2 |
|
||||||
@@ -341,12 +261,9 @@ Feature: Update of address interpolations
|
|||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
||||||
And the ways
|
And the interpolations
|
||||||
| id | nodes |
|
| osm | type | geometry | nodes |
|
||||||
| 2 | 3,4,5 |
|
| W2 | even | 3,4,5 | 3,4,5 |
|
||||||
And the places
|
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
|
||||||
| W2 | place | houses | even | 3,4,5 |
|
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N3 | place | house | 2 |
|
| N3 | place | house | 2 |
|
||||||
@@ -358,6 +275,9 @@ Feature: Update of address interpolations
|
|||||||
| W1 | 4 | 4 |
|
| W1 | 4 | 4 |
|
||||||
| W1 | 8 | 8 |
|
| W1 | 8 | 8 |
|
||||||
When marking for delete N4
|
When marking for delete N4
|
||||||
|
And updating interpolations
|
||||||
|
| osm | type | geometry | nodes |
|
||||||
|
| W2 | even | 3,4,5 | 3,4,5 |
|
||||||
Then W2 expands to interpolation
|
Then W2 expands to interpolation
|
||||||
| parent_place_id | start | end |
|
| parent_place_id | start | end |
|
||||||
| W1 | 4 | 8 |
|
| W1 | 4 | 8 |
|
||||||
@@ -369,12 +289,9 @@ Feature: Update of address interpolations
|
|||||||
And the places
|
And the places
|
||||||
| osm | class | type | name | geometry |
|
| osm | class | type | name | geometry |
|
||||||
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
||||||
And the ways
|
And the interpolations
|
||||||
| id | nodes |
|
| osm | type | geometry | nodes |
|
||||||
| 2 | 3,4 |
|
| W2 | even | 3,4 | 3,4 |
|
||||||
And the places
|
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
|
||||||
| W2 | place | houses | even | 3,4 |
|
|
||||||
And the places
|
And the places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N3 | place | house | 2 |
|
| N3 | place | house | 2 |
|
||||||
@@ -386,33 +303,9 @@ Feature: Update of address interpolations
|
|||||||
When updating places
|
When updating places
|
||||||
| osm | class | type | housenr |
|
| osm | class | type | housenr |
|
||||||
| N4 | place | house | 8 |
|
| N4 | place | house | 8 |
|
||||||
|
And updating interpolations
|
||||||
|
| osm | type | geometry | nodes |
|
||||||
|
| W2 | even | 3,4 | 3,4 |
|
||||||
Then W2 expands to interpolation
|
Then W2 expands to interpolation
|
||||||
| parent_place_id | start | end |
|
| parent_place_id | start | end |
|
||||||
| W1 | 4 | 6 |
|
| W1 | 4 | 6 |
|
||||||
|
|
||||||
Scenario: Legal interpolation type changed to illegal one
|
|
||||||
Given the grid
|
|
||||||
| 1 | | 2 |
|
|
||||||
| 3 | | 4 |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | name | geometry |
|
|
||||||
| W1 | highway | unclassified | Cloud Street | 1, 2 |
|
|
||||||
And the ways
|
|
||||||
| id | nodes |
|
|
||||||
| 2 | 3,4 |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
|
||||||
| W2 | place | houses | even | 3,4 |
|
|
||||||
And the places
|
|
||||||
| osm | class | type | housenr |
|
|
||||||
| N3 | place | house | 2 |
|
|
||||||
| N4 | place | house | 6 |
|
|
||||||
When importing
|
|
||||||
Then W2 expands to interpolation
|
|
||||||
| parent_place_id | start | end |
|
|
||||||
| W1 | 4 | 4 |
|
|
||||||
When updating places
|
|
||||||
| osm | class | type | addr+interpolation | geometry |
|
|
||||||
| W2 | place | houses | 12-2 | 3,4 |
|
|
||||||
Then W2 expands to no interpolation
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,19 +68,6 @@ Feature: Update of simple objects
|
|||||||
| object | class | type | centroid!wkt |
|
| object | class | type | centroid!wkt |
|
||||||
| N3 | shop | grocery | 1 -1 |
|
| N3 | shop | grocery | 1 -1 |
|
||||||
|
|
||||||
Scenario: remove postcode place when house number is added
|
|
||||||
Given the places
|
|
||||||
| osm | class | type | postcode | geometry |
|
|
||||||
| N3 | place | postcode | 12345 | country:de |
|
|
||||||
When importing
|
|
||||||
Then placex has no entry for N3
|
|
||||||
When updating places
|
|
||||||
| osm | class | type | postcode | housenr | geometry |
|
|
||||||
| N3 | place | house | 12345 | 13 | country:de |
|
|
||||||
Then placex contains
|
|
||||||
| object | class | type |
|
|
||||||
| N3 | place | house |
|
|
||||||
|
|
||||||
Scenario: remove boundary when changing from polygon to way
|
Scenario: remove boundary when changing from polygon to way
|
||||||
Given the grid
|
Given the grid
|
||||||
| 1 | 2 |
|
| 1 | 2 |
|
||||||
|
|||||||
@@ -206,15 +206,21 @@ Feature: Tag evaluation
|
|||||||
|
|
||||||
|
|
||||||
Scenario: Address interpolations
|
Scenario: Address interpolations
|
||||||
|
Given the grid
|
||||||
|
| 1 | 2 |
|
||||||
When loading osm data
|
When loading osm data
|
||||||
"""
|
"""
|
||||||
n13001 Taddr:interpolation=odd
|
n1
|
||||||
n13002 Taddr:interpolation=even,place=city
|
n2
|
||||||
|
w13001 Taddr:interpolation=odd Nn1,n2
|
||||||
|
w13002 Taddr:interpolation=even,place=city Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains exactly
|
Then place contains exactly
|
||||||
| object | class | type | address!dict |
|
| object |
|
||||||
| N13001 | place | houses | 'interpolation': 'odd' |
|
And place_interpolation contains exactly
|
||||||
| N13002 | place | houses | 'interpolation': 'even' |
|
| object | type | address!dict |
|
||||||
|
| W13001 | odd | - |
|
||||||
|
| W13002 | even | - |
|
||||||
|
|
||||||
|
|
||||||
Scenario: Footways
|
Scenario: Footways
|
||||||
|
|||||||
@@ -14,20 +14,24 @@ Feature: Updates of address interpolation objects
|
|||||||
n2 Taddr:housenumber=17
|
n2 Taddr:housenumber=17
|
||||||
w33 Thighway=residential,name=Tao Nn1,n2
|
w33 Thighway=residential,name=Tao Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains
|
Then place contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
|
| W33 | highway | residential |
|
||||||
|
|
||||||
When updating osm data
|
When updating osm data
|
||||||
"""
|
"""
|
||||||
w99 Taddr:interpolation=odd Nn1,n2
|
w99 Taddr:interpolation=odd Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains
|
Then place contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W99 | place | houses |
|
| W33 | highway | residential |
|
||||||
|
And place_interpolation contains exactly
|
||||||
|
| object | type |
|
||||||
|
| W99 | odd |
|
||||||
When indexing
|
When indexing
|
||||||
Then placex contains exactly
|
Then placex contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
@@ -46,11 +50,13 @@ Feature: Updates of address interpolation objects
|
|||||||
n2 Taddr:housenumber=7
|
n2 Taddr:housenumber=7
|
||||||
w99 Taddr:interpolation=odd Nn1,n2
|
w99 Taddr:interpolation=odd Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains
|
Then place contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W99 | place | houses |
|
And place_interpolation contains exactly
|
||||||
|
| object | type |
|
||||||
|
| W99 | odd |
|
||||||
|
|
||||||
When updating osm data
|
When updating osm data
|
||||||
"""
|
"""
|
||||||
@@ -60,6 +66,8 @@ Feature: Updates of address interpolation objects
|
|||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
|
And place_interpolation contains exactly
|
||||||
|
| object |
|
||||||
When indexing
|
When indexing
|
||||||
Then placex contains exactly
|
Then placex contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
@@ -77,21 +85,27 @@ Feature: Updates of address interpolation objects
|
|||||||
w33 Thighway=residential Nn1,n2
|
w33 Thighway=residential Nn1,n2
|
||||||
w99 Thighway=residential Nn1,n2
|
w99 Thighway=residential Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains
|
Then place contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
|
| W33 | highway | residential |
|
||||||
| W99 | highway | residential |
|
| W99 | highway | residential |
|
||||||
|
And place_interpolation contains exactly
|
||||||
|
| object |
|
||||||
|
|
||||||
When updating osm data
|
When updating osm data
|
||||||
"""
|
"""
|
||||||
w99 Taddr:interpolation=odd Nn1,n2
|
w99 Taddr:interpolation=odd Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains
|
Then place contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W99 | place | houses |
|
| W33 | highway | residential |
|
||||||
|
And place_interpolation contains exactly
|
||||||
|
| object | type |
|
||||||
|
| W99 | odd |
|
||||||
When indexing
|
When indexing
|
||||||
Then placex contains exactly
|
Then placex contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
@@ -110,11 +124,13 @@ Feature: Updates of address interpolation objects
|
|||||||
n2 Taddr:housenumber=17
|
n2 Taddr:housenumber=17
|
||||||
w99 Taddr:interpolation=odd Nn1,n2
|
w99 Taddr:interpolation=odd Nn1,n2
|
||||||
"""
|
"""
|
||||||
Then place contains
|
Then place contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W99 | place | houses |
|
And place_interpolation contains exactly
|
||||||
|
| object | type |
|
||||||
|
| W99 | odd |
|
||||||
|
|
||||||
When updating osm data
|
When updating osm data
|
||||||
"""
|
"""
|
||||||
@@ -125,6 +141,8 @@ Feature: Updates of address interpolation objects
|
|||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W99 | highway | residential |
|
| W99 | highway | residential |
|
||||||
|
And place_interpolation contains exactly
|
||||||
|
| object |
|
||||||
When indexing
|
When indexing
|
||||||
Then placex contains exactly
|
Then placex contains exactly
|
||||||
| object | class | type |
|
| object | class | type |
|
||||||
|
|||||||
@@ -112,7 +112,9 @@ Feature: Update of postcode only objects
|
|||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W34 | place | houses |
|
And place_interpolation contains exactly
|
||||||
|
| object | type |
|
||||||
|
| W34 | odd |
|
||||||
|
|
||||||
When updating osm data
|
When updating osm data
|
||||||
"""
|
"""
|
||||||
@@ -122,9 +124,11 @@ Feature: Update of postcode only objects
|
|||||||
| object | class | type |
|
| object | class | type |
|
||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
Then place_postcode contains exactly
|
And place_postcode contains exactly
|
||||||
| object | postcode |
|
| object | postcode |
|
||||||
| W34 | 4456 |
|
| W34 | 4456 |
|
||||||
|
And place_interpolation contains exactly
|
||||||
|
| object |
|
||||||
When indexing
|
When indexing
|
||||||
Then location_property_osmline contains exactly
|
Then location_property_osmline contains exactly
|
||||||
| osm_id |
|
| osm_id |
|
||||||
@@ -158,7 +162,9 @@ Feature: Update of postcode only objects
|
|||||||
| N1 | place | house |
|
| N1 | place | house |
|
||||||
| N2 | place | house |
|
| N2 | place | house |
|
||||||
| W33 | highway | residential |
|
| W33 | highway | residential |
|
||||||
| W34 | place | houses |
|
And place_interpolation contains exactly
|
||||||
|
| object | type |
|
||||||
|
| W34 | odd |
|
||||||
And place_postcode contains exactly
|
And place_postcode contains exactly
|
||||||
| object |
|
| object |
|
||||||
When indexing
|
When indexing
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# This file is part of Nominatim. (https://nominatim.org)
|
# This file is part of Nominatim. (https://nominatim.org)
|
||||||
#
|
#
|
||||||
# Copyright (C) 2025 by the Nominatim developer community.
|
# Copyright (C) 2026 by the Nominatim developer community.
|
||||||
# For a full list of authors see the git log.
|
# For a full list of authors see the git log.
|
||||||
"""
|
"""
|
||||||
Collector for BDD import acceptance tests.
|
Collector for BDD import acceptance tests.
|
||||||
@@ -129,6 +129,26 @@ def import_place_entrances(row_factory, datatable, node_grid):
|
|||||||
row_factory('place_entrance', **params)
|
row_factory('place_entrance', **params)
|
||||||
|
|
||||||
|
|
||||||
|
@given(step_parse('the interpolations'), target_fixture=None)
|
||||||
|
def import_place_interpolations(row_factory, datatable, node_grid):
|
||||||
|
""" Insert todo rows into the place_entrance table.
|
||||||
|
"""
|
||||||
|
for row in datatable[1:]:
|
||||||
|
data = PlaceColumn(node_grid).add_row(datatable[0], row, False)
|
||||||
|
|
||||||
|
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'],
|
||||||
|
'type': data.columns['type'],
|
||||||
|
'address': data.columns.get('address'), 'nodes': nodes,
|
||||||
|
'geometry': pysql.SQL(data.get_wkt())}
|
||||||
|
|
||||||
|
row_factory('place_interpolation', **params)
|
||||||
|
|
||||||
|
|
||||||
@given(step_parse('the postcodes'), target_fixture=None)
|
@given(step_parse('the postcodes'), target_fixture=None)
|
||||||
def import_place_postcode(db_conn, datatable, node_grid):
|
def import_place_postcode(db_conn, datatable, node_grid):
|
||||||
""" Insert todo rows into the place_postcode table. If a row for the
|
""" Insert todo rows into the place_postcode table. If a row for the
|
||||||
@@ -249,6 +269,31 @@ def update_place_entrances(db_conn, datatable, node_grid):
|
|||||||
db_conn.commit()
|
db_conn.commit()
|
||||||
|
|
||||||
|
|
||||||
|
@when('updating interpolations', target_fixture=None)
|
||||||
|
def update_place_interpolations(db_conn, row_factory, update_config, datatable, node_grid):
|
||||||
|
""" Update rows in the place_entrance table.
|
||||||
|
"""
|
||||||
|
for row in datatable[1:]:
|
||||||
|
data = PlaceColumn(node_grid).add_row(datatable[0], row, False)
|
||||||
|
|
||||||
|
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'],
|
||||||
|
'type': data.columns['type'],
|
||||||
|
'address': data.columns.get('address'), 'nodes': nodes,
|
||||||
|
'geometry': pysql.SQL(data.get_wkt())}
|
||||||
|
|
||||||
|
row_factory('place_interpolation', **params)
|
||||||
|
|
||||||
|
db_conn.execute('SELECT flush_deleted_places()')
|
||||||
|
db_conn.commit()
|
||||||
|
|
||||||
|
cli.nominatim(['index', '-q', '--minrank', '30'], update_config.environ)
|
||||||
|
|
||||||
|
|
||||||
@when('refreshing postcodes')
|
@when('refreshing postcodes')
|
||||||
def do_postcode_update(update_config):
|
def do_postcode_update(update_config):
|
||||||
""" Recompute the postcode centroids.
|
""" Recompute the postcode centroids.
|
||||||
@@ -265,6 +310,8 @@ def do_delete_place(db_conn, update_config, node_grid, otype, oid):
|
|||||||
cur.execute('TRUNCATE place_to_be_deleted')
|
cur.execute('TRUNCATE place_to_be_deleted')
|
||||||
cur.execute('DELETE FROM place WHERE osm_type = %s and osm_id = %s',
|
cur.execute('DELETE FROM place WHERE osm_type = %s and osm_id = %s',
|
||||||
(otype, oid))
|
(otype, oid))
|
||||||
|
cur.execute('DELETE FROM place_interpolation WHERE osm_type = %s and osm_id = %s',
|
||||||
|
(otype, oid))
|
||||||
cur.execute('SELECT flush_deleted_places()')
|
cur.execute('SELECT flush_deleted_places()')
|
||||||
if otype == 'N':
|
if otype == 'N':
|
||||||
cur.execute('DELETE FROM place_entrance WHERE osm_id = %s',
|
cur.execute('DELETE FROM place_entrance WHERE osm_id = %s',
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ class PlaceColumn:
|
|||||||
elif key in ('name', 'address', 'extratags'):
|
elif key in ('name', 'address', 'extratags'):
|
||||||
self.columns[key] = ast.literal_eval('{' + value + '}')
|
self.columns[key] = ast.literal_eval('{' + value + '}')
|
||||||
else:
|
else:
|
||||||
assert key in ('class', 'type'), "Unknown column '{}'.".format(key)
|
|
||||||
self.columns[key] = None if value == '' else value
|
self.columns[key] = None if value == '' else value
|
||||||
|
|
||||||
def _set_key_name(self, value):
|
def _set_key_name(self, value):
|
||||||
|
|||||||
Reference in New Issue
Block a user