Class: GeoCli::FeatureCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/geo-cli/geom_reader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entities) ⇒ FeatureCollection

Returns a new instance of FeatureCollection.



81
82
83
# File 'lib/geo-cli/geom_reader.rb', line 81

def initialize(entities)
  @entities = entities
end

Instance Attribute Details

#entitiesObject (readonly)

Returns the value of attribute entities.



80
81
82
# File 'lib/geo-cli/geom_reader.rb', line 80

def entities
  @entities
end

Instance Method Details

#to_geojsonObject



85
86
87
88
# File 'lib/geo-cli/geom_reader.rb', line 85

def to_geojson
  {type: "FeatureCollection",
   features: entities.map { |e| e.as_geojson(true) } }.to_json
end