add state name to national borders (#1039)

This PR adds state name to national borders (`admin_level=2`)

From zoom level 3 there is an added `adm0_l` and `adm0_r` attribute for national borders.

There is 3 main steps: 
1) union border lines from OSM and keep separate LineString between intersects
2) create polygons from step 1), create a point in each state polygon, add to this point a state abbreviation from NaturalEarth Data
3) create a short parallel line on the left and right of a small part of the border in 70m distance, and add information about which state overlap this short line.
This commit is contained in:
Tomas Pohanka
2020-11-12 12:14:13 +02:00
committed by GitHub
parent d180988f5f
commit 3ef364552e
4 changed files with 233 additions and 33 deletions

View File

@@ -14,6 +14,10 @@ layer:
The `admin_level` corresponds to the lowest `admin_level`
the line participates in.
At low zoom levels the Natural Earth boundaries are mapped to the equivalent admin levels.
adm0_l: |
State name on the left of the border. For country boundaries only (`admin_level = 2`).
adm0_r: |
State name on the right of the border. For country boundaries only (`admin_level = 2`).
disputed:
description: |
Mark with `1` if the border is disputed.
@@ -46,8 +50,9 @@ layer:
buffer_size: 4
datasource:
geometry_field: geometry
query: (SELECT geometry, admin_level, disputed, disputed_name, claimed_by, maritime FROM layer_boundary(!bbox!, z(!scale_denominator!))) AS t
query: (SELECT geometry, admin_level, adm0_l, adm0_r, disputed, disputed_name, claimed_by, maritime FROM layer_boundary(!bbox!, z(!scale_denominator!))) AS t
schema:
- ./boundary_name.sql
- ./boundary.sql
datasources:
- type: imposm3