-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Currently, checking if features exist on an attribute involves a begin... rescue
block. This can get pretty repetitive for checking single features and/or setting default values in mapper scripts:
Example of current pattern:
system_type = "Residential - furnace and central air conditioner"
begin
system_type = feature.system_type
rescue
end
I think adding a get_property
method to Feature
objects which can take an optional default value would help make the code cleaner and be more object oriented.
Example proposed usage:
# Returns the second argument if `system_type` doesn't exist in the feature.
system_type = feature.get_property("system_type", "Residential - furnace and central air conditioner")
Metadata
Metadata
Assignees
Labels
No labels