This PR adds support for `capital=6` in the place layer, which is used for tagging county seats in the US. A county seat is the capital of a county. In addition, I reorganized the code a bit to be simpler. As noted in ZeLonewolf/openstreetmap-americana#384, we would like to render county seats along with state and national capitals, as this is typical styling on American-style maps. Update with also with `capital=3` and `capital=5`
11 lines
305 B
PL/PgSQL
11 lines
305 B
PL/PgSQL
CREATE OR REPLACE FUNCTION normalize_capital_level(capital text)
|
|
RETURNS int AS
|
|
$$
|
|
SELECT CASE
|
|
WHEN capital = 'yes' THEN 2
|
|
WHEN capital IN ('2', '3', '4', '5', '6') THEN capital::int
|
|
END;
|
|
$$ LANGUAGE SQL IMMUTABLE
|
|
STRICT
|
|
PARALLEL SAFE;
|