forked from ryanong/mongoid_spacial
-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
I have a location class and the only field is location.
class Address
include Mongoid::Document
include Mongoid::Geospatial
field :location, type: Point, sphere: true, delegate: true
spherical_index :location
end
Then, I try to create an address.
Address.create(location: Point.new(addr.lng, addr.lat).to_geo_json)
But it's giving an error, Hash must contain :x, :lon, :long, :lng, :longitude, 'x', 'lon', 'long', 'lng', 'longitude'
I need to use geo json point since I want to query for earth like sphere.
The issue is in point.rb where from_hash method isn't allowing the valid points.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels