Changing of real-time data

62 views
Skip to first unread message

Quentin Zervaas

unread,
Jan 30, 2013, 7:34:18 PM1/30/13
to atl-transit...@googlegroups.com
Hey guys

I'm using the JSON feed for the real-time data. I've noticed recently a new field was added into the feed, which results in my app breaking. The problem is that you've added the JSON using an array and inserted a new value into the middle of the array.

For instance, before the lat was the 6th element, now it's the 7th element, but there's no way for my code to detect this.

Is it possible that new values are either added to the end of the array, or you change it from using a JSON array to a JSON object (which would be more inline with the original SOAP feed)?

When a change like this occurs, once I actually notice it (or a user reports it) it can take up to 2-3 weeks to get a fix out

(note: I can use the original SOAP feed, but I prefer the lighter weight feed)

Thanks!

Quentin

Quentin Zervaas

unread,
Jan 30, 2013, 7:41:43 PM1/30/13
to atl-transit...@googlegroups.com
Oh - and related to this, what's the status on adding the trip ID to the feed? This would be ideal so I can integrate estimates with the scheduled times

Thanks!

Quentin

Jake Swanson

unread,
Feb 1, 2013, 12:49:29 PM2/1/13
to atl-transit...@googlegroups.com
I also vote for that JSON result to be an object/hash instead of an array, so it is not subject to ordering changes.
Something like: {key1: value1, key2: value2, key3: value3}

This is, of course, a breaking change too, so hopefully everyone can be made aware before the change goes out.

Kenny Chapman

unread,
Feb 1, 2013, 11:55:12 PM2/1/13
to atl-transit...@googlegroups.com
Why would your code rely on the ordering of the array? Just parse the keys you need and as long as the keys don't change you should be fine.


On Wednesday, January 30, 2013 7:34:18 PM UTC-5, Quentin Zervaas wrote:

Shaun

unread,
Feb 3, 2013, 12:16:39 PM2/3/13
to atl-transit...@googlegroups.com
Where are you seeing that only list data is returned? The endpoint I've been using returns a list of object data.

Jake Swanson

unread,
Feb 3, 2013, 12:18:26 PM2/3/13
to Shaun, atl-transit...@googlegroups.com
It was an outdated endpoint Shawn, you'll see the history of the API in this thread, I actually linked my code in the "proof of concept" thread from a few months back.


--
You received this message because you are subscribed to the Google Groups "atl-transit-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to atl-transit-devel...@googlegroups.com.
To post to this group, send email to atl-transit...@googlegroups.com.
Visit this group at http://groups.google.com/group/atl-transit-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

David Zhong (MARTA)

unread,
Feb 4, 2013, 12:21:01 PM2/4/13
to atl-transit...@googlegroups.com
Hi Quentin,

You can get value by using field name instead of using index. Here is the sample code:

    function CallRestService() {
        $.ajax({
            type: "GET",
            contentType: "application/json; charset=utf-8",
            dataType: "json",
            ProcessData: true,
            success: function (msg) {

                for (var i = 0, l = msg.length; i < l; i++) {

                    alert(msg[i].LATITUDE);
                    alert(msg[i].LONGITUDE);

                }
            },

            error: function () {

            }

        });

    }

David


On Wednesday, January 30, 2013 7:34:18 PM UTC-5, Quentin Zervaas wrote:

Quentin Zervaas

unread,
Feb 4, 2013, 4:06:39 PM2/4/13
to atl-transit...@googlegroups.com
Thanks - I must have missed the post about the updated endpoint

Cheers

Quentin
Reply all
Reply to author
Forward
0 new messages