Skip to content

Instantly share code, notes, and snippets.

@OnkelTem
Last active December 24, 2015 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OnkelTem/6c224d06bd4e8e3bb061 to your computer and use it in GitHub Desktop.
Save OnkelTem/6c224d06bd4e8e3bb061 to your computer and use it in GitHub Desktop.
- id: "admin-areas-istra-text"
name: "admin-areas-istra-text"
class: ""
geometry: "point"
<<: *extents
Datasource:
<<: *osm2pgsql
table: |-
(
SELECT
ST_PointOnSurface(way) as way,
CASE
WHEN position('сельское поселение' in name) != 0 THEN trim(replace(name, 'сельское поселение', '')) || ' с.п.'
WHEN position('городское поселение' in name) != 0 THEN trim(replace(name, 'городское поселение', '')) || ' г.п.'
WHEN position('район' in name) != 0 THEN trim(replace(name, 'район', '')) || ' р-н.'
ELSE name
END as name,
admin_level
FROM planet_osm_polygon
WHERE osm_id IN (
SELECT a8.osm_id
FROM planet_osm_polygon a8 JOIN planet_osm_polygon a6
ON ST_Contains(a6.way, a8.way)
WHERE a6.osm_id = -184072
AND a8.admin_level = '8'
AND a6.boundary = 'administrative'
AND a8.boundary = 'administrative')
) AS admin_areas_istra
properties:
minzoom: 9
advanced: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment