Datasets – Land Transport Authority (LTA)

Land Transport Authority
The Land Transport Authority (LTA) is a statutory board under the Ministry of Transport, that spearheads land transport developments in Singapore.
LTA plans the long-term transport needs of Singapore, taking care of those who drive as well as those who take public transport. The ultimate goal – a smooth and seamless journey for all.

Datasets Available

Dataset Description URL Metadata
Traffic Incidents Updates of major incidents on the roads in Singapore https://api.projectnimbus.org/ltaodataservice.svc/IncidentSet Click Here
Traffic Images Links to the current images taken at various ponts along the main expressways https://api.projectnimbus.org/ltaodataservice.svc/CameraImageSet Click Here
Road Conditions Current average speed at various segments of the roads in Singapore https://api.projectnimbus.org/ltaodataservice.svc/TrafficConditionSet Click Here
Alarms Alarms on various infrastructures requiring attention https://api.projectnimbus.org/ltaodataservice.svc/AlarmInfoSet Click Here
Planned Road Opening Data on Planned Road and their opening details https://api.projectnimbus.org/ltaodataservice.svc/PlannedRoadOpeningSet Click Here
VMS Messaging System for drivers found on major roads https://api.projectnimbus.org/ltaodataservice.svc/VMSSet Click Here
ERP Rates Rates of ERP in Singapore https://api.projectnimbus.org/ltaodataservice.svc/ERPRateSet Click Here
Travelling Time Travelling time on major expressway in Singapore https://api.projectnimbus.org/ltaodataservice.svc/TravelTimeSet Click Here
Car Park Availability Car Park Availability for major shopping malls in Singapore https://api.projectnimbus.org/ltaodataservice.svc/CarParkSet Click Here
Road Works List of road works happening around Singapore https://api.projectnimbus.org/ltaodataservice.svc/RoadWorkSet Click Here

The above links are access to Sample Traffic datasets only.
For developers who would like to request for the full traffic datasets, click here to submit an automated request to LTA.

Code Snippet

.NET – How do I access a complete list of incidents near me

public List<IncidentEntry> GetIncidentFromNimbusLTA(string AccountKey, string UniqueUserID)
    {

        System.Net.WebRequest wr=
          HttpWebRequest.Create(
            "https://api.projectnimbus.org/ltaodataservice.svc/IncidentSet?Latitude=1.3&Longitude=103.85&Distance=2000");
        wr.Headers.Add("AccountKey",AccountKey);
        wr.Headers.Add("UniqueUserID",UniqueUserID);
        wr.Method = "GET";
        WebResponse res = wr.GetResponse();
        string resStr
         = new System.IO.StreamReader(res.GetResponseStream()).ReadToEnd();

        XNamespace atomNS
          = "http://www.w3.org/2005/Atom";
        XNamespace dNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices";
        XNamespace mNS
          = "http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";

        List<IncidentEntry> results
          = (from item in XElement.Parse(resStr).Descendants(atomNS + "entry")
            let incident = item.Element(atomNS + "content").Element(mNS +"properties")
                select new IncidentEntry() {
                IncidentID incident.Element(dNS +"IncidentID").Value,
                Message = incident.Element(dNS +"Message").Value,
                Lat = incident.Element(dNS + "Latitude").Value,
                Lon = incident.Element(dNS + "Longitude").Value
            }).ToList();

        return results;
    }

Java – How do I access a complete list of incidents near me

public ArrayList<ISTraffic> getCameras(String accountKey, String uniqueId) {
  trafficList = new ArrayList<CISTraffic>();
  try {
    URL _url = new URL("https://api.projectnimbus.org/ltaodataservice.svc/IncidentSet?Latitude=1.3&Longitude=103.85&Distance=2000");
    URLConnection _urlConn = _url.openConnection();
    _urlConn.setRequestProperty("accept", "*/*");
    _urlConn.addRequestProperty("AccountKey", accountKey);
    _urlConn.addRequestProperty("UniqueUserID", uniqueId);
    BufferedReader br = new BufferedReader(new InputStreamReader(_urlConn.getInputStream()));
    String line = null;
    StringBuilder strBuilder = new StringBuilder();

    while ((line = br.readLine()) != null) {
      strBuilder.append(line);
      System.out.println(line);
    }

    String[] IProperties = strBuilder.toString().split("<m:properties>");
    for (String str : IProperties) {
      ISTraffic traffic = new ISTraffic();
      traffic.setIncidentID(Utils.getStringBetween(str, "<d:IncidentID m:type=\"Edm.Int32\">", "</d:IncidentID>"));
      traffic.setMessage(Utils.getStringBetween(str, "<d:Message>", "</d:Message>"));
      traffic.setCLatitude(Utils.getStringBetween(str, "<d:Latitude m:type=\"Edm.Double\">", "</d:Latitude>"));
      traffic.setCLongitude(Utils.getStringBetween(str, "<d:Longitude m:type=\"Edm.Double\">", "</d:Longitude>"));
      trafficList.add(traffic);
      }
    } catch (MalformedURLException ex) {
        ex.printStackTrace();
    } catch (IOException ex) {
        ex.printStackTrace();
    } catch (Exception ex) {
        ex.printStackTrace();
    }
    return trafficList;
}

Helpers Available

.NET – C# Proxy Classes: click here | Read this blog post for more information to use these proxy classes.

JAVA – Read this blog post for more information to use JAVA to connect to the data service.

PHP & AJAX – Read this blog post for more information to use PHP/AJAX to connect to the data service.

obj C / xcode – coming soon

Terms of Use

The datasets:

  • Are here as a community technology preview for a period of time (TBD).
  • Cannot be used in any public offering.
  • Are offered as-is with no official support.

Support

None at this time.

This entry was posted in Uncategorized. Bookmark the permalink.

12 Responses to Datasets – Land Transport Authority (LTA)

  1. Pingback: What is Project Nimbus? How do I get started? « Project Nimbus

  2. Jensen says:

    Hello

    May I inquire the meaning of “public offering” that you referred to when you mentioned that the datasets “Cannot be used in any public offering.”? Thank you.

    Regards
    Jensen

    • Chewy Chong says:

      Hey there Jensen,

      The current datasets available are intended as a community technical preview. We may change things throughout this preview based on the feedback from the community. As such, we do not want people to ‘go live’ with a commercial or large public offering as things may break when we shift things around.

      That said… we would love for people to play with what is available here and send us feedback on what works / what doesn’t work / what will work better. This will help the dataset owners in shaping their offerings to better fit your needs.

  3. Caden says:

    Hey,

    Im a student doing a school project. And Im having alot of difficulty with Nimbus. Is there any open-source codes or tutorials available for my study?

    Rgds,
    Caden

  4. nypstud says:

    Hi, just want to know if you have the full list of the ERP zone? Because it’s quite confusing by jus looking at the zone ID.

  5. bryan says:

    will the bus/mrt route be available anytime soon?

    • projectnimbus says:

      Hi Bryan,

      We are currently working with other providers as LTA dataset does not cover Bus and MRT route data.

  6. Pingback: Musings Words 2.0

  7. finalaeon says:

    The LTA seems to be quite static and stale, will it be updated or else it’ll not be too useful.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s