I have a class in parse.com called Journey, which contains an origin and a destination column. As you can't have two geopoints on one object, I've had to make these pointers to a separate Address class to store the location data.
Journey
-------
objectId
origin (Pointer to Address object)
destination (Pointer to Address object)
Address
-------
objectId
location (geopoint)
country
What I can't figure out is how to construct a geo query to find journeys with an origin near a particular geopoint.
I can easily do a geo query on the Address class and return all Address objects near a point. But this seems wasteful as some of those might be a 'destinations' rather than 'origins'. I would also need to do a separate query on the Journey class to match these Address objects to Journey origins in order to find the appropriate journey.
Is there a better way of doing this? e.g. can I query the Journey object with a geo query on the origin relation?