Skip to content
Snippets Groups Projects

Resolve "Introduce a new filter for when rules should be run based on the source ID of a building."

Compare and Show latest version
1 file
+ 6
13
Compare changes
  • Side-by-side
  • Inline
+ 6
13
@@ -145,23 +145,16 @@ class AbstractRule(abc.ABC):
"""
# Geographic filter, passes if the inputs coordinates lie within the boundary geometry.
if self.geographic_filter_boundary_geometry is None:
pass
elif self.geographic_filter_boundary_geometry.contains(
shapely.geometry.Point(longitude, latitude)
if (
self.geographic_filter_boundary_geometry is not None
and not self.geographic_filter_boundary_geometry.contains(
shapely.geometry.Point(longitude, latitude)
)
):
pass
else:
return False
# Source ID filter, passes if the rules and the inputs source ID match.
if self.rule_source_ids is None:
pass
elif source_id in self.rule_source_ids:
print(source_id, self.rule_source_ids)
pass
else:
if self.rule_source_ids is not None and source_id not in self.rule_source_ids:
return False
return True
Loading