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

@ -49,6 +49,8 @@ class GeoArea < ApplicationRecord
def rgeo_geometry
RGeo::GeoJSON.decode(geometry.to_json, geo_factory: RGeo::Geographic.simple_mercator_factory)
rescue RGeo::Error::InvalidGeometry
nil
end
def self.from_feature_collection(feature_collection)