Geo lookups

13 views
Skip to first unread message

Greg Tracy

unread,
Mar 14, 2011, 8:55:27 PM3/14/11
to smsmyb...@googlegroups.com
We were talking tonight about doing Geo-based lookups to figure out where stops are located. There is a call in the API - getnearbystops - that returns nearby stops given a lat/lon.

There were some curiosities about how to get from a physical address to a specific latitude/longitude. Google Maps API is one option...


Here's an example for the corner of Pinckney and Main...


... note the use of "and" when describing the intersection.

Cheers.

Greg

Walker, Larry

unread,
Apr 2, 2011, 2:44:53 PM4/2/11
to smsmyb...@googlegroups.com
Greg:

Is getnearbystops enabled?

I thought we'd given it a test poke and saw it running. But this afternoon when I call it, I get nothing back:

http://www.smsmybus.com/api/v1/getnearbystops?key=B24JK9A4&lat=43.0732692&lon=-89.4337454

Larry

Greg Tracy

unread,
Apr 3, 2011, 12:00:35 AM4/3/11
to smsmyb...@googlegroups.com, Walker, Larry
OK. I just implemented this method... although it's not perfect. I'm
going to update the api docs, but the current implementation has the
following limitations...

- the radius field is ignored. it's hard-coded to 500 meters
- you are required to include a routeID in the search query

There's a problem with the route-free version of the call and I'm not
sure what's up with it yet. I'm going to take another look tomorrow.

Hopefully, I'll get over to Sector67 for a bit tomorrow as well.

Cheers.

Greg

Greg Tracy

unread,
Apr 16, 2011, 12:16:02 PM4/16/11
to smsmyb...@googlegroups.com
Circling back on this thread now that I've resolved these limitations.

The 'getnearbystops' call now works as documented...
 - NO routeID is required
 - The radius parameter is now implemented. But keep in mind that, internally, the API limits the radius to a max of 500. When you're querying stops around the square, it's very effective when you have a radius under 50.

Larry Walker has been building some fun things with this call!

Cheers.

Greg

Walker, Larry

unread,
Apr 17, 2011, 10:42:02 AM4/17/11
to smsmyb...@googlegroups.com
Yes, I have had a great time using Greg's API. I've written a web-app to look up arrival times, given either a stop # or generic location (like "state & gorham"). It should work well (or at least usably) on any web browser, on PC/laptop/smart-phone/etc:


       

The pull-down next to Stop is currently in alpha-test: right now it remembers all the stops anyone has asked for (because that was easy) but as soon as time permits, I plan to make it user-specific, either using cookies/sessions or via client-side storage.

You are encouraged to try this out at: 


Feedback is encouraged! (disclaimer: the Stops Near feature is known to be a little slow, since it has to make multiple API calls to figure out which direction each stop serves...)

Coming Next: QR-coded Post-It notes to put on bus-stops, to allow smart-phones to get arrivals info with a quick scan:


This is what a good, public API can unleash!

Larry


--
----
API Docs : http://www.smsmybus.com/api/
 
 
You received this message because you are subscribed to the Google
Groups "smsmybus-dev" group.
To post to this group, send email to smsmyb...@googlegroups.com
To unsubscribe from this group, send email to
smsmybus-dev...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/smsmybus-dev?hl=en?hl=en

Greg Tracy

unread,
Apr 17, 2011, 11:13:12 AM4/17/11
to smsmyb...@googlegroups.com

Awesome!

Can you add a snippet of text to that page that shows the user which address the browser is using for the user's current location? It would help set expectations for the quality of results.

On Apr 17, 2011 9:43 AM, "Walker, Larry" <walk...@gmail.com> wrote:
> Yes, I have had a great time using Greg's API. I've written a web-app to look up arrival times, given either a stop # or generic location (like "state & gorham"). It should work well (or at least usably) on any web browser, on PC/laptop/smart-phone/etc:
>
>
>
>
> The pull-down next to Stop is currently in alpha-test: right now it remembers all the stops anyone has asked for (because that was easy) but as soon as time permits, I plan to make it user-specific, either using cookies/sessions or via client-side storage.
>
> You are encouraged to try this out at:
>
> tinyurl.com/livemetrobus
>
> Feedback is encouraged! (disclaimer: the Stops Near feature is known to be a little slow, since it has to make multiple API calls to figure out which direction each stop serves...)
>
> Coming Next: QR-coded Post-It notes to put on bus-stops, to allow smart-phones to get arrivals info with a quick scan:
>
>
>

Walker, Larry

unread,
Apr 17, 2011, 12:28:46 PM4/17/11
to smsmyb...@googlegroups.com
Greg:

Not sure what you mean: I'm not using the browser's current location at present: just whatever location the user entered...

Larry

Greg Tracy

unread,
Apr 17, 2011, 4:50:03 PM4/17/11
to smsmyb...@googlegroups.com
I guess I misread that. I thought you were generating the list of nearby stops from the browser's location. 

I thought that's what you were building with the 'getnearbystops' API call.

Greg


Walker, Larry

unread,
Apr 17, 2011, 5:01:17 PM4/17/11
to smsmyb...@googlegroups.com
That mode would be a "nice to have" if/when I have time to learn how to read accelerometer data from the device in a web-app. For now I just call it a feature that you can ask for any location, not just where you're standing...

Larry


Greg Tracy

unread,
Apr 17, 2011, 5:24:54 PM4/17/11
to smsmyb...@googlegroups.com
If you share the html/javascript, I can help with this if you'd like.

Greg

Reply all
Reply to author
Forward
0 new messages