Skip to content

Commit

Permalink
Merge pull request #446 from OpenHistoricalMap/fix/imposm_triggers
Browse files Browse the repository at this point in the history
View implementation for Tiler-db
  • Loading branch information
Rub21 authored Dec 23, 2024
2 parents f270661 + c5ea42b commit bf19cd8
Show file tree
Hide file tree
Showing 5 changed files with 398 additions and 117 deletions.
56 changes: 28 additions & 28 deletions images/tiler-imposm/config/layers/admin_areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"source": "admin_areas",
"tolerance": 5000,
"sql_filter": "admin_level IN (1,2)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z0_2",
"view": "admin_boundaries_lines_z0_2",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z0_2",
"view": "admin_boundaries_centroid_z0_2",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
},
Expand All @@ -29,15 +29,15 @@
"source": "admin_areas",
"tolerance": 1000,
"sql_filter": "admin_level IN (1,2,3,4)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z3_5",
"view": "admin_boundaries_lines_z3_5",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z3_5",
"view": "admin_boundaries_centroid_z3_5",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
},
Expand All @@ -46,15 +46,15 @@
"source": "admin_areas",
"tolerance": 200,
"sql_filter": "admin_level IN (1,2,3,4,5,6)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z6_7",
"view": "admin_boundaries_lines_z6_7",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z6_7",
"view": "admin_boundaries_centroid_z6_7",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
},
Expand All @@ -63,15 +63,15 @@
"source": "admin_areas",
"tolerance": 100,
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z8_9",
"view": "admin_boundaries_lines_z8_9",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z8_9",
"view": "admin_boundaries_centroid_z8_9",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
},
Expand All @@ -80,15 +80,15 @@
"source": "admin_areas",
"tolerance": 20,
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z10_12",
"view": "admin_boundaries_lines_z10_12",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z10_12",
"view": "admin_boundaries_centroid_z10_12",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
},
Expand All @@ -97,15 +97,15 @@
"source": "admin_areas",
"tolerance": 5,
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z13_15",
"view": "admin_boundaries_lines_z13_15",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z13_15",
"view": "admin_boundaries_centroid_z13_15",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
},
Expand All @@ -114,15 +114,15 @@
"geometry_transform": "ST_Boundary(geometry)",
"geometry_transform_types": "GeometryType(geometry) IN ('POLYGON', 'MULTIPOLYGON')",
"sql_filter": "admin_level IN (1,2,3,4,5,6,7,8,9,10)",
"sub_tables": [
"materialized_views": [
{
"table": "admin_boundaries_lines_z16_20",
"view": "admin_boundaries_lines_z16_20",
"geometry_transform": "ST_Boundary(geometry)"
},
{
"table": "admin_boundaries_centroid_z16_20",
"view": "admin_boundaries_centroid_z16_20",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
"sql_filter": "name IS NOT NULL AND name <> '' AND osm_id NOT IN ( SELECT osm_id FROM osm_relation_members WHERE role = 'label')"
}
]
}
Expand Down
24 changes: 12 additions & 12 deletions images/tiler-imposm/config/layers/water_areas.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
"source": "water_areas",
"sql_filter": "type IN ('water', 'riverbank') AND area > 100000000",
"tolerance": 5000,
"sub_tables": [
"materialized_views": [
{
"table": "water_areas_centroid_z0_2",
"view": "water_areas_centroid_z0_2",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
Expand All @@ -16,9 +16,9 @@
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 50000000",
"tolerance": 1000,
"sub_tables": [
"materialized_views": [
{
"table": "water_areas_centroid_z3_5",
"view": "water_areas_centroid_z3_5",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
Expand All @@ -28,9 +28,9 @@
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 1000000",
"tolerance": 200,
"sub_tables": [
"materialized_views": [
{
"table": "water_areas_centroid_z6_7",
"view": "water_areas_centroid_z6_7",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
Expand All @@ -40,9 +40,9 @@
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank') AND area > 10000",
"tolerance": 100,
"sub_tables": [
"materialized_views": [
{
"table": "water_areas_centroid_z8_9",
"view": "water_areas_centroid_z8_9",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
Expand All @@ -52,9 +52,9 @@
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank')",
"tolerance": 20,
"sub_tables": [
"materialized_views": [
{
"table": "water_areas_centroid_z10_12",
"view": "water_areas_centroid_z10_12",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
Expand All @@ -64,9 +64,9 @@
"source": "water_areas",
"sql_filter": "type IN ('water', 'pond', 'basin', 'canal', 'mill_pond', 'riverbank', 'dock')",
"tolerance": 5,
"sub_tables": [
"materialized_views": [
{
"table": "water_areas_centroid_z13_15",
"view": "water_areas_centroid_z13_15",
"geometry_transform": "(ST_MaximumInscribedCircle(geometry)).center",
"sql_filter": "name IS NOT NULL AND name <> ''"
}
Expand Down
Loading

0 comments on commit bf19cd8

Please sign in to comment.