Commit Graph

410 Commits

Author SHA1 Message Date
Sarah Hoffmann
6f6d116451 adapt index for changes name lookup 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
3ff6eccfd7 move trigger creation later in setup 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
5d1fa597ea clean up get_word_id function
Replaced by addr_ids_from_name() which also normalises the
string.
2020-01-23 22:28:43 +01:00
Sarah Hoffmann
3b6c2c9155 getNearestNamed*Feature functions better return values 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
f863040b38 factor out parent search from addr:street/addr:place 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
1033f8bce7 factor out searching for parent road for pois 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
cf4dbbd681 remove unused function 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
6dccc693d0 factor out computation of default names
Also moves the computation down the line so that we never
have to do it twice.
2020-01-23 22:28:43 +01:00
Sarah Hoffmann
c3dc66ce9c factor out place linking sql 2020-01-23 22:28:43 +01:00
Sarah Hoffmann
ddaf1b79d4 remove special handling of rail
Skip railway=rail in the style, so that installations can remove
it if they wish.
2020-01-08 23:53:23 +01:00
Sarah Hoffmann
7a194789bc remove remaining sql functions into function/ directory 2020-01-08 11:45:51 +01:00
Sarah Hoffmann
827d7a9a62 move postcode table triggers to own file 2020-01-08 11:22:23 +01:00
Sarah Hoffmann
dae2761137 move placex triggers into own file 2020-01-08 11:18:42 +01:00
Sarah Hoffmann
4304c1a7bb move place triggers into own file 2020-01-07 23:55:38 +01:00
Sarah Hoffmann
c537ea18a4 move functions for interpolation table in own file 2020-01-05 16:36:46 +01:00
Sarah Hoffmann
28fa7be75a move functions for address lookup into own file 2020-01-05 16:16:21 +01:00
Sarah Hoffmann
f1a5862f3d move creation function for aux data into own file
This function is currently unused, so don't even load it.
2020-01-05 16:04:04 +01:00
Sarah Hoffmann
4088e4e371 move importance/wikipedia functions into separate file 2020-01-05 15:55:39 +01:00
Sarah Hoffmann
0ef6425847 move SQL functions for normalisation in separate file 2020-01-05 15:38:20 +01:00
Sarah Hoffmann
12f830fbbb fix loading of data without wikipedia files
Also removes unused place_boundingbox table.
2019-11-17 23:58:43 +01:00
Sarah Hoffmann
6d764a05b0 prefer English wikipedia for wikidata matches 2019-11-17 19:53:42 +01:00
Sarah Hoffmann
e4555a208d fix wikidata import
The loop was not skipping empty results of get_wikipedia_match().
2019-11-17 10:06:34 +01:00
Sarah Hoffmann
d1a9dc0f24 use wikidata links for importance as well 2019-11-16 16:52:23 +01:00
Sarah Hoffmann
5fb850982a move importance computation into its own function 2019-11-16 16:52:23 +01:00
Sarah Hoffmann
e3e9f69654 fix rank of postcode results
Fixes #1487.
2019-10-19 17:57:57 +02:00
Sarah Hoffmann
34a4a9b08f create/drop indexes concurrently
Fixes #1507.
2019-10-19 17:13:05 +02:00
Sarah Hoffmann
511204c158
Merge pull request #1443 from lonvia/reorganize-search-name-partition-tables
Reorganize search name partition tables
2019-07-28 15:18:12 +02:00
Sarah Hoffmann
79b81d39d8 streamline indexes of search_name partition tables
Remove index on name_vector. We always do near search where the
geometry index is sufficient. Also split centroid index in low
and high rank indexes. Reduces index size by about 25%.
2019-07-28 13:29:35 +02:00
Sarah Hoffmann
2bbe5017d4 use bbox of geometry when searching for attached streets
As we are doing a distance search, this improves results for
large places like airports.

Fixes #1442.
2019-07-28 13:28:27 +02:00
marc tobias
765a932561 make US postcode data to an optional download 2019-07-24 01:13:57 +02:00
marc tobias
0e44659033 during TIGER import skip records with negative house number range 2019-07-21 21:41:12 +02:00
Sarah Hoffmann
be47cd2549 remove country from place_addressline
The country information can be determined sufficiently from
the country code. We only loose the specific OSM object
behind the address.

Also streamlines the location_area_country table.
2019-07-10 21:29:47 +02:00
Sarah Hoffmann
4c1793b4e3 recreate interpolations when one of their support nodes changes
A simple update is not enough because the interpolation splits
might change as well as the housenumbers.

Fixes #1360.
2019-07-03 23:15:54 +02:00
Sarah Hoffmann
d1ca73f813 Reset housenumber on every place update
As it is a computed field, it needs to be computed from scratch
to take into account any surrounding changes.

Fixes #1395.
2019-07-03 20:56:35 +02:00
Sarah Hoffmann
b0e6fb73c6 generally remove all country and state places from address
Gets rid of the hard-coded expection for place nodes and sets
the address rank generally via the address level config instead.
That means only administrative boundaries are now used at that
level in addresses.
2019-06-30 22:27:44 +02:00
Sarah Hoffmann
e05e413cc4 use real centroid when looking for near roads
The point-on-surface may be at the corner in large objects, so
that roads are too far away.

Fixes #1389.
2019-06-10 18:23:12 +02:00
marc tobias
10fbda702b exclude postcode ranges separated by colon from centre point calculation 2019-05-25 20:43:38 +02:00
Sarah Hoffmann
403ee260f6 Ensure that postcode relations are used in addresses
Postcode nodes are normally thrown away as they only play
a role for computing artifical postcodes. However, if we
have a postcode area this still should take part of the
address.

Fixes #1330.
2019-04-14 11:20:03 +02:00
Sarah Hoffmann
189da9afb3 add osm_id index for osmline table
Needed when deleting address interpolation.
2019-02-21 23:26:31 +01:00
marc tobias
853b536394 Remove get_addressrank_label. Move get_searchrank_label to PHP 2019-02-09 20:38:36 +01:00
Sarah Hoffmann
3811d916b9 remove self-reference from place-addressline 2019-02-09 15:26:10 +01:00
Sarah Hoffmann
c822012aad ignore admin boundary ways for countries and states
Countries and states are mapped world-wide as relations by now.

Fixes #543 and #1291.
2019-01-26 13:37:10 +01:00
Sarah Hoffmann
cc17aa8d6b Remove postcodes also from word table when they no longer exist
Also adds tests for postcode updates.

Fixes #1273.
2019-01-04 23:11:47 +01:00
Sarah Hoffmann
c68833cd7f Merge branch 'document-osm-country-grid' of https://github.com/mtmail/Nominatim 2018-12-01 22:20:50 +01:00
Sarah Hoffmann
d4fa528d5c
Merge pull request #1245 from lonvia/address-levels-from-json
Make rank assignments configurable
2018-12-01 21:43:53 +01:00
marc tobias
8e19336f49 document what country_osm_grid does 2018-11-29 17:06:04 +01:00
marc tobias
a7e26e8f59 remove Natural Earth dataset 2018-11-27 20:13:33 +01:00
Sarah Hoffmann
e10d11c6c7 Make rank assignments configurable
The initial search and address rank is saved in a table
that is set up from a json configuration file. Ranks may
be assigned on a country level according to class and
type of the object. Special handling that depends on the
geometry or OSM type is still hard-coded in placex insert.

The new default config file mimicks the current assignment
as close as possible. A couple of exceptions have been
removed, most notably the exception for Irish townlands.
2018-11-24 16:21:16 +01:00
Sarah Hoffmann
5d98c09ee9 Add reverse-only parameter to setup
Avoids creating the search_name table. Useful when only /reverse
is used or the content is directly exported to photon.

Fixes #939.
2018-11-21 19:36:21 +01:00
Sarah Hoffmann
fb796d14ec Always ignore continents for addresses
Fixes #1236.
2018-11-18 17:00:59 +01:00
Sarah Hoffmann
43c2eb383e Remove country and state nodes from address computation
OSM has by now almost complete coverage of admin
boundaries up to state level. Place nodes will do more
harm than good in this case.
2018-11-17 23:32:08 +01:00
marc tobias
bb696f3fd0 import_osmosis_log table: increase possible batch size 2018-09-15 11:36:46 +02:00
Sarah Hoffmann
60cea6c8bf fixup use of indexes for latest reverse changes 2018-08-08 22:04:39 +02:00
Sarah Hoffmann
48d4ea5542 Do not have postcode node appear in addresses directly
Many of the postcode nodes are actually derived from
incomplete addresses and are as such not even centroids.
Better let them only take part in the address computation
via the postcode table.
2018-08-05 14:25:20 +02:00
Sarah Hoffmann
9bdbbec0c8
Merge pull request #1110 from lonvia/remove-address-check-for-long-lines
Remove special search for address part for long ways
2018-08-04 23:19:32 +02:00
Sarah Hoffmann
646fa53b44 improve place node search when no areas found
Only look for place nodes in a certain radius according
to the rank_search of the place node.
2018-08-04 21:51:23 +02:00
Sarah Hoffmann
7f10264fb6
Merge pull request #1095 from estadtherr/remote_postgres_pr
Enable Postgres to run on a different host than the web server
2018-08-02 23:16:07 +02:00
Sarah Hoffmann
4a28d28c08 prefix function calls in make_standard_name() with schema
Fixes #1097.
2018-08-01 23:12:34 +02:00
Sarah Hoffmann
713ea080d2 Remove special search for address part for long ways
Ways now always have the complete set of crossing boundaries
independent of the length.

Fixes #1108.
2018-07-22 15:05:45 +02:00
Eric Stadtherr
62747c934d Work on setup/update scripts, unit tests, and documentation to enable Postgres server to be optionally configured on a remote host 2018-07-21 12:09:47 -06:00
Sarah Hoffmann
0315b87664 update indexes for new reverse algorithm 2018-07-02 23:56:56 +02:00
Sarah Hoffmann
ac29f8bc91 Merge branch 'better-reverse' of https://github.com/gemo1011/Nominatim into gemo1011-better-reverse 2018-07-02 21:33:27 +02:00
Unknown
ec6a427e0a edited indices an setup file to grant select for table country_osm_grid 2018-06-28 11:34:19 +02:00
Sarah Hoffmann
09b59bd56a increase search radius when looking for addr:place base objects
Fixes #1036.
2018-06-27 22:45:34 +02:00
gemo1011
144c3b3eb2 fixed syntax error 2018-06-27 14:55:19 +02:00
gemo1011
71e3d8b1de GRANT SELECT ON Table country_osm_grid 2018-06-27 14:55:16 +02:00
gemo1011
d5e39260b3 updated indices for reverse geocoding 2018-06-27 14:55:14 +02:00
Sarah Hoffmann
743ec43460 nearest place search should match any of given tokens not all
When multiple isin tokens are given, then these are duplicates
and it is enough that any one of them is found in the
name_vector.

Fixes #1056.
2018-06-14 00:11:19 +02:00
Sarah Hoffmann
6706a23fb5 streamline SQL for parenting rank 30 places
- avoid select all
 - prefer direct select into
 - use early loop exit when possible
2018-05-01 15:44:18 +02:00
Sarah Hoffmann
c7faab4d7c adapt reverse index to changed reverse query
Thanks to @gemo1011.
2018-05-01 15:29:39 +02:00
Sarah Hoffmann
53c526c01d remove search_name_country table
The table is no longer used, country names are handled
directly via the word table.
2018-04-16 20:47:45 +02:00
Sarah Hoffmann
dc371618ba remove now unused getNearestNamedRoadFeature() function 2018-04-16 20:34:28 +02:00
Sarah Hoffmann
59288417f0 remove debug code 2018-04-16 20:29:30 +02:00
Sarah Hoffmann
1dd401b570 remove use of is_in terms for address computation
The code has been dead for a long time because all is_in
terms have been added to the nameaddress_vector so
that the IF condition would never hit.
2018-04-16 20:27:16 +02:00
Sarah Hoffmann
ee194ab369 remove special search for Tiger postcodes
Postcodes should no longer appear in the address search terms.
2018-04-16 20:25:19 +02:00
Sarah Hoffmann
b8113abd93 fix variable name 2018-04-16 20:16:11 +02:00
Sarah Hoffmann
5182da9f45 add tests for address tag parsing for search name 2018-04-15 22:52:42 +02:00
Sarah Hoffmann
14c25717ab restrict addr:* tags that are used for search term
Fixes #1001.
2018-04-15 22:17:20 +02:00
Sarah Hoffmann
d79a2bb17e increase search radius for named streets in addresses
Fixes #950.
2018-03-16 23:37:42 +01:00
Sarah Hoffmann
c3483747eb reimport boundaries from scratch when type is changed
Fixes #895.
2018-02-12 21:19:27 +01:00
Sarah Hoffmann
cbaabe7c24 add function to recalculate counts for full-word search term 2017-12-17 16:00:28 +01:00
Sarah Hoffmann
35c7269bac when linking waterway ways and relations allow all river-like types
Fixes #848
2017-12-16 17:00:55 +01:00
Sarah Hoffmann
e523b34db9 precomputed postcodes must use dedicated import function 2017-10-28 18:24:01 +02:00
Sarah Hoffmann
c44324fda5 ignore linked places for address details
Fixes #816.
2017-10-27 21:57:35 +02:00
Sarah Hoffmann
7ea1ef3feb take country names only from relations 2017-10-12 21:03:03 +02:00
Sarah Hoffmann
bafbf679b6 add script for updating postcodes 2017-10-03 15:58:14 +02:00
Sarah Hoffmann
909b0c7462 Merge pull request #782 from lonvia/rework-postcodes
Rework handling of artificial postcode centroids
2017-09-16 15:54:55 +02:00
Sarah Hoffmann
37c653396b increase search rank of leisure=park
Fixes #786.
2017-08-31 21:10:48 +02:00
Sarah Hoffmann
caf018538f normalize all postcodes before use 2017-08-19 19:37:06 +02:00
Sarah Hoffmann
ccae2c733b simplify search for artificial postcodes 2017-08-19 19:37:06 +02:00
Sarah Hoffmann
5673c4cf91 special handling for estimated postcode in areas
Don't add a postcode at all if multiple estimated
postcodes fall into the area.
2017-08-19 19:37:06 +02:00
Sarah Hoffmann
a44377c7b0 fix postcode-related tests 2017-08-19 19:37:06 +02:00
Sarah Hoffmann
5b4bbab9be include GB CodePoint data into location_postcode table 2017-08-19 19:37:06 +02:00
Sarah Hoffmann
413c69ddc9 improve calculation of postcode for interpolations 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
ce76a25101 merging back postcodes is no longer necessary 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
57dc0304b5 add search for postcode
Implements the 'postcode' operator.
2017-08-19 19:37:05 +02:00
Sarah Hoffmann
727bd73d0b fix typo 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
a2a1901b09 add postcodes as special items in word table 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
43869b9938 make sure postcode gets recomputed on update 2017-08-19 19:37:05 +02:00
Sarah Hoffmann
9a86c0cebc use only computed postcode when getting address
Postcodes from address parts are now ignored as they have
been already taken into account when computing the postcode.
2017-08-19 19:37:05 +02:00