lib/rgeo/geo_json/coder.rb
def decode_polygon_coords(poly_coords)
        return unless poly_coords.is_a?(Array)
        rings = []
        poly_coords.each do |ring_coords|
          return unless ring_coords.is_a?(Array)
          points = []
          ring_coords.each do |point_coords|
            point = decode_point_coords(point_coords)
            points << point if point
          end
          ring = @geo_factory.linear_ring(points)
          rings << ring if ring
        end
        if rings.size == 0
          nil
        else
          @geo_factory.polygon(rings[0], rings[1..-1])
        end
      end
# Create a new coder settings object. The geo factory is passed as
# a required argument.
#
# Options include:
#
# [<tt>:geo_factory</tt>]
#   Specifies the geo factory to use to create geometry objects.
#   Defaults to the preferred cartesian factory.
# [<tt>:entity_factory</tt>]
#   Specifies an entity factory, which lets you override the types
#   of GeoJSON entities that are created. It defaults to the default
#   RGeo::GeoJSON::EntityFactory, which generates objects of type
#   RGeo::GeoJSON::Feature or RGeo::GeoJSON::FeatureCollection.
#   See RGeo::GeoJSON::EntityFactory for more information.
Create a new coder settings object. The geo factory is passed as
a required argument.

Options include.

[:geo_factory]
Specifies the geo factory to use to create geometry objects.
Defaults to the preferred cartesian factory.
[:entity_factory]
Specifies an entity factory, which lets you override the types
of GeoJSON entities that are created.
Create a new coder settings object . The geo factory is passed as a required argument . Options include . [ : geo_factory ] Specifies the geo factory to use to create geometry objects . Defaults to the preferred cartesian factory . [ : entity_factory ] Specifies an entity factory which lets you override the types of GeoJSON entities that are created .
def decode_polygon_coords(poly_coords)
        return unless poly_coords.is_a?(Array)
        rings = []
        poly_coords.each do |ring_coords|
          return unless ring_coords.is_a?(Array)
          points = []
          ring_coords.each do |point_coords|
            point = decode_point_coords(point_coords)
            points << point if point
          end
          ring = @geo_factory.linear_ring(points)
          rings << ring if ring
        end
        if rings.size == 0
          nil
        else
          @geo_factory.polygon(rings[0], rings[1..-1])
        end
      end
def decode_polygon_coords ( poly_coords ) return unless poly_coords . is_a? ( Array ) rings = [ ] poly_coords . each do | ring_coords | return unless ring_coords . is_a? ( Array ) points = [ ] ring_coords . each do | point_coords | point = decode_point_coords ( point_coords ) points << point if point end ring = @geo_factory . linear_ring ( points ) rings << ring if ring end if rings . size == 0 nil else @geo_factory . polygon ( rings [ 0 ] , rings [ 1 .. - 1 ] ) end end
Create a new coder settings object.
Create a new coder settings object .
poly_coords