Location question

Hi, has anybody got any thoughts on how I would produce a search facility for ‘find your nearest store’ in freeway - my client has 7 stores and if I could do this on there site I would be over the moon.
Again thanks for your input
Jay


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

There may be a way to do this with a Google Maps mashup (meaning do it in the browser using JavaScript), but I haven’t done it personally. The last time I had to do this, I used a Ruby on Rails plug-in called Geocoder, which queried a free server in Canada for the Zip-to-geolocation stuff, then showed a list of matching locations ranked by distance from the starting Zip code. This only helps you if you have a Rails application there, or want to build one. Google offers a similar service, but theirs isn’t free when you use it in a commercial application like this. Here’s lots of info about it, including a list of compatible data providers and their costs: GitHub - alexreisner/geocoder: Complete Ruby geocoding solution.

I also did a test page way back in Freeway 2 using a MySQL database of Zip codes I bought from a (naggingly persistent) vendor and some MySQL Trigonometry code I found on Google. It’s called a Great Circle calculation, and it figures out the distance from the center of one Zip code to another. Trouble is, depending on the density of your region, this may be wildly inaccurate. Imagine somewhere in Montana, where there are more cattle than people. There, a Zip code may cover many many square miles, while in Manhattan, it may cover a few blocks. (The goal of a Zip code is to map a certain number of addressable locations to a single post office that presumably will deliver to them.) The issue becomes whether the location of your store is near the center of the (often weirdly-shaped) Zip code region or near one of the edges. And if the originating point isn’t near the center of its Zip code, you may send someone to a location that makes no sense at all, even if the numbers tell you that it should be the closest to them. I don’t have this code ready to hand, but once my file server gets replaced next week, I should be able to find it and post it somewhere visible.

This is a fun experiment, but it’s not something I’ve seen solved in a ready-to-use, no-code-needed manner. If anyone else knows of a way to do this that doesn’t require my propeller-beanie, please pipe up!

Walter

On Feb 9, 2014, at 1:43 PM, Jay wrote:

Hi, has anybody got any thoughts on how I would produce a search facility for ‘find your nearest store’ in freeway - my client has 7 stores and if I could do this on there site I would be over the moon.
Again thanks for your input
Jay


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

This is not a simple task.

What would make it simpler would be if the visitor input their location because just using the IP address they are surfing through can be wildly inaccurate.

And of course if your client has 7 stores in 7 states this will all be a lot easier/more accurate than 7 stores in 1 state

This page uses some Googlejuice to locate you from your IP http://deltadesign.co/FW6Test/geolocator.html - how accurate is it for you?

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

At 17:18 -0500 9/2/14, DeltaDave wrote:

This is not a simple task.

What would make it simpler would be if the visitor input their
location because just using the IP address they are surfing through
can be wildly inaccurate.

And of course if your client has 7 stores in 7 states this will all
be a lot easier/more accurate than 7 stores in 1 state

This page uses some Googlejuice to locate you from your IP
http://deltadesign.co/FW6Test/geolocator.html - how accurate is it
for you?

David

Interestingly it gives my location as Wembley near London instead of
Gloucester - only 100 miles out; whereas a similar lookup I tried
last week gave it as Sheffield - 150 miles out. The ISP office is in
Sheffield, but the hardware may well be in Wembley. I would be amazed
if it gave Gloucester as the answer.

David


David Ledger - Freelance Unix Sysadmin in the UK.
email@hidden
www.ivdcs.co.uk


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

And for me it gave my location as Sale, West Riding of Yorkshire - only 200 miles out.

But this was really just meant as an illustration of how inaccurate IP location can be.

I am sure there are better ‘services’ for this than the one that I used but unless you pay the money and have the back-end to go with it then there is no easy solution.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thanks for your response everyone, I was hoping to make the user input their postcode which might help. Another idea, maybe I could introduce a map with the store locations as pins. Not an ideal solution granted but I’ve only just starting building the site so might have to come back to this in a couple of days! Just trying to sort future issues out now.
Any other suggestions would be welcome!
Many thanks
Jay


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

On 10 Feb 2014, at 09:49, Jay email@hidden wrote:

Another idea, maybe I could introduce a map with the store locations as pins. Not an ideal solution granted but I’ve only just starting building the site so might have to come back to this in a couple of days! Just trying to sort future issues out now.
Any other suggestions would be welcome!

You can do this with the Google Maps and Google Maps Marker Actions in Freeway 6:

http://www.softpress.com/kb/questions/380/Google+Maps+Marker+Action+(Pro+only)

Joe


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

That looks like a good option thanks Joe - I’m thinking the client will want the user to key in there postcode and find one of the nearest 6 stores still but it would save a lot of hassle if I can talk them into this option.
Regards
Jay


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Jay,
I wrote a store locator Action a couple of years ago that works by plotting points on a Google Map and then allowing the visitor to find their nearest store simply by entering a place name or postcode. You can see the Action in use on this site;
http://valetpro.co.uk/store-locator.html

If you’re interested in either this Action or something like it that returns a range of results then please feel free to get in touch;
http://www.freewayactions.com/product.php?id=con
Regards,
Tim.

On 10 Feb 2014, at 10:18, Jay wrote:

I’m thinking the client will want the user to key in there postcode and find one of the nearest 6 stores still but it would save a lot of hassle if I can talk them into this option.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Any of these ip-to-location schemes can be foiled by a dynamic IP address or a large regional ISP. I am found either in Delaware or New York, depending on the whim of the routing gods, when actually I am just about a half mile north of Philadelphia. I have a static IP address, but the nearest hop outside of the Comcast cable network on to the public Internet could be anywhere in the eastern seaboard.

Walter

On Feb 9, 2014, at 8:00 PM, DeltaDave wrote:

And for me it gave my location as Sale, West Riding of Yorkshire - only 200 miles out.

But this was really just meant as an illustration of how inaccurate IP location can be.

I am sure there are better ‘services’ for this than the one that I used but unless you pay the money and have the back-end to go with it then there is no easy solution.

D


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

I wrote a store locator Action a couple of years ago that works by plotting points on a Google Map

Thanks for that link Tim which allowed me to ‘borrow’ some code to create an example.

http://www.deltadesign.co/FW6Test/custommap.html

I would certainly be interested in having a look at your action. While I dont have an immediate need for this I will store it in the Treasure Chest for future use.

I see your example uses the Google Maps Javascript API v2 which throws up some ‘no longer supported’ errors. What changes would need to be made to migrate it to v3?

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Hi Dave,
Er, thanks for the borrow. I’ve rewrote the Action last summer (after that site was put together) to use the new v3 Google Maps API. it does the same thing but without any console warnings.
Regards,
Tim.

On 10 Feb 2014, at 23:43, DeltaDave wrote:

Thanks for that link Tim which allowed me to ‘borrow’ some code to create an example.

http://www.deltadesign.co/FW6Test/custommap.html

I would certainly be interested in having a look at your action. While I dont have an immediate need for this I will store it in the Treasure Chest for future use.

I see your example uses the Google Maps Javascript API v2 which throws up some ‘no longer supported’ errors. What changes would need to be made to migrate it to v3?


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options