Continuation from #1360260: Add views filter to provide proximity search of Geofields. My original patch allowed sorting based on the distance from a different entity. The much much improved patch that was eventually commited to 2.x only allows for sorting on absolute distances. I'm moving to 2.x so I can get the proper haversine calculation, but I still need a relative distance.

Attaching patch. It's still a total hack, I know, but this time I think it has the potential to become proper patch. :)

CommentFileSizeAuthor
geofield_distance_sort.patch1.23 KBLetharion

Comments

Letharion’s picture

I'm not setting this to needs review since the patch is not really in a state that is worth reviewing. I'm just posting it in case someone else want's to pick up from here.

fehin’s picture

Hi Letharion, thank you for your hard work on the patches.

Would you please you provide a tutorial on how to create a proximity search? I'm trying to do a proximity search on users and I have created a view but can't find the proper settings for the distance search. Thanks in advance for the help.

Letharion’s picture

Sorry fehin, the patch is not in such a state that it is useful to anyone who doesn't understand the PHP code. There's no way to provide the information you seek at this time.

grantlucas’s picture

I've been looking through the distance filters this morning and am wondering if it's possible to implement #1469956: [Meta] - Improve Views-powered Geofield proximity searches in with these changes. Essentially, there would be another filter with an autocomplete field for location. This would then be geocoded to get the lat and long of the origin. I'm attempting to implement this but honestly am a bit lost :(.

The way I see how it could work is that there would be two filters which could work together. The distance filter and the origin filter. The distance could have a default lat/long but also support getting it's origin data from the text origin filter and then vice versa for the origin filter. It can have a default radius but could also pull from the distance filter.

Thoughts?

Brandonian’s picture

Status: Active » Fixed

Current views integration refactor handles distance filtering from other geofields.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.