Skip to content

Commit

Permalink
Does not duplicate osm_tag from ontology
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Apr 1, 2024
1 parent 9bc1059 commit 80deb17
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions datasources/connectors/teritorio_ontology.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def setup(kiba)
@job_id,
"#{superclass_id}-#{class_id}-#{subclass_id}",
subclasses['label'],
OverpassSelectSource::Settings.from_hash(@settings.merge({ 'select' => subclasses['osm_tags'] })),
OverpassSelectSource::Settings.from_hash(@settings.merge({ 'select' => subclasses['osm_tags'], 'with_osm_tags' => false })),
)
}
else
Expand All @@ -211,7 +211,7 @@ def setup(kiba)
@job_id,
"#{superclass_id}-#{class_id}",
classes['label'],
OverpassSelectSource::Settings.from_hash(@settings.merge({ 'select' => classes['osm_tags'] })),
OverpassSelectSource::Settings.from_hash(@settings.merge({ 'select' => classes['osm_tags'], 'with_osm_tags' => false })),
)
end
}
Expand Down
3 changes: 3 additions & 0 deletions datasources/sources/overpass_select.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class Settings < OverpassSource::Settings
))
const :relation_ids, T.nilable(T::Array[Integer])
const :interest, T.nilable(T::Array[String])
const :with_osm_tags, T::Boolean, default: true
end

extend T::Generic
Expand Down Expand Up @@ -83,6 +84,8 @@ def deep_select(object, &block)

sig { returns(OsmTagsRow) }
def osm_tags
return super() if !@settings.with_osm_tags

if @selectors.blank?
tree = OverpassParser.tree(@settings.query)
tags_all = {}
Expand Down

0 comments on commit 80deb17

Please sign in to comment.