Module: RGeo::Feature::Instance
- Defined in:
- lib/rgeo/geo_json/conversion_methods.rb
Instance Method Summary collapse
-
#as_geojson ⇒ Object
(also: #as_json)
Convert a geometry to a GeoJSON Hash.
-
#to_geojson ⇒ Object
(also: #to_json)
Convert a geometry to a GeoJSON String.
Instance Method Details
#as_geojson ⇒ Object 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_geojson ⇒ Object 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 |