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;
