Calculating driving distance between two places

Slides:



Advertisements
Similar presentations
PhUSE 2011: Brighton TS09 Rectifying Irregular Text Data a Case for Using Regular Expressions in SAS Jayshree Garade Manjusha Gode.
Advertisements

Come out of the desert of ignorance to the OASUS of knowledge Scraping the Web with SAS Tom Kari Tom Kari Consulting OASUS, June
Find It Using SAS By David Steves. Would you like to be able to search SAS programs for certain expressions? Example: I have a list of SAS programs which.
Copyright © 2009, SAS Institute Inc. All rights reserved. Neat Code from Rick Rick Langston, SAS Institute Inc.
When “ANYDATE” Doesn’t Mean Any Date: A Macro Solution Charlotte King, Alberta Health Services John Fleming, Alberta Health Services SAS Global Forum Paper.
2-1. Today’s Lecture Review Chapter 4 Go over exercises.
Contest format 5 hours, around 8-12 problems One computer running (likely)Linux, plus printer 3 people on one machine No cell phones, calculators, USB.
An Introduction to XML Based on the W3C XML Recommendations.
Using SAS to Obtain Tornado GIS Data from the National Weather Center Valentin Todorov Statistician Assurant Specialty Property.
Boosting XML filtering through a scalable FPGA-based architecture A. Mitra, M. Vieira, P. Bakalov, V. Tsotras, W. Najjar.
Web 2.0 for AtGentive A Brief Introduction to Web 2.0 Ye DENG
Trials and Tribulations of creating DDI Codebooks at the University of Guelph A.Michelle Edwards and Carol Perry, Data Resource Centre, University of Guelph.
Google maps and web mapping Group DP Daniel Stålnacke and Peter Winnberg.
1 Electrical and Computer Engineering Comprehensive Design Review February 12, 2010 Team Zink Nicholas Cipriano, Ali Jameel, Jeremy Mestancik, Brian Simakauskas.
Filters using Regular Expressions grep: Searching a Pattern.
Data Cleaning 101 Ron Cody, Ed.D Robert Wood Johnson Medical School Piscataway, NJ.
More on Regular Expressions Regular Expressions More character classes \s matches any whitespace character (space, tab, newline etc) \w matches.
Scale and Distance.
Chapter 3 Interactivity and Expressions CSC 125 Introduction to C++ programming.
Stacking Rich Text Format (RTF) - %SRiT Duong Tran – Independent Contractor, London, UK Stacking Rich Text Format (RTF) - %SRiT Duong Tran – Independent.
1 Perl Regular Expressions in SAS 9 Ruth Yuee Zhang, CFE Jan 10, 2005.
Prepared by: Luigi Muro – Consultant
Speed, Distance, Time Calculations. You Need: Colored PencilsScience Notebook Science Folder Everything else goes into the back. Start a new page in your.
WWW Forms and Search. Forms URL - always fetch a particular page What if the information we want varies from time to time and from user to user?
SAS Macro: Some Tips for Debugging Stat St. Paul’s Hospital April 2, 2007.
ENCLOUT Bring API to People. API Ecosystem Gap  Business Analysts  Good with spreadsheets  Limiting scripting or SQL skills  API Developers  Knowledge.
CIS 451: Regular Expressions Dr. Ralph D. Westfall January, 2009.
1 Back Up with Each Submit One approach for keeping a dynamic back up copy of your current work.
CIS 451: XML DTDs Dr. Ralph D. Westfall February, 2009.
Regular Expressions CSC207 – Software Design. Motivation Handling white space –A program ought to be able to treat any number of white space characters.
Developing QueryContent for IBIS-PH. Let’s check a few things. 1.Do you have a “Q:\” drive mapped to the backend ibis-q server?
Post-Module JavaScript BTM 395: Internet Programming.
Macro Variable Resolution Enio Presutto York University, Toronto, Canada.
Steven Carvellas Anirban Ghosh Pramod Vedantham Rahul Sheth Varun Sarwade.
BMTRY 789 Lecture 10: SAS MACRO Facility Annie N. Simpson, MSc.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Pipeline Introduction Sequential steps of –Plugin calls –Script calls –Cluster jobs Purpose –Codifies the process of creating the data set –Reduces human.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Data Collection and Web Crawling. Overview Data intensive applications are likely to powered by some databases. How do you get the data in your database?
Windows 7 WampServer 2.1 MySQL PHP 5.3 Script Apache Server User Record or Select Media Upload to Internet Return URL Forward URL Create.
RIA Geo Location. Finding Location modern devices can get location coordinates phones and tablets can use GPS desktops and laptops –often cannot use GPS.
URL’s Anatomy 1.02 Understand how to validate, authenticate, and legally use information from the Internet.
MAP SCALE. A map shows features of the earth’s surface. To be accurate, all distances related to these features must be true to reality. However, to be.
An Introduction to Regular Expressions Specifying a Pattern that a String must meet.
Microsoft® Small Basic Flickr, ImageList, and Network Objects Estimated time to complete this lesson: 1 hour.
Google Map API The Google Maps API lets you embed Google Maps in your own web pages with JavaScript The API provides a number of utilities for manipulating.
Finding places Chapter 2, Book 5B Primary Longman Express.
Thematic Mapping with Google Maps. "US-KS":{code:"US-KS", name:"Kansas", center:{lat: ,lng: },
Dictionaries and File I/O George Mason University.
Code Search and Idiomatic Snippet Synthesis Mukund Raghothaman University of Pennsylvania (Joint work with Yi Wei and Youssef Hamadi)
NAACCR 2006 Conference NAACCR SHOWCASE Great Circle Distance Calculator Chris Johnson NAACCR GIS Committee Cancer Data Registry of Idaho.
Using the Macro Facility to Create HTML, XML and RTF output Rick Langston, SAS Institute Inc.
Hints and Tips SAUSAG Q SORTING – NOUNIQUEKEY The NOUNIQUEKEY option on PROC SORT is a useful way in 9.3 to easily retain only those records with.
Distribution A: Approved for public release; distribution is unlimited. Case Number: 88ABW , 4 Sep 2014 Learning SAS’s Perl Regular Expression.
Perl Regular Expression in SAS
+ SAS/R Reporting REDCapCon New York City August 14-17, 2017.
YQL Kevin Murphy CMPS 183.
A Question of Maths Instructions: Choose a number to answer a question
Speed Distance Time. Intermediate 1. Unit 2..

Make Your Code File Driven Methods to let SAS collect file names in your system Lu Zhang Beijing, China 1.
SESUG Web Scraping in SAS: A Macro-Based Approach
LING 408/508: Computational Techniques for Linguists
Lesson 11: Web Services and API's
Matcher functions boolean find() Attempts to find the next subsequence of the input sequence that matches the pattern. boolean lookingAt() Attempts to.
Lesson 1 LT: I can use mole ratios to calculate the quantity of one substance in a reaction given the quantity of another substance.
Calculating speed.
Automate & Zip files Using MACRO
Murach's JavaScript and jQuery (3rd Ed.)
Speed Distance Time. Intermediate 1. Unit 2..
Presentation transcript:

Calculating driving distance between two places Google Maps API Calculating driving distance between two places

Google Distance Matrix API https://developers.google.com/maps/documentation/distancematrix/

Google Maps Directions

Google Distance Matrix API http://maps.googleapis.com/maps/api/distancematrix/xml ?origins=Halifax+NS&destinations=Sydney+NS&mode=driving&sensor=false

API returns XML … How to get values into SAS? <DistanceMatrixResponse> <status>OK</status> <origin_address>Halifax, NS, Canada</origin_address> <destination_address>Truro, NS Canada</destination_address> <row> <element> <duration> <value>4167</value> <text>1 hour 9 mins</text> </duration> <distance> <value>94230</value> /* metres */ <text>94.2 km</text> </distance> </element> </row> </DistanceMatrixResponse>

Ingredients filename url “http:// …” infile recfm=s /* read as stream */ Regular expressions to process XML prxparse prxmatch prxposn

%macro gmapsdist (ORIG, DEST); %let URL = str(http://maps. googleapis %macro gmapsdist (ORIG, DEST); %let URL = str(http://maps.googleapis.com/maps/api/distancematrix/xml ?origins=)&ORIG. %nrstr(&destinations=)&DEST. %nrstr(&mode=driving&sensor=false); filename gmaps url "&URL"; data _null_; /* Regular expression pattern to match XML tags and pull out distance value */ regex = prxparse("/\<distance>\s*\<value>(\d+)\<\/value>/"); infile gmaps recfm=s lrecl=32767; input; if prxmatch(regex, _infile_) then distance = prxposn(regex, 1, _infile_); put distance; run; %mend gmapsdist;

Resources Driving Distances and Times, Using SAS® and Google Maps, Mike Zdeb University at Albany, School of Public Health Paper 043-29 An Introduction to Regular Expressions with Examples from Clinical Data, Richard Pless, Ovation Research Group, Highland Park, IL Paper 119-29 Reading and Writing XML files from SAS®, Miriam Cisternas, Ovation Research Group, Carlsbad, CA Ricardo Cisternas, MGC Data Services, Carlsbad, CA Paper 121-2012,Accessing and Extracting Data from the Internet Using SASR, George Zhu, Sunita Ghosh, Alberta Health Services - Cancer Care