Remove table building_multipolygon as multipolygon are already in table osm_building_polygon (#756)
Buildings from ways and multipolygons are loaded in table `osm_building_polygon`. But a table for `osm_building_multipolygon` is also loaded, the content is not used except to ensure an `osm_id` is from a multipolygon. To check if the object is from a multipolygon we have only to check if `osm_id` is negative. It is the counter part of e0c8ece375/layers/building/building.sql (L89)
I checked the objects are the same after this change.
This commit is contained in:
@@ -60,8 +60,8 @@ CREATE OR REPLACE VIEW osm_all_buildings AS (
|
||||
osm_building_street WHERE role = 'house' AND ST_GeometryType(geometry) = 'ST_Polygon'
|
||||
UNION ALL
|
||||
|
||||
-- etldoc: osm_building_multipolygon -> layer_building:z14_
|
||||
-- Buildings that are inner/outer
|
||||
-- etldoc: osm_building_polygon -> layer_building:z14_
|
||||
-- Buildings that are from multipolygons
|
||||
SELECT osm_id,geometry,
|
||||
COALESCE(nullif(as_numeric(height),-1),nullif(as_numeric(buildingheight),-1)) as height,
|
||||
COALESCE(nullif(as_numeric(min_height),-1),nullif(as_numeric(buildingmin_height),-1)) as min_height,
|
||||
@@ -71,7 +71,9 @@ CREATE OR REPLACE VIEW osm_all_buildings AS (
|
||||
nullif(colour, '') AS colour,
|
||||
FALSE as hide_3d
|
||||
FROM
|
||||
osm_building_polygon obp WHERE EXISTS (SELECT 1 FROM osm_building_multipolygon obm WHERE obp.osm_id = obm.osm_id)
|
||||
osm_building_polygon obp
|
||||
WHERE osm_id < 0
|
||||
|
||||
UNION ALL
|
||||
-- etldoc: osm_building_polygon -> layer_building:z14_
|
||||
-- Standalone buildings
|
||||
|
||||
Reference in New Issue
Block a user