class GeoRuby::GeoJSONFeatureCollection

Class added to support geojson 'Feature Collection' objects

Attributes

features[RW]

Public Class Methods

new(features) click to toggle source
# File lib/geo_ruby/geojson.rb, line 50
def initialize(features)
  @features = features
end

Public Instance Methods

==(other) click to toggle source
# File lib/geo_ruby/geojson.rb, line 54
def ==(other)
  if (self.class != other.class) || (features.size != other.features.size)
    return false
  else
    features.each_index do |index|
      return false if features[index] != other.features[index]
    end
  end
  true
end
as_geojson(options = {})
Alias for: to_json
to_json(options = {}) click to toggle source
# File lib/geo_ruby/geojson.rb, line 65
def to_json(options = {})
  ({ type: 'FeatureCollection', features: features }).to_json
end
Also aliased as: as_geojson