Commit Graph

2705 Commits

Author SHA1 Message Date
Sarah Hoffmann
b0ef84caae add tests for rank computation 2020-10-17 17:51:22 +02:00
Sarah Hoffmann
64899ef54b add tests for address computation 2020-10-16 11:07:17 +02:00
Sarah Hoffmann
1064a9264e revert to && comparison for geometries
Postgis 3 picks the wrong index when using ~ or @.
2020-10-16 09:49:48 +02:00
Sarah Hoffmann
acfa7bec9c use computed centroid for location_area_large
The new address computation assumes that the centroid is inside
the area. Therefore we cannot use the centroid function. Use the
pre-computed centroid instead which has already been corrected to
be inside the area.
2020-10-15 17:30:52 +02:00
Sarah Hoffmann
62b94e838b correctly set from area column in place_addressline
This was always set to true which brings us to the question
if it is even still needed.
2020-10-15 12:06:53 +02:00
Sarah Hoffmann
5236e7a03e fix use of geometry operators
@ is contained by while ~ is contains.
2020-10-15 12:06:18 +02:00
Sarah Hoffmann
7e9412a044 demote admin boundaries for place areas
Also demote the address rank of an admin boundary when there
is a place area of higher rank that completely contains the
area. This catches the case where city boundaries do not exactly
align with administrative units (see for example Moscow).
2020-10-14 11:33:47 +02:00
Sarah Hoffmann
e47c19beb9 exclude rank 25 when computing addresses of streets
Address rank 25 is used for squares which are address-wise on the
same level as streets.
2020-10-13 22:36:17 +02:00
Sarah Hoffmann
2fe3c654fc overhaul address computation
This is a complete rewrite of the selection of address parts to
be inserted into the place_addressline table.

The new algorithm selects for each rank:
* the boundary overlapping with the addressee and contained
  in the already selected boundaries of lower rank, or failing that
* the place node closest to the addressee that is contained in
  the already selected boundaries and in the influence radius
  of already selected place nodes of lower rank

Place nodes that are not contained in already selected boundaries
of lower rank are completely thrown away. All other candidates are
added as non-address parts.
2020-10-13 22:10:07 +02:00
Sarah Hoffmann
5ec48c66cb move ordering out of getNearFeatures
The two places where the function is called have different ordering
requirement.
2020-10-13 15:24:54 +02:00
Sarah Hoffmann
4e7ec92d6f
Merge pull request #2012 from lonvia/format-reverse-debug-output
use Debug class for formatting reverse debug output
2020-10-13 09:23:43 +02:00
Sarah Hoffmann
e115de47fc use Debug class for formatting reverse debug output 2020-10-12 17:12:03 +02:00
Sarah Hoffmann
bb5ffd3904
Merge pull request #2011 from lonvia/increase-city-radius
Increase radius of influence around city nodes
2020-10-12 16:17:39 +02:00
Sarah Hoffmann
887ae7fcab increase radius of influence around city nodes
The current radius does not cover cities with more than a
million inhabitants well.
2020-10-12 14:17:37 +02:00
Sarah Hoffmann
abaaf942cb
Merge pull request #2004 from lonvia/demote-place-nodes-in-admin-areas
demote place nodes in admin areas
2020-10-12 11:54:52 +02:00
Sarah Hoffmann
ff47f6f65d when linking always check against original address rank 2020-10-11 12:29:49 +02:00
Sarah Hoffmann
ca680fc9fc make housenumber interpolation tests more lenient 2020-10-11 12:04:53 +02:00
Sarah Hoffmann
b04463bb2d demote place nodes in admin areas
If a place node of city rank and above finds itself in an
administrative boundary of the same address rank, then
increase the address rank by 2. This catches the rather
frequent case where city suburbs are tagged for historical
reasons as towns or villages.
2020-10-11 12:04:53 +02:00
Sarah Hoffmann
c66f701232
Merge pull request #2008 from lonvia/docs-missing-index-migration
docs: migration to new wikipedia needs new index
2020-10-11 11:05:59 +02:00
Sarah Hoffmann
3b23144ae6 docs: migration to new wikipedia needs new index
Fixes #1998.
2020-10-11 10:40:23 +02:00
Sarah Hoffmann
f7a9462337
Merge pull request #2006 from mtmail/ubuntu-20-postgresql-contrib
Ubuntu 20: use postgresql-contrib-12 so no version higher gets installed
2020-10-11 09:45:37 +02:00
Sarah Hoffmann
17f24d0061
Merge pull request #2003 from lonvia/admin-levels-indonesia
Adapt address levels for admin boundaries in Indonesia
2020-10-11 09:43:33 +02:00
marc tobias
eb8bce22b8 Ubuntu 20: use postgresql-contrib-12 so no version higher gets installed 2020-10-10 02:42:46 +02:00
Sarah Hoffmann
6a31691121 adapt address levels for admin boundaries in Indonesia 2020-10-09 22:28:06 +02:00
Sarah Hoffmann
25c4bf6ed4
Merge pull request #2002 from lonvia/analyse-indexing-script
Add script for detailed explaing of indexing trigger
2020-10-09 20:23:51 +02:00
Sarah Hoffmann
ec5743bcc0 add script for detailed explaing of indexing trigger 2020-10-09 17:38:33 +02:00
Sarah Hoffmann
7cd330ee55
Merge pull request #1996 from lonvia/remove-postcode-search-structured
Restrict postcode searches to postcode in first token
2020-10-06 17:04:22 +02:00
Sarah Hoffmann
7d2b6879c8 restrict postcode searches to postcode in first token
In structured queries we should only assume that it is
a postcode search when only the postcode and optionally
the country is given. If any other term is present, it
is better to avoid the search for postcode as it yields
too many bad searches. Given that the terms in a structured
query are ordered, this means that the postcode must be
the first token just like in the unstructured query.

Fixes #1988.
2020-10-06 14:08:31 +02:00
Sarah Hoffmann
a40684162a Revert "adapt tests to rank_search removal"
This reverts commit 2a717da850.
2020-10-06 13:59:50 +02:00
Sarah Hoffmann
cd997ff058
Merge pull request #1995 from lonvia/update-osm2pgsql
update to latest osm2pgsql version
2020-10-05 18:14:29 +02:00
Sarah Hoffmann
5391bb6cf7 update to latest osm2pgsql version
The latest version of osm2pgsql no longer creates indexes on
the members of planet_osm_rels. So we do that ourselves.
Given that we only need to access associated street relations,
the index can become quite a bit smaller.
2020-10-05 17:11:13 +02:00
Sarah Hoffmann
6b8ce1ee74
Merge pull request #1986 from mtmail/document-drop-idx_placex_geometry_reverse_lookupPoint
migration guide: idx_placex_geometry_reverse_lookupPoint can be dropped
2020-10-05 16:18:46 +02:00
Sarah Hoffmann
a37d46ec25
Merge pull request #1993 from mtmail/country-name-eSwatini
country names: Swaziland => eSwatini
2020-10-05 16:17:54 +02:00
marc tobias
b5c8237118 country names: Swaziland => eSwatini 2020-10-04 13:38:15 +02:00
marc tobias
eeffe2caf4 migration guide: idx_placex_geometry_reverse_lookupPoint can be dropped 2020-09-30 14:28:20 +02:00
Sarah Hoffmann
c5c7a6a453
Merge pull request #1984 from lonvia/remove-reverse-index
Remove unused idx_placex_geometry_reverse_lookupPoint
2020-09-30 12:02:34 +02:00
Sarah Hoffmann
b969392f40 remove removed index from database check 2020-09-30 11:33:15 +02:00
Sarah Hoffmann
40bc1752c2 remove unused idx_placex_geometry_reverse_lookupPoint
The index has been unused ever since the query using it was
changed two years ago. Given that it has not been missed much,
drop it completely here.
2020-09-30 09:21:35 +02:00
Sarah Hoffmann
851c3779b5
Merge pull request #1982 from lonvia/more-rank-search-removal
More rank search removal
2020-09-26 11:08:20 +02:00
Sarah Hoffmann
2a717da850 adapt tests to rank_search removal 2020-09-26 09:10:37 +02:00
Sarah Hoffmann
f8694da3c9 Remove more rank_search usage from address computation
Fixes #1904.
2020-09-25 17:50:36 +02:00
Sarah Hoffmann
eeb2b1f998
Merge pull request #1980 from lonvia/add-descriptive-term-for-address-rank-24
add descriptive term for address rank 24
2020-09-25 16:56:35 +02:00
Sarah Hoffmann
1db8f7e353 add descriptive term for address rank 24
With that term we have terms for all ranks, so that no generic
'administrative' term will show up in the address details anymore.
2020-09-25 16:02:17 +02:00
Sarah Hoffmann
6625e93be6
Merge pull request #1975 from lonvia/simplify-parent-assignment-for-unlisted-places
Use closest containing place area for parent of unlisted addr:place
2020-09-23 19:10:42 +02:00
Sarah Hoffmann
56053988bf
Merge pull request #1970 from lonvia/remove-duplicate-geometry-check
Switch recursive updates to using rank_search
2020-09-23 18:51:35 +02:00
Sarah Hoffmann
d9325dc11a use rank_address when invalidating containing objects
Only rank_address is now relevant for determining if a place
could be part of an address.
2020-09-23 17:44:31 +02:00
Sarah Hoffmann
d3ca9dd3f7 remove ST_Covers check when also testing for ST_Intersects
Using both is slightly problematic because they have different
ways to use the index. Newer versions of Postgis exhibit a
query planner issue when both functions appear together.
As ST_Intersects includes ST_Covers, simply remove the latter.
2020-09-23 17:44:31 +02:00
Sarah Hoffmann
e552f6bce5 use closest containing place for unlisted addr:place
We can't use getNearFeatures() to determine the parent of a
place with an unlisted addr:place because this function
returns place nodes that are potentially outside the area
of interest. Doing the complete address computation is too
expensive, so simply use the area with the largest rank that
contains the feature instead.
2020-09-23 17:33:42 +02:00
Sarah Hoffmann
cf23e10382
Merge pull request #1974 from lonvia/show-unknown-addr-place
add unknown addr:place to address output
2020-09-23 15:26:12 +02:00
Sarah Hoffmann
c84e7e72f1 add unknown addr:place to address output
When a POI has no addr:street but an addr:place that is not
contained in the name list of the parent place, then remember
this situation and merge the content of addr:place into the
address output.

We don't need to care about translations in this case because
it is obvious that no object with translations exists if the
parent isn't the object named in addr:place.
2020-09-23 11:55:18 +02:00