Class: Gdal::Ogr::Feature

Inherits:
Object
  • Object
show all
Defined in:
lib/rgdal/overrides/feature.rb

Instance Method Summary collapse

Instance Method Details

#attributesObject



8
9
10
11
12
13
14
15
# File 'lib/rgdal/overrides/feature.rb', line 8

def attributes
  {}.tap do |hash|
    get_field_count.times do |i|
      definition = self.get_field_defn_ref(i)
      hash[definition.name] = get_field(i)
    end
  end
end

#inspectObject



4
5
6
# File 'lib/rgdal/overrides/feature.rb', line 4

def inspect
  "#<Gdal::Ogr::Feature #{attributes.map { |k,v| "'#{k}'='#{v}'"}.join(' ')}>"
end