Skip to content
Snippets Groups Projects

Resolve "Create a rule that gets the construction date from cadaster data for Tabula dataset."

Compare and Show latest version
1 file
+ 3
3
Compare changes
  • Side-by-side
  • Inline
# Copyright (c) 2023-2024:
# Copyright (c) 2024:
# Helmholtz-Zentrum Potsdam Deutsches GeoForschungsZentrum GFZ
#
# This program is free software: you can redistribute it and/or modify it
@@ -38,14 +38,14 @@ class DateFromValencianCadasterRule(AbstractRule):
formatted string wrapped in the `ST_GeomFromText()` function.
Returns:
Integer that represents the building's construction year.
Integer that represents the building's year of construction.
"""
sql_statement = f"""
SELECT construction_year
FROM Parcels
INNER JOIN cadaster_buildings USING parcel_id
INNER JOIN cadaster_buildings USING(parcel_id)
WHERE ST_Intersects({geometry}, Parcels.geom)
"""
database.cursor.execute(sql_statement)
Loading