BayAreaMetro / caltrans-typical-weekday-counts

Processing of traffic counts provided by the California Department of Transportation
1 stars 0 forks source link

put x/y values on the typical-weekday-counts csv output--preferably with deduplicated locations #1

Closed tbuckl closed 7 years ago

tbuckl commented 7 years ago

using the linear reference system in the output file, output a similar version with x/y or with a simple lookup to x/y.

for reference, this is a chunk of the output file as output by this script

"route" "county" "post_mile" "leg" "direction" "station" "description" "year" "integer_hour" "median_count" "avg_count" "sd_count" "days_observed"
"001" "SON" 0.19 "B" "S" 1 "VALLEY FORD ROAD" "2012" 20 0 0 0 47
"001" "SON" 0.19 "B" "S" 1 "VALLEY FORD ROAD" "2012" 21 0 0 0 47
"001" "SON" 0.19 "B" "S" 1 "VALLEY FORD ROAD" "2012" 22 0 0 0 47
"001" "SON" 0.19 "B" "S" 1 "VALLEY FORD ROAD" "2012" 23 0 0 0 47
"004" "CC" 20.102 "A" "E" 416 "BAILEY ROAD" "2012" 0 1515.5 1481.4 293.820460754344 20
"004" "CC" 20.102 "A" "E" 416 "BAILEY ROAD" "2012" 1 890.5 885.35 94.3840279752994 20
"004" "CC" 20.102 "A" "E" 416 "BAILEY ROAD" "2012" 2 527.5 518.4 48.1766486348336 20
"004" "CC" 20.102 "A" "E" 416 "BAILEY ROAD" "2012" 3 366.5 373.05 34.5900426803954 20
tbuckl commented 7 years ago

an example tool that does this for single values: https://postmile.dot.ca.gov/PMQT/PostmileQueryTool.html?

tbuckl commented 7 years ago

this is what a request that service looks like:

curl 'https://postmile.dot.ca.gov/PMQT/proxy.php'    
-H 'Origin: https://postmile.dot.ca.gov'    
-H 'Accept-Encoding: gzip, deflate, br'    
-H 'Accept-Language: en-US,en;q=0.8'    
-H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)    Chrome/57.0.2987.98 Safari/537.36'    
-H 'Content-Type: text/xml'    
-H 'Accept: */*'    
-H 'Referer: https://postmile.dot.ca.gov/PMQT/PostmileQueryTool.html'    
-H 'Cookie: Mode=Point; Components=true; __utma=245789585.446899156.1490121007.1490121007.1490121007.1; __utmc=245789585; __utmz=245789585.1490121007.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); __utmt=1; __utmt_b=1; __utma=158387685.1821002306.1490056191.1490123101.1490125683.5; __utmb=158387685.6.10.1490125683; __utmc=158387685; __utmz=158387685.1490125683.5.4.utmcsr=github.com|utmccn=(referral)|utmcmd=referral|utmcct=/MetropolitanTransportationCommission/caltrans-typical-weekday-counts/issues/1'    
-H 'Connection: keep-alive'    
-H 'SOAPAction: http://dev1.dot.ca.gov//GetOdometerForPostmile'    
--data-binary '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="urn:webservice.postmile.lrs.gis.dot.ca.gov" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><q0:getOdometerForPostmileParameters><q0:alignment>R</q0:alignment><q0:postmile><q0:alignmentCode></q0:alignmentCode><q0:countyCode>CC</q0:countyCode><q0:postmilePrefixCode>R</q0:postmilePrefixCode><q0:postmileValue>20.102</q0:postmileValue><q0:routeNumber>4</q0:routeNumber><q0:routeSuffixCode></q0:routeSuffixCode></q0:postmile></q0:getOdometerForPostmileParameters></soapenv:Body></soapenv:Envelope>' 
--compressed   

response:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><getOdometerForPostmileReturn xmlns="urn:webservice.postmile.lrs.gis.dot.ca.gov"><odometer>19.909</odometer></getOdometerForPostmileReturn></soapenv:Body></soapenv:Envelope>

Awaiting word from CalTrans on whether this service can be used for our purposes.

tbuckl commented 7 years ago

this is mostly resolved here: https://github.com/MetropolitanTransportationCommission/caltrans-typical-weekday-counts/tree/get-xy

tbuckl commented 7 years ago

resolved in https://github.com/MetropolitanTransportationCommission/caltrans-typical-weekday-counts/pull/3