swagger: "2.0"
schemes:
  - http
host: gis.surrey.ca:8080
basePath: /fmedatastreaming/TrafficLoopCount
info:
  contact:
    email: opendata@surrey.ca
    name: City of Surrey GIS Section
    url: http://data.surrey.ca
    x-twitter: CityofSurrey
  description: This API provides locations of City of Surrey traffic loops and the corresponding traffic loop counts in 15 minute intervals. While the counts are broken up by 15 minute intervals, the data is currently loaded only once per day.  We are hoping to increase this frequency to at least once every hour. The LOOP_ID field is common to both datasets and can be used to cross-reference them.
  license:
    name: Open Government License - British Columbia
    url: http://www.data.gov.bc.ca/local/dbc/docs/license/OGL-vbc2.0.pdf
  termsOfService: http://www.data.gov.bc.ca/local/dbc/docs/license/API_Terms_of_Use.pdf
  title: City of Surrey Traffic Loop Count API.
  version: "0.1"
  x-apisguru-categories:
    - open_data
  x-logo:
    url: https://twitter.com/CityofSurrey/profile_image?size=original
  x-origin:
    - format: swagger
      url: https://raw.githubusercontent.com/cityofsurrey/traffic-loops-api/master/surrey-trafficloop.json
      version: "2.0"
  x-providerName: surrey.ca
  x-serviceName: trafficloops
produces:
  - application/json
tags:
  - name: traffic
  - name: count
  - name: induction
  - name: volume
  - name: intersection
  - name: transportation
paths:
  /TrafficLoopCounts.fmw:
    get:
      description: Provides traffic loop counts for the input time interval. The LOOP_ID and DATETIME combinations are unique in the output. The output timestamp will contain the time zone offset, either -08 (PST) or -07 (PDT) depending on whether daylight savings time was observed at the output datetime. In order to work with local time you may omit the time zone offset from the input and truncate it from the output.
      parameters:
        - description: Beginning of the required date/time range in ISO 8601. For example March 24 2016 at 1:00 PM Pacific Standard Time would be 2016-03-24T13:00:00-08.
          in: query
          name: startdatetime
          type: number
        - description: End of the required date/time range. For details see the startdatetime parameter.
          in: query
          name: enddatetime
          type: number
      responses:
        "200":
          description: City of Surrey Traffic Loop Counts
      tags:
        - counts
  /TrafficLoops.fmw:
    get:
      description: Provides all the traffic loops maintained by the City of Surrey in GeoJSON format. LANE_DIRECTION indicates the heading of the traffic (NB, SB, EB, WB). INTERSECTION_ID corresponds to the INTID field in the intersections dataset which can be found on the Surrey Open Data site. ROAD_FACILITYID indicates which road segment the loop is located on.  This corresponds to the FACILITYID in the Road Centrelines dataset on the City of Surrey Open Data site.
      parameters:
        - description: The output projection EPSG code.  Eg. WGS84 is 4326 and NAD 83 UTM Zone 10 is 26910.  If this is left blank, the default is 4326.  For more on EPSG codes please see http://spatialreference.org/
          in: query
          name: proj_epsg
          type: number
      responses:
        "200":
          description: City of Surrey Traffic Loops
      tags:
        - loops
