Sarah Hoffmann [Mon, 9 Nov 2020 11:03:37 +0000 (12:03 +0100)]
lookup places for address tags for rank < 30
While previously the content of addr:* tags was only added
to the list of address search keywords, we now really look up
the matching place. This has the advantage that we pull in all
potential translations from the place, just like all the other
address terms that are looked up by neighbourhood search.
If no place can be found for a given name, the content of the
addr:* tag is still added to the search keywords as before.
Sarah Hoffmann [Tue, 27 Oct 2020 20:29:35 +0000 (21:29 +0100)]
remove now unused settings related to website
There are two places where the website URL is still used:
for icons, replace the URL with a link to the icon repository
of the UI repo. The more URL now builds the link from the
server info.
Sarah Hoffmann [Fri, 23 Oct 2020 08:43:57 +0000 (10:43 +0200)]
minor fixes for geometry compuation during boundary ranking
Go back to using centroid when determining if one admin level
is within another. There are cases where boundaries are slightly
misaligned due to mapping errors (not using the same ways in the
relations).
Only declare boundaries the same when they have the same wikidata
tag _and_ have exactly the same geometry. This works around tagging
errors with the wikidata tag, which happen because of automated
edits to the wikidata tag.
Sarah Hoffmann [Tue, 20 Oct 2020 21:26:44 +0000 (23:26 +0200)]
detect and remove admin boundary duplicates
The Polish community maps admin boundaries that span multiple
levels by duplicating the boundary relations. Detect this situation
by looking out for matching wikidata tags. The higher ranked
duplicates are then thrown out from the address pool by setting
their address rank to 0.
Sarah Hoffmann [Thu, 22 Oct 2020 08:20:16 +0000 (10:20 +0200)]
adjust secondary order when no addressimportance available
In cases of countries and remote places without an address
it is possible that 'addressimportance' comes back empty.
Adjust the 'foundorder' to the places importance instead
in such cases.
Sarah Hoffmann [Tue, 20 Oct 2020 18:20:49 +0000 (20:20 +0200)]
reorganize ranks of high-level place types
Rank 25 is now available for places that should appear in addresses
but not when a street is present. Use this for som block-like
place types. Also document the particularity of rank 25.
subdevisions and allotments are now at the same level as landuse
which they are frequently used together with.
Sarah Hoffmann [Mon, 19 Oct 2020 08:39:01 +0000 (10:39 +0200)]
add explicit bbox contains check
Now that the containment check uses ST_Relate, we need to add
a separate bbox contains check to ensure that Postgis does the
efficient check first. Note that we still cannot get rid of the
overlap(&&) check because then Postgis will use the wrong indexes.
Sarah Hoffmann [Thu, 15 Oct 2020 15:30:52 +0000 (17:30 +0200)]
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.
Sarah Hoffmann [Wed, 14 Oct 2020 09:33:47 +0000 (11:33 +0200)]
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).
Sarah Hoffmann [Tue, 13 Oct 2020 20:10:07 +0000 (22:10 +0200)]
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.
Sarah Hoffmann [Wed, 7 Oct 2020 15:33:52 +0000 (17:33 +0200)]
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.
Sarah Hoffmann [Tue, 6 Oct 2020 12:00:43 +0000 (14:00 +0200)]
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.
Sarah Hoffmann [Mon, 5 Oct 2020 15:11:13 +0000 (17:11 +0200)]
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.
Sarah Hoffmann [Tue, 22 Sep 2020 13:51:04 +0000 (15:51 +0200)]
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.
Sarah Hoffmann [Wed, 23 Sep 2020 15:33:42 +0000 (17:33 +0200)]
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.