Method: SearchSolrTools::Helpers::TranslateSpatialCoverage.geojson_to_spatial_scope_facet

Defined in:
lib/search_solr_tools/helpers/translate_spatial_coverage.rb

.geojson_to_spatial_scope_facet(spatial_coverage_geom) ⇒ Object



69
70
71
72
73
74
75
76
77
# File 'lib/search_solr_tools/helpers/translate_spatial_coverage.rb', line 69

def self.geojson_to_spatial_scope_facet(spatial_coverage_geom)
  return if spatial_coverage_geom.nil?

  spatial_coverage_geom.map do |geo_json|
    bbox_hash = BoundingBoxUtil.bounding_box_hash_from_geo_json(geo_json)
    scope = SolrFormat.get_spatial_scope_facet_with_bounding_box(bbox_hash)
    scope unless scope.nil?
  end.uniq
end