Brian Sperlongano 9c78c15943
Add support for county seats (capital=6) (#1401)
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`
2022-07-26 13:19:16 +02:00

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;