Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions sql/model/create_facade_scan_tiles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,12 @@ CREATE TABLE IF NOT EXISTS maplayer.facade_scan_tiles (
neighborhood_id text,
district_id text,
municipality_id text,
height numeric,
-- double precision, NOT numeric: ST_AsMVT has no MVT type for numeric and
-- encodes it as a STRING, which silently breaks fill-extrusion-height
-- (["get","height"] must yield a number or the layer renders flat).
-- The static tippecanoe tiles emitted a number here; building_tiles has
-- always used double precision for the same reason.
height double precision,
owner text,
-- report.rotation_type / report.crack_type / report.facade_scan_risk /
-- data.foundation_risk_indication stored as text: ST_AsMVT emits the
Expand Down Expand Up @@ -64,7 +69,7 @@ AS $$
f.neighborhood_id,
f.district_id,
f.municipality_id,
f.height,
f.height::double precision,
f.owner,
f.skewed_parallel_facade::text,
f.skewed_perpendicular_facade::text,
Expand Down
8 changes: 6 additions & 2 deletions sql/model/create_incident_tiles.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ CREATE TABLE IF NOT EXISTS maplayer.incident_tiles (
-- report.foundation_damage_cause as text: ST_AsMVT emits the enum label
-- either way, and text keeps this table independent of enum DDL.
foundation_damage_cause text,
height numeric,
-- double precision, NOT numeric: ST_AsMVT has no MVT type for numeric and
-- encodes it as a STRING, which silently breaks fill-extrusion-height
-- (incident.json feeds ["get","height"] straight into it). The static
-- tippecanoe tiles emitted a number here.
height double precision,
geom geometry(MultiPolygon, 3857)
);

Expand Down Expand Up @@ -110,7 +114,7 @@ AS $$
d.external_id,
m.external_id,
i.foundation_damage_cause::text,
round(GREATEST(bh.height, 0::real)::numeric, 2),
round(GREATEST(bh.height, 0::real)::numeric, 2)::double precision,
ST_Multi(ST_Transform(ba.geom, 3857))
FROM report.incident i
JOIN geocoder.building_active ba ON ba.external_id = i.building_id::text
Expand Down
Loading