]> git.openstreetmap.org Git - nominatim.git/log
nominatim.git
3 years agoprepare release 4.0.0 v4.0.0
Sarah Hoffmann [Mon, 1 Nov 2021 11:14:53 +0000 (12:14 +0100)]
prepare release 4.0.0

3 years agofix typo
Sarah Hoffmann [Tue, 2 Nov 2021 10:09:17 +0000 (11:09 +0100)]
fix typo

3 years agoMerge pull request #2502 from lonvia/improve-development-documentation
Sarah Hoffmann [Mon, 1 Nov 2021 15:12:23 +0000 (16:12 +0100)]
Merge pull request #2502 from lonvia/improve-development-documentation

Extend developer's documentation

3 years agodocs: add overview over indexing
Sarah Hoffmann [Mon, 1 Nov 2021 10:04:03 +0000 (11:04 +0100)]
docs: add overview over indexing

3 years agodocs: section about database layout
Sarah Hoffmann [Fri, 29 Oct 2021 10:03:22 +0000 (12:03 +0200)]
docs: section about database layout

Replaces the import description which basically was
table layout only now.

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Thu, 28 Oct 2021 13:30:20 +0000 (15:30 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #2498 from lonvia/ordering-for-unlisted-place-results
Sarah Hoffmann [Thu, 28 Oct 2021 13:28:47 +0000 (15:28 +0200)]
Merge pull request #2498 from lonvia/ordering-for-unlisted-place-results

Include unlisted places in ordering by housenumber

3 years agoMerge pull request #2497 from lonvia/docs-maintenance
Sarah Hoffmann [Thu, 28 Oct 2021 09:33:34 +0000 (11:33 +0200)]
Merge pull request #2497 from lonvia/docs-maintenance

docs: add new maintenance section

3 years agoinclude unlisted places in ordering by housenumber
Sarah Hoffmann [Thu, 28 Oct 2021 09:27:31 +0000 (11:27 +0200)]
include unlisted places in ordering by housenumber

When ordering results by the fact that they have a housenumber,
also take cases into account where the housenumber is on the
place itself. This may happen when the search includes the name
of the place and the housenumber or for addr:place addresses
where the place is unlisted.

3 years agodocs: add new maintenance section
Sarah Hoffmann [Wed, 27 Oct 2021 18:59:45 +0000 (20:59 +0200)]
docs: add new maintenance section

currently used for postcode updates, word count updates and
deleted relations.

3 years agoMerge pull request #2495 from lonvia/fix-normalization-in-php
Sarah Hoffmann [Wed, 27 Oct 2021 12:40:42 +0000 (14:40 +0200)]
Merge pull request #2495 from lonvia/fix-normalization-in-php

ICU: use correct normalization during search

3 years agoICU: use normalization from config in PHP
Sarah Hoffmann [Wed, 27 Oct 2021 08:07:19 +0000 (10:07 +0200)]
ICU: use normalization from config in PHP

The TERM_NORMALIZATION config option is no longer applicable.
That was already documented but not yet implemented.

3 years agobdd: add tests for non-latin scripts
Sarah Hoffmann [Tue, 26 Oct 2021 15:29:03 +0000 (17:29 +0200)]
bdd: add tests for non-latin scripts

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Tue, 26 Oct 2021 15:24:33 +0000 (17:24 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoRevert "ICU: additional ranking by matching of normalised term"
Sarah Hoffmann [Tue, 26 Oct 2021 15:02:16 +0000 (17:02 +0200)]
Revert "ICU: additional ranking by matching of normalised term"

This reverts commit b6a831443c8f46bfe1be59ecd1cb7a6847fdf948.

3 years agoMerge pull request #2493 from lonvia/handle-frequent-partials
Sarah Hoffmann [Tue, 26 Oct 2021 15:00:43 +0000 (17:00 +0200)]
Merge pull request #2493 from lonvia/handle-frequent-partials

Tune search queries with frequent partial words

3 years agoadapt BDD tests to stricter partial search
Sarah Hoffmann [Tue, 26 Oct 2021 10:07:13 +0000 (12:07 +0200)]
adapt BDD tests to stricter partial search

3 years agodo not count words when in reverse-only mode
Sarah Hoffmann [Tue, 26 Oct 2021 09:42:42 +0000 (11:42 +0200)]
do not count words when in reverse-only mode

3 years agofurther refactor setup to keep function small
Sarah Hoffmann [Tue, 26 Oct 2021 08:57:51 +0000 (10:57 +0200)]
further refactor setup to keep function small

3 years agosearches for house numbers must have an address
Sarah Hoffmann [Tue, 26 Oct 2021 08:28:28 +0000 (10:28 +0200)]
searches for house numbers must have an address

3 years agodisallow search for partials without address
Sarah Hoffmann [Tue, 26 Oct 2021 08:23:55 +0000 (10:23 +0200)]
disallow search for partials without address

Very frequent partial terms take too long to look up and
do not return any valuable results unless the search is
further narrowed down by an address.

3 years agomake word count computation part of the import
Sarah Hoffmann [Tue, 26 Oct 2021 07:37:57 +0000 (09:37 +0200)]
make word count computation part of the import

Accurate word counts are now essential when using
the ICU tokenizer and don't hurt for the legacy one.

Adds about an hour import time.

3 years agoactions: move ICU tests into its own run
Sarah Hoffmann [Tue, 26 Oct 2021 08:32:43 +0000 (10:32 +0200)]
actions: move ICU tests into its own run

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Mon, 25 Oct 2021 19:46:18 +0000 (21:46 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #2486 from lonvia/fix-special-phrases
Sarah Hoffmann [Mon, 25 Oct 2021 19:45:08 +0000 (21:45 +0200)]
Merge pull request #2486 from lonvia/fix-special-phrases

Fix parsing of operator in special phrases

3 years agoICU: add an index over word_ids
Sarah Hoffmann [Mon, 25 Oct 2021 19:33:27 +0000 (21:33 +0200)]
ICU: add an index over word_ids

Needed for keyword lookup in the details response.

3 years agoICU: additional ranking by matching of normalised term
Sarah Hoffmann [Mon, 25 Oct 2021 18:46:01 +0000 (20:46 +0200)]
ICU: additional ranking by matching of normalised term

Keep track of normalised word for tokens and then recheck
against normalized form in database to exclude non-matching
script.

3 years agobe case-insensitve about special phrase operator
Sarah Hoffmann [Mon, 25 Oct 2021 17:51:20 +0000 (19:51 +0200)]
be case-insensitve about special phrase operator

3 years agofix parsing of operator in special phrases
Sarah Hoffmann [Mon, 25 Oct 2021 17:46:30 +0000 (19:46 +0200)]
fix parsing of operator in special phrases

Because of unstripped input, the operators wouldn't match.

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Mon, 25 Oct 2021 15:21:10 +0000 (17:21 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #2484 from lonvia/fix-index-use
Sarah Hoffmann [Mon, 25 Oct 2021 15:20:42 +0000 (17:20 +0200)]
Merge pull request #2484 from lonvia/fix-index-use

Reverse: add index hints

3 years agoMerge pull request #2483 from lonvia/fix-warming
Sarah Hoffmann [Mon, 25 Oct 2021 14:21:36 +0000 (16:21 +0200)]
Merge pull request #2483 from lonvia/fix-warming

Fix warming for ICU tokenizer

3 years agoreverse: add index hints
Sarah Hoffmann [Mon, 25 Oct 2021 12:55:15 +0000 (14:55 +0200)]
reverse: add index hints

The fairly complex where condition of idx_placex_geometry_placenode
won't always be matched by the query planner if the condition
part doesn't appear verbatim in the query.

Fixes #2480.

3 years agofix warming for ICU tokenizer
Sarah Hoffmann [Mon, 25 Oct 2021 11:08:16 +0000 (13:08 +0200)]
fix warming for ICU tokenizer

Running the warm-up search requests requires querying
the most frequent words. This must be done via the tokenizer
to honor the different formats of the word table.

3 years agoallow relative paths for log files
Sarah Hoffmann [Mon, 25 Oct 2021 08:13:11 +0000 (10:13 +0200)]
allow relative paths for log files

3 years agoMerge pull request #2476 from lonvia/harmonize-configuration-file-settings
Sarah Hoffmann [Sun, 24 Oct 2021 08:57:48 +0000 (10:57 +0200)]
Merge pull request #2476 from lonvia/harmonize-configuration-file-settings

Standardize handling of file names in configuration values

3 years agoallow relative paths for flatnode file
Sarah Hoffmann [Fri, 22 Oct 2021 15:32:51 +0000 (17:32 +0200)]
allow relative paths for flatnode file

3 years agoswitch IMPORT_STYLE to use generic file search
Sarah Hoffmann [Fri, 22 Oct 2021 14:49:57 +0000 (16:49 +0200)]
switch IMPORT_STYLE to use generic file search

Allows relative paths wrt project directory.

3 years agohave ADDRESS_LEVEL_CONFIG use load_sub_configuration
Sarah Hoffmann [Fri, 22 Oct 2021 14:31:33 +0000 (16:31 +0200)]
have ADDRESS_LEVEL_CONFIG use load_sub_configuration

This means that relative paths now are looked up in the
project directory.

3 years agoreplace NOMINATIM_PHRASE_CONFIG with command line option
Sarah Hoffmann [Fri, 22 Oct 2021 12:41:14 +0000 (14:41 +0200)]
replace NOMINATIM_PHRASE_CONFIG with command line option

3 years agodoc: clarify relative paths for tokenizer config
Sarah Hoffmann [Thu, 21 Oct 2021 14:38:06 +0000 (16:38 +0200)]
doc: clarify relative paths for tokenizer config

3 years agoMerge pull request #2475 from lonvia/catchup-mode
Sarah Hoffmann [Thu, 21 Oct 2021 14:21:58 +0000 (16:21 +0200)]
Merge pull request #2475 from lonvia/catchup-mode

Add catch-up mode to replication and extend documentation for updating

3 years agoextend documentation for updating database
Sarah Hoffmann [Thu, 21 Oct 2021 10:14:47 +0000 (12:14 +0200)]
extend documentation for updating database

Explains the different modes and adds hints for
setting up a systemd job.

3 years agoadd new replication mode catch-up
Sarah Hoffmann [Wed, 20 Oct 2021 20:05:15 +0000 (22:05 +0200)]
add new replication mode catch-up

This mode gets updates until the server reports no new diffs
anymore.

Also adds additional indexing, when the main indexing step left
a couple of objects to process. This happens only when the
next update is expected to be more than 40min away.

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Tue, 19 Oct 2021 13:07:17 +0000 (15:07 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agorun Tiger import with parallel threads per default
Sarah Hoffmann [Tue, 19 Oct 2021 13:00:26 +0000 (15:00 +0200)]
run Tiger import with parallel threads per default

3 years agoMerge pull request #2472 from lonvia/word-count-computation
Sarah Hoffmann [Tue, 19 Oct 2021 12:58:57 +0000 (14:58 +0200)]
Merge pull request #2472 from lonvia/word-count-computation

Fix word count computation for ICU tokenizer

3 years agoadapt tests for new word count mechanism
Sarah Hoffmann [Tue, 19 Oct 2021 10:03:48 +0000 (12:03 +0200)]
adapt tests for new word count mechanism

3 years agoicu: no longer precompute terms
Sarah Hoffmann [Tue, 19 Oct 2021 09:50:06 +0000 (11:50 +0200)]
icu: no longer precompute terms

The ICU analyzer no longer drops frequent partials, so it is no
longer necessary to know the frequencies in advance.

3 years agomake word recount a tokenizer-specific function
Sarah Hoffmann [Tue, 19 Oct 2021 09:21:16 +0000 (11:21 +0200)]
make word recount a tokenizer-specific function

3 years agoMerge pull request #2471 from lonvia/update-install-rules
Sarah Hoffmann [Tue, 19 Oct 2021 07:11:16 +0000 (09:11 +0200)]
Merge pull request #2471 from lonvia/update-install-rules

Reorganise, update and extend documentation

3 years agodocs: fix more links
Sarah Hoffmann [Mon, 18 Oct 2021 15:26:14 +0000 (17:26 +0200)]
docs: fix more links

3 years agodocs: refer to our new Settings chapter in the import instruchtions
Sarah Hoffmann [Mon, 18 Oct 2021 15:02:52 +0000 (17:02 +0200)]
docs: refer to our new Settings chapter in the import instruchtions

3 years agocheck and fix all liks in documentation
Sarah Hoffmann [Mon, 18 Oct 2021 14:53:24 +0000 (16:53 +0200)]
check and fix all liks in documentation

3 years agoadd extended documentation of settings
Sarah Hoffmann [Thu, 14 Oct 2021 12:36:09 +0000 (14:36 +0200)]
add extended documentation of settings

3 years agodocs: update overview pages
Sarah Hoffmann [Thu, 14 Oct 2021 08:21:52 +0000 (10:21 +0200)]
docs: update overview pages

3 years agodocs: move place ranking into customization part
Sarah Hoffmann [Thu, 14 Oct 2021 08:10:54 +0000 (10:10 +0200)]
docs: move place ranking into customization part

3 years agodocs: nominatim-ui has a new place for custom config
Sarah Hoffmann [Thu, 14 Oct 2021 08:06:01 +0000 (10:06 +0200)]
docs: nominatim-ui has a new place for custom config

3 years agodocs: move import style description to customize section
Sarah Hoffmann [Tue, 12 Oct 2021 21:07:41 +0000 (23:07 +0200)]
docs: move import style description to customize section

3 years agodocs: make customization chapter a separate section
Sarah Hoffmann [Tue, 12 Oct 2021 19:25:13 +0000 (21:25 +0200)]
docs: make customization chapter a separate section

3 years agofix typo
Sarah Hoffmann [Tue, 12 Oct 2021 09:04:44 +0000 (11:04 +0200)]
fix typo

3 years agodocs: remove the development warning for ICU tokenizer
Sarah Hoffmann [Tue, 12 Oct 2021 08:31:18 +0000 (10:31 +0200)]
docs: remove the development warning for ICU tokenizer

3 years agodocs: add a warning about using --no-updates with TIGER data
Sarah Hoffmann [Tue, 12 Oct 2021 08:25:50 +0000 (10:25 +0200)]
docs: add a warning about using --no-updates with TIGER data

3 years agoupdate and extend man page
Sarah Hoffmann [Mon, 11 Oct 2021 21:27:38 +0000 (23:27 +0200)]
update and extend man page

Provide extended descriptions for most subcommands.

3 years agorename manual directory to man
Sarah Hoffmann [Mon, 11 Oct 2021 20:23:38 +0000 (22:23 +0200)]
rename manual directory to man

Avoids confusion between 'docs' and 'manual'.

3 years agoadd munin scipts and ICU subrules to installation
Sarah Hoffmann [Mon, 11 Oct 2021 20:10:54 +0000 (22:10 +0200)]
add munin scipts and ICU subrules to installation

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Fri, 15 Oct 2021 16:21:13 +0000 (18:21 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #2469 from lonvia/fix-tablespace-assignment
Sarah Hoffmann [Fri, 15 Oct 2021 16:20:43 +0000 (18:20 +0200)]
Merge pull request #2469 from lonvia/fix-tablespace-assignment

Fix template expressions for tablespaces

3 years agofix template expressions for tablespaces
Sarah Hoffmann [Fri, 15 Oct 2021 13:07:43 +0000 (15:07 +0200)]
fix template expressions for tablespaces

3 years agoMerge pull request #2450 from mtmail/tiger-data-2021
Sarah Hoffmann [Mon, 11 Oct 2021 17:22:15 +0000 (19:22 +0200)]
Merge pull request #2450 from mtmail/tiger-data-2021

US TIGER data 2021 released

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Mon, 11 Oct 2021 08:56:57 +0000 (10:56 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #2465 from lonvia/use-spgist-index
Sarah Hoffmann [Mon, 11 Oct 2021 08:48:44 +0000 (10:48 +0200)]
Merge pull request #2465 from lonvia/use-spgist-index

Use SP-GIST for building index

3 years agoremove outdated country_languages.php
Sarah Hoffmann [Sun, 10 Oct 2021 19:58:43 +0000 (21:58 +0200)]
remove outdated country_languages.php

3 years agoadd recommendation for Postgis 3+
Sarah Hoffmann [Sun, 10 Oct 2021 12:23:08 +0000 (14:23 +0200)]
add recommendation for Postgis 3+

3 years agouse SP-GIST index for building index where available
Sarah Hoffmann [Sun, 10 Oct 2021 12:17:03 +0000 (14:17 +0200)]
use SP-GIST index for building index where available

Point-in-polygon queries are much faster with a SP-GIST geometry
index, so use that for the index used to check if a housenumber
is inside a building.

Only available with Postgis 3. There is an automatic fallback to
GIST for Postgis 2.

3 years agoMerge pull request #2460 from lonvia/multiple-analyzers
Sarah Hoffmann [Sat, 9 Oct 2021 12:41:09 +0000 (14:41 +0200)]
Merge pull request #2460 from lonvia/multiple-analyzers

Add support for multiple token analyzers

3 years agoadd documentation for new configuration of ICU tokenizer
Sarah Hoffmann [Thu, 7 Oct 2021 09:55:53 +0000 (11:55 +0200)]
add documentation for new configuration of ICU tokenizer

3 years agofix argument description for check_database
Sarah Hoffmann [Thu, 7 Oct 2021 07:49:13 +0000 (09:49 +0200)]
fix argument description for check_database

3 years agoreorganize and complete tests around generic token analysis
Sarah Hoffmann [Wed, 6 Oct 2021 15:03:37 +0000 (17:03 +0200)]
reorganize and complete tests around generic token analysis

3 years agoadd tests for sanitizer tagging language
Sarah Hoffmann [Wed, 6 Oct 2021 10:29:25 +0000 (12:29 +0200)]
add tests for sanitizer tagging language

3 years agoapply variants by languages
Sarah Hoffmann [Tue, 5 Oct 2021 15:18:10 +0000 (17:18 +0200)]
apply variants by languages

Adds a tagger for names by language so that the analyzer of that
language is used. Thus variants are now only applied to names
in the specific language and only tag name tags, no longer to
reference-like tags.

3 years agouse analyser provided in the 'analyzer' property
Sarah Hoffmann [Tue, 5 Oct 2021 12:10:32 +0000 (14:10 +0200)]
use analyser provided in the 'analyzer' property

Implements per-name choice of analyzer. If a non-default
analyzer is choosen, then the 'word' identifier is extended
with the name of the ana;yzer, so that we still have unique
items.

3 years agoremove support for properties on variants
Sarah Hoffmann [Tue, 5 Oct 2021 08:29:36 +0000 (10:29 +0200)]
remove support for properties on variants

Those are not going to be used in the near future, so no need to
carry that code around just now.

3 years agoprecompute replacements while loading configuration
Sarah Hoffmann [Tue, 5 Oct 2021 08:20:08 +0000 (10:20 +0200)]
precompute replacements while loading configuration

3 years agomove parsing of token analysis config to analyzer
Sarah Hoffmann [Mon, 4 Oct 2021 16:31:58 +0000 (18:31 +0200)]
move parsing of token analysis config to analyzer

Adds a second callback for the analyzer which is responsible
for parsing the configuration rules and converting it to
whatever format necessary. This way, each analyzer implementation
can define its own configuration rules.

3 years agomake token analyzers configurable modules
Sarah Hoffmann [Mon, 4 Oct 2021 15:34:30 +0000 (17:34 +0200)]
make token analyzers configurable modules

Adds a mandatory section 'analyzer' to the token-analysis entries
which define, which analyser to use. Currently there is exactly
one, generic, which implements the former ICUNameProcessor.

3 years agoextend ICU config to accomodate multiple analysers
Sarah Hoffmann [Mon, 4 Oct 2021 14:40:28 +0000 (16:40 +0200)]
extend ICU config to accomodate multiple analysers

Adds parsing of multiple variant lists from the configuration.
Every entry except one must have a unique 'id' paramter to
distinguish the entries. The entry without id is considered
the default. Currently only the list without an id is used
for analysis.

3 years agomove flatten_config_list into config module
Sarah Hoffmann [Mon, 4 Oct 2021 09:56:54 +0000 (11:56 +0200)]
move flatten_config_list into config module

For general usage by other modules.

3 years agoMerge pull request #2458 from lonvia/add-tokenizer-preprocessing
Sarah Hoffmann [Fri, 1 Oct 2021 19:53:34 +0000 (21:53 +0200)]
Merge pull request #2458 from lonvia/add-tokenizer-preprocessing

Add a "sanitation" step for name and address tags before token processing

3 years agoreplace test variable for PG env tests
Sarah Hoffmann [Fri, 1 Oct 2021 08:51:41 +0000 (10:51 +0200)]
replace test variable for PG env tests

'tty' was removed in PG14 and causes an error.

3 years agoadd unit tests for new sanatizer functions
Sarah Hoffmann [Fri, 1 Oct 2021 07:50:17 +0000 (09:50 +0200)]
add unit tests for new sanatizer functions

3 years agointroduce sanitizer step before token analysis
Sarah Hoffmann [Thu, 30 Sep 2021 19:30:13 +0000 (21:30 +0200)]
introduce sanitizer step before token analysis

Sanatizer functions allow to transform name and address tags before
they are handed to the tokenizer. Theses transformations are visible
only for the tokenizer and thus only have an influence on the
search terms and address match terms for a place.

Currently two sanitizers are implemented which are responsible for
splitting names with multiple values and removing bracket additions.
Both was previously hard-coded in the tokenizer.

3 years agounify ICUNameProcessorRules and ICURuleLoader
Sarah Hoffmann [Wed, 29 Sep 2021 15:37:04 +0000 (17:37 +0200)]
unify ICUNameProcessorRules and ICURuleLoader

There is no need for the additional layer of indirection that
the ICUNameProcessorRules class adds. The ICURuleLoader can
fill the database properties directly.

3 years agofix typo
Sarah Hoffmann [Wed, 29 Sep 2021 12:16:09 +0000 (14:16 +0200)]
fix typo

3 years agoexport more data for the tokenizer name preparation
Sarah Hoffmann [Wed, 29 Sep 2021 09:54:14 +0000 (11:54 +0200)]
export more data for the tokenizer name preparation

Adds class, type, country and rank to the exported information
and removes the rather odd hack for countries. Whether a place
represents a country boundary can now be computed by the tokenizer.

3 years agoadd wrapper class for place data passed to tokenizer
Sarah Hoffmann [Wed, 29 Sep 2021 08:37:54 +0000 (10:37 +0200)]
add wrapper class for place data passed to tokenizer

This is mostly for convenience and documentation purposes.

3 years agoMerge remote-tracking branch 'upstream/master'
Sarah Hoffmann [Tue, 28 Sep 2021 09:27:00 +0000 (11:27 +0200)]
Merge remote-tracking branch 'upstream/master'

3 years agoMerge pull request #2455 from lonvia/adjust-address-levels-slovakia
Sarah Hoffmann [Tue, 28 Sep 2021 09:21:08 +0000 (11:21 +0200)]
Merge pull request #2455 from lonvia/adjust-address-levels-slovakia

Adjust address levels for boundaries in Slovakia

3 years agoMerge pull request #2454 from lonvia/sort-out-token-assignment-in-sql
Sarah Hoffmann [Tue, 28 Sep 2021 07:45:15 +0000 (09:45 +0200)]
Merge pull request #2454 from lonvia/sort-out-token-assignment-in-sql

ICU tokenizer: switch match method to using partial terms

3 years agoadjust address levels for boundaries in Slovakia
Sarah Hoffmann [Mon, 27 Sep 2021 21:32:11 +0000 (23:32 +0200)]
adjust address levels for boundaries in Slovakia

Levels choosen according to OSM wiki. Mainly moves admin_level 6
to county level and admin_level 8 to city/town level. Higher
levels are adjusted accordingly.

Fixes #2453.