Skip to content

Commit

Permalink
Update spatial.rb (#16)
Browse files Browse the repository at this point in the history
Hitting an issue like rgeo/rgeo-geojson#33 where we are getting "LinearRing failed ring test (RGeo::Error::InvalidGeometry)" for a valid polygon.  Added rescue from RGeo::Error::InvalidGeometry
  • Loading branch information
mhaksu authored and stadia committed Mar 4, 2019
1 parent e0476f5 commit 18ce13f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/active_record/type/spatial.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def parse_wkt(string)
else
RGeo::WKRep::WKTParser.new(spatial_factory, support_ewkt: true, default_srid: @srid).parse(string)
end
rescue RGeo::Error::ParseError
rescue RGeo::Error::ParseError, RGeo::Error::InvalidGeometry
nil
end
end
Expand Down

0 comments on commit 18ce13f

Please sign in to comment.