modify buildings query to ignore demolished
This commit is contained in:
parent
d73a526835
commit
0220547d53
@ -7,6 +7,8 @@ export async function queryBuildingsAtPoint(lng: number, lat: number) {
|
|||||||
FROM buildings as b, geometries as g
|
FROM buildings as b, geometries as g
|
||||||
WHERE
|
WHERE
|
||||||
b.geometry_id = g.geometry_id
|
b.geometry_id = g.geometry_id
|
||||||
|
AND
|
||||||
|
b.latest_demolish_date IS NULL
|
||||||
AND
|
AND
|
||||||
ST_Intersects(
|
ST_Intersects(
|
||||||
ST_Transform(
|
ST_Transform(
|
||||||
@ -45,6 +47,8 @@ export async function queryBuildingsByReference(key: string, ref: string) {
|
|||||||
buildings as b, building_properties as p
|
buildings as b, building_properties as p
|
||||||
WHERE
|
WHERE
|
||||||
b.building_id = p.building_id
|
b.building_id = p.building_id
|
||||||
|
AND
|
||||||
|
b.latest_demolish_date IS NULL
|
||||||
AND
|
AND
|
||||||
p.uprn = $1
|
p.uprn = $1
|
||||||
`,
|
`,
|
||||||
|
Loading…
Reference in New Issue
Block a user