Module: RGeo::Feature::Instance

Defined in:
lib/rgeo/geo_json/conversion_methods.rb

Instance Method Summary collapse

Instance Method Details

#as_geojsonObject Also known as: as_json

Convert a geometry to a GeoJSON Hash



29
30
31
# File 'lib/rgeo/geo_json/conversion_methods.rb', line 29

def as_geojson
  GeoJSON.encode(self)
end

#to_geojsonObject Also known as: to_json

Convert a geometry to a GeoJSON String



35
36
37
# File 'lib/rgeo/geo_json/conversion_methods.rb', line 35

def to_geojson
  ::MultiJson.dump(as_geojson)
end