diff --git a/checklist.chk b/checklist.chk index 6beb7d0e..276359d3 100644 --- a/checklist.chk +++ b/checklist.chk @@ -1,6 +1,6 @@ 6bc6dd86fedb960398b5d38e35af89fb ./testbuild/testmaptiles.tm2source/data.yml d712def4ed07ad7a5d7173a3572acc73 ./testbuild/mapping.yaml -23aed4458497e8f0d794ddb6d5a02b42 ./testbuild/tileset.sql +da380515eacff2c557cd753aa66018ba ./testbuild/tileset.sql 2bbb5f07cf224ce595b7e6863bbbeac4 ./testbuild/doc/housenumber.md 1023bb8893f5bd1077a0376d5c0c4e5d ./testbuild/sqlquery.sql 321ae45757024c5b7b7d46714a2f17f6 ./testbuild/devdoc/etl_housenumber.dot diff --git a/openmaptiles/sql.py b/openmaptiles/sql.py index 7f8d5c6d..4f33eb55 100644 --- a/openmaptiles/sql.py +++ b/openmaptiles/sql.py @@ -7,11 +7,6 @@ def collect_sql(tileset_filename): tileset = Tileset.parse(tileset_filename) sql = '' - - definition = tileset.definition - languages = map(lambda l: str(l), definition.get('languages', [])) - sql += get_slice_language_tags(languages) - for layer in tileset.layers: sql += layer_notice(layer['layer']['id']) for schema in layer.schemas: @@ -21,19 +16,3 @@ def collect_sql(tileset_filename): def layer_notice(layer_name): return "DO $$ BEGIN RAISE NOTICE 'Layer {0}'; END$$;".format(layer_name) - -SLICE_LANGUAGE_TAGS_SQL="""CREATE OR REPLACE FUNCTION slice_language_tags(tags hstore) -RETURNS hstore AS $$ - SELECT delete_empty_keys(slice(tags, ARRAY[{0}])) -$$ LANGUAGE SQL IMMUTABLE; -""" - -def get_slice_language_tags(languages): - include_tags = list(map(lambda l: 'name:'+l, languages)) - include_tags.append('int_name') - include_tags.append('loc_name') - include_tags.append('name') - - tags_sql = "'" + "', '".join(include_tags) + "'" - - return SLICE_LANGUAGE_TAGS_SQL.format(tags_sql)