33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/search_solr_tools/helpers/translate_spatial_coverage.rb', line 33
def self.geojson_to_spatial_index_str(spatial_coverage_geom)
spatial_coverage_geom = convert_multipoint_to_point(spatial_coverage_geom)
spatial_coverage_geom.map do |geo_json|
if geo_json.geometry_type.to_s.downcase.eql?('point')
"#{geo_json.x} #{geo_json.y}"
else
bbox = RGeo::Cartesian::BoundingBox.create_from_geometry(geo_json)
"ENVELOPE(#{bbox.min_x}, #{bbox.max_x}, #{bbox.max_y}, #{bbox.min_y})"
end
end
end
|