Modified views for openstreetmap-carto-de.
authorUser for running Openstreetmap-things <osm@osm.rrze.uni-erlangen.de>
Fri, 25 Aug 2017 09:18:25 +0000 (11:18 +0200)
committerUser for running Openstreetmap-things <osm@osm.rrze.uni-erlangen.de>
Fri, 25 Aug 2017 09:18:25 +0000 (11:18 +0200)
Normally, osm-carto-de uses a hstore-only database, and emulates the things itself and openstreetmap-carto need with views on that.
We instead use the normal openstreetmap-carto-style (because it is faster and better maintained), and emulate what
osm-carto-de needs with views on that. These views have a _de appended to their name.
That means that we have to append a _de to all table-names in project.mml after
every update.

styles/osm-carto-de/views/view-line.sql [new file with mode: 0644]
styles/osm-carto-de/views/view-point.sql [new file with mode: 0644]
styles/osm-carto-de/views/view-polygon.sql [new file with mode: 0644]
styles/osm-carto-de/views/view-roads.sql [new file with mode: 0644]

diff --git a/styles/osm-carto-de/views/view-line.sql b/styles/osm-carto-de/views/view-line.sql
new file mode 100644 (file)
index 0000000..9ae9a25
--- /dev/null
@@ -0,0 +1,57 @@
+DROP VIEW IF EXISTS planet_osm_line_de;
+CREATE VIEW planet_osm_line_de AS
+SELECT
+osm_id,
+access as "access",
+"addr:interpolation" as "addr:interpolation",
+aerialway as "aerialway",
+aeroway as "aeroway",
+barrier as "barrier",
+building as "building",
+bicycle as "bicycle",
+bridge as "bridge",
+construction as "construction",
+covered as "covered",
+tags->'culvert' as "culvert",
+tags->'disused' as "disused",
+tags->'embankment' as "embankment",
+foot as "foot",
+highway as "highway",
+historic as "historic",
+horse as "horse",
+tags->'intermittent' as "intermittent",
+junction as "junction",
+"lock" as "lock",
+man_made as "man_made",
+name as "name",
+tags->'name:de' as "name:de",
+tags->'int_name' as "int_name",  
+tags->'name:en' as "name:en",
+"natural" as "natural",
+oneway as "oneway",
+tags->'operator' as "operator",
+"power" as "power",
+tags->'proposed' as "proposed",
+railway as "railway",
+ref as "ref",
+route as "route",
+service as "service",
+surface as "surface",
+tracktype as "tracktype",
+tunnel as "tunnel",
+waterway as "waterway",
+tags->'width' as "width",
+osm_tag2num(tags->'width') as "num_width",
+way as "way",
+way_area as way_area,
+z_order as z_order,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,' - ',way) as localized_name_second,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',false,false,' - ',way) as localized_name_first,
+osml10n_get_name_without_brackets(name, tags->'name:de', tags->'int_name', tags->'name:en',way) as localized_name_without_brackets,
+osml10n_get_streetname(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,' - ', way) as localized_streetname,
+COALESCE(tags->'name:hsb',tags->'name:dsb',name) as name_hrb,
+layer as layer,
+tags as tags
+FROM planet_osm_line;
+
+GRANT select ON planet_osm_line_de to public;
diff --git a/styles/osm-carto-de/views/view-point.sql b/styles/osm-carto-de/views/view-point.sql
new file mode 100644 (file)
index 0000000..ca55f5c
--- /dev/null
@@ -0,0 +1,60 @@
+DROP VIEW IF EXISTS planet_osm_point_de;
+CREATE VIEW planet_osm_point_de AS
+SELECT
+osm_id,
+"access" as "access",
+"addr:housename" as "addr:housename",
+"addr:housenumber" as "addr:housenumber",
+admin_level as "admin_level",
+aerialway as "aerialway",
+aeroway as "aeroway",
+amenity as "amenity",
+barrier as "barrier",
+boundary as "boundary",
+building as "building",
+tags->'capital' as "capital",
+tags->'denomination' as "denomination",
+tags->'ele' as "ele",
+osm_tag2num(tags->'ele') as "num_ele",
+tags->'generator:source' as "generator:source",
+highway as "highway",
+historic as "historic",
+tags->'iata' as "iata",
+junction as "junction",
+landuse as "landuse",
+leisure as "leisure",
+man_made as "man_made",
+military as "military",
+name as "name",
+tags->'name:de' as "name:de",
+tags->'int_name' as "int_name",  
+tags->'name:en' as "name:en",
+"natural" as "natural",
+tags->'operator' as "operator",
+place as "place",
+tags->'population' as "population",
+power as "power",
+tags->'power_source' as "power_source",
+railway as "railway",
+ref as "ref",
+religion as "religion",
+tags->'ruins' as "ruins",
+tags->'service' as "service",
+shop as "shop",
+tags->'sport' as "sport",
+tourism as "tourism",
+waterway as "waterway",
+tags->'wetland' as "wetland",
+osm_tag2num(tags->'width') as "num_width",
+way as "way",
+tags->'z_order' as z_order,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,chr(10),way) as localized_name_second,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',false,false,chr(10),way) as localized_name_first,
+osml10n_get_name_without_brackets(name, tags->'name:de', tags->'int_name', tags->'name:en',way) as localized_name_without_brackets,
+osml10n_get_streetname(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,chr(10), way) as localized_streetname,
+COALESCE(tags->'name:hsb',tags->'name:dsb',name) as name_hrb,
+layer as layer,
+tags as "tags"
+FROM planet_osm_point;
+
+GRANT select ON planet_osm_point_de TO public;
diff --git a/styles/osm-carto-de/views/view-polygon.sql b/styles/osm-carto-de/views/view-polygon.sql
new file mode 100644 (file)
index 0000000..56ba202
--- /dev/null
@@ -0,0 +1,61 @@
+DROP VIEW IF EXISTS planet_osm_polygon_de;
+CREATE VIEW planet_osm_polygon_de AS
+SELECT
+osm_id,
+"access" as "access",
+"addr:housename" as "addr:housename",
+"addr:housenumber" as "addr:housenumber",
+admin_level as "admin_level",
+aerialway as "aerialway",
+aeroway as "aeroway",
+amenity as "amenity",
+barrier as "barrier",
+bicycle as "bicycle",
+boundary as "boundary",
+bridge as "bridge",
+building as "building",
+tags->'denomination' as "denomination",
+tags->'generator:source' as "generator:source",
+highway as "highway",
+historic as "historic",
+tags->'iata' as "iata",
+junction as "junction",
+landuse as "landuse",
+tags->'leaf_type' as "leaf_type",
+leisure as "leisure",
+man_made as "man_made",
+military as "military",
+name as "name",
+tags->'name:de' as "name:de",
+tags->'int_name' as "int_name",  
+tags->'name:en' as "name:en",
+"natural" as "natural",
+tags->'operator' as "operator",
+place as "place",
+power as "power",
+tags->'power_source' as "power_source",
+railway as "railway",
+ref as "ref",
+religion as "religion",
+tags->'ruins' as "ruins",
+shop as "shop",
+tags->'sport' as "sport",
+surface as "surface",
+tourism as "tourism",
+waterway as "waterway",
+tags->'wetland' as "wetland",
+osm_tag2num(tags->'width') as "num_width",
+way as "way",
+way_area as way_area,
+z_order as z_order,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,chr(10),way) as localized_name_second,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',false,false,chr(10),way) as localized_name_first,
+osml10n_get_name_without_brackets(name, tags->'name:de', tags->'int_name', tags->'name:en', way) as localized_name_without_brackets,
+osml10n_get_streetname(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,chr(10), way) as localized_streetname,
+osml10n_get_country_name(tags,chr(10),'de') as country_name,
+COALESCE(tags->'name:hsb',tags->'name:dsb',name) as name_hrb,
+layer as layer,
+tags as "tags"
+FROM planet_osm_polygon;
+
+GRANT select ON planet_osm_polygon_de TO public;
diff --git a/styles/osm-carto-de/views/view-roads.sql b/styles/osm-carto-de/views/view-roads.sql
new file mode 100644 (file)
index 0000000..797f462
--- /dev/null
@@ -0,0 +1,44 @@
+DROP VIEW IF EXISTS planet_osm_roads_de;
+CREATE VIEW planet_osm_roads_de AS
+SELECT
+osm_id,
+admin_level as "admin_level",
+covered as "covered",
+highway as "highway",
+name as "name",
+tags->'name:de' as "name:de",
+tags->'int_name' as "int_name",
+tags->'name:en' as "name:en",
+railway as "railway",
+ref as "ref",
+service as "service",
+surface as "surface",
+tunnel as "tunnel",
+aerialway as "aerialway",
+"addr:housenumber" as "addr:housenumber",
+aeroway as "aeroway",
+amenity as "amenity",
+barrier as "barrier",
+boundary as "boundary",
+building as "building",
+historic as "historic",
+lock as "lock",
+man_made as "man_made",
+power as "power",
+route as "route",
+shop as "shop",
+waterway as "waterway",
+tags->'width' as "width",
+way as way,
+way_area as way_area,
+z_order as z_order,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,' - ',way) as localized_name_second,
+osml10n_get_placename(name, tags->'name:de', tags->'int_name', tags->'name:en',false,false,' - ',way) as localized_name_first,
+osml10n_get_name_without_brackets(name, tags->'name:de', tags->'int_name', tags->'name:en', way) as localized_name_without_brackets,
+osml10n_get_streetname(name, tags->'name:de', tags->'int_name', tags->'name:en',true,false,' - ', way) as localized_streetname,
+COALESCE(tags->'name:hsb',tags->'name:dsb',name) as name_hrb,
+layer as layer,
+tags as "tags"
+FROM planet_osm_roads;
+
+GRANT select ON planet_osm_roads_de TO public;
This page took 0.187129 seconds and 4 git commands to generate.