Class: Gdal::Ogr::Layer
- Inherits:
-
Object
- Object
- Gdal::Ogr::Layer
- Defined in:
- lib/rgdal/overrides/layer.rb
Instance Method Summary collapse
Instance Method Details
#column_names ⇒ Object
22 23 24 |
# File 'lib/rgdal/overrides/layer.rb', line 22 def column_names fields.map(&:name) end |
#features ⇒ Object
7 8 9 10 11 12 |
# File 'lib/rgdal/overrides/layer.rb', line 7 def features [].tap do |array| self.each { |feature| array << feature } reset_reading end end |
#fields ⇒ Object
18 19 20 |
# File 'lib/rgdal/overrides/layer.rb', line 18 def fields definition.get_field_count.times.map { |i| definition.get_field_defn(i) } end |
#fields_hash ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/rgdal/overrides/layer.rb', line 26 def fields_hash {}.tap do |hash| fields.each do |field| hash[field.name] = field.type end end end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/rgdal/overrides/layer.rb', line 14 def to_s "#<Gdal::Ogr::Layer name='#{self.get_name}' field_count='#{fields.count}'>" end |