Sarah Hoffmann
84ea0753d8
simplify getNearestRoadFeature function
...
The function only ever returns one result of which only the
place_id is used. So simplify it to return a single place_id
only (or NULL if none is found). Rename funciton to avoid
conflicts when updating an existing database.
2020-02-26 10:58:55 +01:00
Sarah Hoffmann
d643ca8dee
move address line computation in its own function
2020-02-21 16:38:14 +01:00
Sarah Hoffmann
6189e0c79b
improve parenting for large areas with rank 30
...
Instead of unconditionally parenting them to a street, the
larger areas get a parent area that contains them. To keep
things computationally light-weight, only use the centroid and
bbox to determine if an area is contained.
Requires renaming of parenting functions because renaming
a parameter of the function causes issues when updating the
function (it requires a manual delete, which I'd like to
avoid).
2020-02-19 08:43:53 +01:00
Sarah Hoffmann
92c5d3b720
make sure that linked places are within a boundary
...
This is a regression from previous code refactoring.
Fixes #1684 .
2020-02-18 22:46:32 +01:00
Sarah Hoffmann
2a6e8ad68e
add bbox whereclause to make postgis 3.0 happy
...
Normally ST_Covers() should include a bbox index use,
so adding a bbox where clause is not really necessary.
However, the query planner messes up and uses a parallel
index search with a second index instead of exclusively
running on the geometry index, when the bbox part is
missing.
2020-02-16 14:10:22 +01:00
Sarah Hoffmann
5ec25122f6
rename functions where return parameter changed
...
Postgresql cannot cleanly reimport these functions when
upgrading, so simply rename to avoid errors.
2020-01-23 22:28:43 +01:00
Sarah Hoffmann
6f6d116451
adapt index for changes name lookup
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