Fix a crash in case of invalid geometry
This commit is contained in:
parent
a1b32ae419
commit
6556df2a85
5 changed files with 83 additions and 38 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue