title: Getting InvalidGeometry: LinearRing failed ring test after upgrading rgeo gem
body: <p>After upgrading the <a href="https://github.com/rgeo/rgeo" rel="nofollow noreferrer">rgeo</a> gem from 0.6.0 to 2.1.1, we've started to get 'LinearRing failed ring test' on certain geometries that never caused us problems before. (The geometry data is generated from external sources outside of our control, and stored in PostGIS table.)</p>
  <p><strong>rgeo initializer:</strong></p>
  <pre><code>GEO_FACTORY = RGeo::Geographic.simple_mercator_factory
  PROJECTION_FACTORY = GEO_FACTORY.projection_factory
  RGeo::ActiveRecord::SpatialFactoryStore.instance.tap do |config|
    config.default = PROJECTION_FACTORY
  end
  </code></pre>
  <p><strong>Example code:</strong></p>
  <pre><code>district = District.first
  # Convert projected geometry to geographic geometry
  geographic_geometry = GEO_FACTORY.unproject(district.geometry)
  </code></pre>
  <blockquote>
  <p>RGeo::Error::InvalidGeometry: LinearRing failed ring test</p>
  </blockquote>
  <p>I also tried initializing the factory with the following options, but the errors persisted:</p>
  <pre><code>FACTORY = RGeo::Geographic.simple_mercator_factory(uses_lenient_assertions:true)
  FACTORY = RGeo::Geographic.simple_mercator_factory(lenient_multi_polygon_assertions:true)
  </code></pre>
  <p>I've inspected some of these geometries where that are failing the LinearRing test, and it appears they are failing for a variety of reasons. Some possibly violate <a href="https://www.rfc-editor.org/rfc/rfc7946#section-3.1.6" rel="nofollow noreferrer">ring winding order</a>, while with others I couldn't perceive the exact problem. But the point is, these are all geometries that we were able to work with before, and now are raising errors. I'd like to understand how we can return to the more lenient mode.</p>
  <p><strong>NOTES:</strong></p>
  <ul>
  <li>This is only happening on my Macbook (GEOS version 3.8.0), but not on our Linux production server (GEOS version 3.5.0)</li>
  </ul>
  <p><strong>REFERENCES:</strong></p>
  <ul>
  <li><a href="https://github.com/rgeo/rgeo/issues/194" rel="nofollow noreferrer">https://github.com/rgeo/rgeo/issues/194</a></li>
  <li><a href="https://github.com/rgeo/rgeo-geojson/issues/33" rel="nofollow noreferrer">https://github.com/rgeo/rgeo-geojson/issues/33</a></li>
  </ul>