logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Login


Options
View
Go to last post Go to first unread
Alex88  
#1 Posted : Saturday, August 27, 2011 2:59:14 PM(UTC)
Alex88

Rank: Member

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 10

Thanks: 1 times
Hi there!

For the stops.getInfo method, could you please include a key that lists of the routes that use that stop?

Code:
{
    "stat" : "ok",
    "stops" : [
        {
            "code" : "MTD6451",
            "stop_id" : "IU:1",
            "stop_lat" : 40.110248,
            "stop_lon" : -88.227898,
            "stop_name" : "Illini Union"
            "routes" : "{2,5,7,22}"
        }
    ]
}


Thanks!


Peter Zich  
#2 Posted : Saturday, August 27, 2011 6:24:26 PM(UTC)
Peter Zich

Rank: Newbie

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 7
Location: Champaign, IL

Thanks: 1 times
The routes and their direction would be appreciated.
Sean  
#3 Posted : Monday, August 29, 2011 3:41:03 PM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
I'm not necessarily opposed to adding functionality like this, but I'm a little on the fence about whether that belongs in the response for this method. If you want to find out what routes service a particular stop you can always call routes.getListByStop or even stop_times.getListByStop.

If you can make a good argument why that data should be included in the response of that method instead of a separate call, I'm willing to listen to it.
Alex88  
#4 Posted : Monday, August 29, 2011 5:22:56 PM(UTC)
Alex88

Rank: Member

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 10

Thanks: 1 times
Sean wrote:
I'm not necessarily opposed to adding functionality like this, but I'm a little on the fence about whether that belongs in the response for this method. If you want to find out what routes service a particular stop you can always call routes.getListByStop or even stop_times.getListByStop.

If you can make a good argument why that data should be included in the response of that method instead of a separate call, I'm willing to listen to it.


You make good points. I think my problem will overall be solved by the current implementation. Initially, I had an issue with receiving multiple stops with different ":X" endings, but the departures.getListByStop method actually doesn't need that suffix.

My implementation centers around stops.getListByLatLon and at least half of those can be condensed when you eliminate the suffixes.
Ryan  
#5 Posted : Tuesday, August 30, 2011 7:58:21 AM(UTC)
Ryan

Rank: Administration

Groups: Administrators, Registered
Joined: 6/1/2011(UTC)
Posts: 88
United States
Location: Urbana

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
If a stop_id has a ":X" after it then it is representing a specific latitude/longitude point on a map. You can use the stop_id without the :X to get a "composite stop" representing all the stops specific stop points at an intersection. So for instance:

Code:
http://developer.cumtd.com/api/v1.0/json/stops.getInfo?key={key}&stop_id=CHCHNEIL:1;CHCHNEIL:3
http://developer.cumtd.com/api/v1.0/json/stops.getInfo?key={key}&stop_id=CHCHNEIL


would both actually return:

Code:
{
    "stat": "ok",
    "stops": [
        {
            "code": "MTD7533",
            "stop_id": "CHCHNEIL:1",
            "stop_lat": 40.118148,
            "stop_lon": -88.243319,
            "stop_name": "Church & Neil"
        },
        {
            "code": "MTD7533",
            "stop_id": "CHCHNEIL:3",
            "stop_lat": 40.118246,
            "stop_lon": -88.24373,
            "stop_name": "Church & Neil"
        }
    ]
}

Edited by user Tuesday, August 30, 2011 7:59:33 AM(UTC)  | Reason: Not specified

Alex88  
#6 Posted : Tuesday, August 30, 2011 2:09:16 PM(UTC)
Alex88

Rank: Member

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 10

Thanks: 1 times
Yes I realized that after I originally posted my issue.

Is there anyway to get more than 20 results from the LatLong call? (I know you can implement your own filter with the entire database set, but I don't want to send that call to you guys so often).

Ryan  
#7 Posted : Wednesday, August 31, 2011 7:40:55 AM(UTC)
Ryan

Rank: Administration

Groups: Administrators, Registered
Joined: 6/1/2011(UTC)
Posts: 88
United States
Location: Urbana

Thanks: 1 times
Was thanked: 6 time(s) in 6 post(s)
How many stops are you looking to get with this method call?

If you would like to implement your own filter you can use stops.getList and store the data locally as the list of stops only changes a few times a year at most. We are working on a feature for v1.1 of the API to easily check when this data changes.
Peter Zich  
#8 Posted : Wednesday, August 31, 2011 9:00:38 AM(UTC)
Peter Zich

Rank: Newbie

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 7
Location: Champaign, IL

Thanks: 1 times
I think 20 is reasonable for an initial load, but I was hoping to offer a way to load additional stops that are still in the area but not one of the 20 closest. I suppose I should just do my own distance calculations.
Peter Zich  
#9 Posted : Wednesday, August 31, 2011 9:18:39 AM(UTC)
Peter Zich

Rank: Newbie

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 7
Location: Champaign, IL

Thanks: 1 times
Sean wrote:
I'm not necessarily opposed to adding functionality like this, but I'm a little on the fence about whether that belongs in the response for this method. If you want to find out what routes service a particular stop you can always call routes.getListByStop or even stop_times.getListByStop.

If you can make a good argument why that data should be included in the response of that method instead of a separate call, I'm willing to listen to it.


I could see presenting the user with the buses that go through a particular stop so they can be sure they have the right stop. If you were to first call stops.getListByLatLong you would then have to make 20 calls to routes.getListByStop (as it does not accept multiple stop IDs, and the format of the response would have to vary).

I've asked about this for other methods, but would it be possible to return the direction in this method? I'd like the user to pick a particular stop (for example, the eastbound or westbound side of First & Daniel have the 22S and 22N respectively) so they're sure about which side to be on and there isn't additional clutter in the departure list.
Sean  
#10 Posted : Wednesday, August 31, 2011 1:29:43 PM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
Peter, maybe you could explain the user scenario where this would be really useful to help us understand. I could see wanting to add a route_id parameter to stops.getListByLatLon so that a user could find the closest stops to pick up a specific route (which we are definitely looking into adding now that we've thought of it). If a user just wants to see what routes are available at a certain stop then routes.getListByStop covers it. If you want to everything you can always download the GTFS export as well.
Alex88  
#11 Posted : Wednesday, August 31, 2011 2:52:42 PM(UTC)
Alex88

Rank: Member

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 10

Thanks: 1 times
In my current application implementation, it would be common for a user to select a bus line and find all the stops it has. How would I do this efficiently with the current methods? (Maybe I've just been looking at this too long and am missing something simple....)

Also, do any of you guys have Android phones that I would be able to deploy this app towards for testing?

Thank you.
Sean  
#12 Posted : Thursday, September 1, 2011 8:57:11 AM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
We're going to have to talk about this one some more internally. There's going to be a few obstacles with adding this that we'll need to work through before this might happen.

We'd love to check out your app if you make the source code or .apk available to us. Ryan and I both have Android phones :)
Alex88  
#13 Posted : Wednesday, September 7, 2011 12:13:24 PM(UTC)
Alex88

Rank: Member

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 10

Thanks: 1 times
Sean wrote:
We're going to have to talk about this one some more internally. There's going to be a few obstacles with adding this that we'll need to work through before this might happen.

We'd love to check out your app if you make the source code or .apk available to us. Ryan and I both have Android phones :)



I've packaged an APK installer for anyone who would like to check it out. Please don't try to use the GPS function indoors, it simply won't find the satellites. Also, the network data could be spotty depending on where you are. Using it a couple times should make you understand it a lot better. I'm interested specifically in any bugs you find, or design changes you would suggest.

Thanks!

[url=VOID]Download removed until end of competition.[/url]

Also, I'm by no means an experienced Android programmer. This is very much a learning project for me as I figure out how other Android stuff works. I'm sure this could look more polished with time.

Edited by user Thursday, December 8, 2011 12:32:39 PM(UTC)  | Reason: Not specified

Sean  
#14 Posted : Thursday, September 8, 2011 9:22:07 AM(UTC)
Sean

Rank: Administration

Groups: Administrators
Joined: 4/11/2011(UTC)
Posts: 42

Was thanked: 3 time(s) in 3 post(s)
The only bug (if you could call it that) that I found was that my GPS didn't turn off once it located me. Seems like it would save battery to shut it off once you have a lock.

Also, the blue text on the orange background is a bit straining on the eyes.

Other than that, it looks pretty good. Are you planning any other big features?
thanks 1 user thanked Sean for this useful post.
Alex88 on 12/8/2011(UTC)
Alex88  
#15 Posted : Thursday, September 8, 2011 8:12:57 PM(UTC)
Alex88

Rank: Member

Groups: Registered
Joined: 8/25/2011(UTC)
Posts: 10

Thanks: 1 times
Sean wrote:
The only bug (if you could call it that) that I found was that my GPS didn't turn off once it located me. Seems like it would save battery to shut it off once you have a lock.

Also, the blue text on the orange background is a bit straining on the eyes.

Other than that, it looks pretty good. Are you planning any other big features?


My thought on that was if someone was for some reason unfamiliar with the area, they could watch their marker approach stops/streets. However, it would be much easier for me if I only grabbed it once :)

I really wanted to be able to get a list of all stops for a route. If someone could select "22 Illini" and see all the stops it has with their location, and click on a marker to pull up ETA's, I could see that useful as well.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.