Fix a crash in case of invalid geometry

This commit is contained in:
Paul Chavard 2020-05-05 10:26:13 +02:00
parent a1b32ae419
commit 6556df2a85
5 changed files with 83 additions and 38 deletions

View file

@ -58,8 +58,8 @@ class Champs::CarteChamp < Champ
bounding_box = RGeo::Cartesian::BoundingBox.new(factory)
if geo_areas.present?
geo_areas.each do |area|
bounding_box.add(area.rgeo_geometry)
geo_areas.map(&:rgeo_geometry).compact.each do |geometry|
bounding_box.add(geometry)
end
elsif dossier.present?
point = dossier.geo_position