Possible optimization of code
The function get_tiles_without_reference_entities
may do an unnecessary filtering on the EntityReference table in the query (used by Initializer):
sql_statement = f"""
SELECT A.quadkey, built_area_size
FROM
(
SELECT quadkey, built_area_size
FROM {self.tile_view}
WHERE quadkey IN ({quadkeys_in_batch}) AND built_area_size IS NOT NULL
) AS A
LEFT JOIN
(
SELECT quadkey FROM EntityReference
WHERE quadkey IN ({quadkeys_in_batch})
) AS E
ON E.quadkey = A.quadkey
WHERE E.quadkey IS NULL
"""
This could be simplified to a simple LEFT JOIN EntityReference AS E
, but it needs to be checked if this runs faster or at the same speed as before for bigger countries. There may also be other SQL queries that can be optimized.