Sha256: f64d3bde95aa07d3dbbbbdfd5ba25d565c17497ea6623a65186575f5d46e4bfd

Contents?: true

Size: 602 Bytes

Versions: 1

Compression:

Stored size: 602 Bytes

Contents

module OGR
  module DataSourceExtensions
    # @return [Array<OGR::Layer>]
    def layers
      @layers = Array.new(layer_count) { |i| layer(i) }
    end

    # @return [Hash]
    def as_json(options = nil)
      {
        data_source: {
          driver: driver.name,
          layer_count: layer_count,
          layers: layers.map(&:as_json),
          name: name,
          style_table: style_table ? style_table.as_json(options) : nil
        },
        metadata: all_metadata
      }
    end

    # @return [String]
    def to_json(options = nil)
      as_json(options).to_json
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffi-gdal-1.0.0.beta6 lib/ogr/data_source_extensions.rb