Alex ([personal profile] alexbayleaf) wrote in [site community profile] dw_biz 2013-01-10 01:08 am (UTC)

I'm going to go out on a limb and suggest that you make it a text field.

What is it used for? Just for finding people near you? If so, how widely used is that feature?

If you don't much care about "people near you", then you can let users put whatever they like. Some will put "Hogwarts", of course, but so what? One option, though, could be that if someone puts something which isn't yet in the database, then suggest other options within a short edit distance of what they typed. Eg, I type "Austraila" (not typo) and it says, "Did you really mean Austraila, or were you thinking of a) Australia, b) Austria?" This will at least cluster popular locations and let you find other people in that location, tag-style.

If you care about "people near you", you could do geolocation. Let them type what they want, and you then use a Geo API (eg. Google Maps) to locate it on a map and say, "Is this where you meant?" If so, save their lat/long along with the text string they entered. This means that people with privacy concerns can say "Australia" and show an approximate location, while those who don't mind giving more information can say "Thornbury, Victoria, Australia" and give more.

"People near you" could be done using geo-coords, eg. "people within 100km" or whatever. There are libraries for this, if you have their lat/long.

(We're probably going to use the second of these options, i.e. text field entry, geolocation, and storing the lat/long, for Growstuff.)

Post a comment in response:

This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting