I tried two examples in the Traffic Volume Counts API, but neither of them worked.
SELECT FROM road_traffic_counts_station_reference ORDER BY station_id LIMIT 50
SELECT FROM road_traffic_counts_hourly_permanent LIMIT 10
please use the following.
SELECT * FROM road_traffic_counts_station_reference ORDER BY station_id LIMIT 50
SELECT * FROM road_traffic_counts_hourly_permanent LIMIT 10
Basically what I did was to copy the query text from the manual and to paste into q value in the API web page.
Example 1:
I made the query simpler, but it did not work.
SELECT * FROM road_traffic_counts_hourly_permanent LEFT JOIN road_traffic_counts_station_reference ON road_traffic_counts_station_reference.station_key = road_traffic_counts_hourly_permanent.station_key WHERE station_id='SHB' AND year = '2016' AND public_holiday is true AND day_of_week BETWEEN 1 AND 5 AND classification_seq = 2 and month in (1,2,3) AND cardinal_direction_seq = 5 ORDER BY date
Example 2:
It ran but the result is empty.
SELECT * FROM road_traffic_counts_station_reference WHERE ST_DWithin(the_geom, ST_MakePoint(150.999919,-33.816228)::geography,10000)
Example 3.
I made the query simpler, but it did not work.
SELECT * FROM road_traffic_counts_station_reference REF JOIN road_traffic_counts_yearly_summary SUMM ON REF.STATION_KEY = SUMM.STATION_KEY WHERE SUBURB = 'Parramatta' AND PERIOD = 'PM PEAK' AND TRAFFIC_DIRECTION_SEQ IN ('1','2')
Example 4
I made the query simpler, but it did not work.
SELECT * FROM (SELECT PERM.DATE, REF.STATION_ID, PERM.TRAFFIC_DIRECTION_SEQ,(HOUR_07%2bHOUR_08) AS AM_VOL
FROM road_traffic_counts_station_reference REF JOIN road_traffic_counts_hourly_permanent PERM ON PERM.STATION_KEY = REF.STATION_KEY
WHERE public_holiday is false
AND SCHOOL_HOLIDAY = '0'
AND DAY_OF_WEEK BETWEEN 1 AND 5 AND YEAR = '2016'
AND MONTH = 5) AMV
GROUP BY STATION_ID,TRAFFIC_DIRECTION_SEQ
ORDER BY STATION_ID, TRAFFIC_DIRECTION_SEQ
Example 4: Changed format to json. Do note that you have to change the %2b to + when you are using our swagger in the API page. I will change the documentation to reflect that.
Hi,
I have structured the requests exactly as listed out in the example given, but continue to get an ‘error in request data’ error.
Could you let me know how to fix this?
Regards,