Class: OvertureMaps::Models::Base

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/overture_maps/models/base.rb

Direct Known Subclasses

Address, BaseFeature, Building, Connector, Division, Place, Segment

Instance Method Summary collapse

Instance Method Details

#to_geojsonObject



28
29
30
31
32
33
34
35
36
# File 'lib/overture_maps/models/base.rb', line 28

def to_geojson
  return nil unless geometry

  {
    type: "Feature",
    geometry: RGeo::GeoJSON.encode(geometry),
    properties: attributes.except("geometry", "created_at", "updated_at")
  }
end