That’s how I take my coffee 🙂 You may have heard of Tim Hortons — a mecca for coffee shops in Canada. Many of us are lost without it during our morning commute. Even though they are seemingly everywhere, there are times when you just can’t find one.
A friend of mine pointed me to a forum working on collecting locations of all Tim Hortons locations in Canada and the US. Wouldn’t it be great to upload these to a GPS which supports GPX format? Or to visualize in Google Earth, for example?
- Download http://www.gpspassion.com/upload/team/Dewi_TimHortons_xls_20071120.zip th.zip
- Save as CSV (there is a CSV online, but the XLS has more detailed description of each location)
- Use OGR’s Virtual Datasource support to read the CSV. Here’s the OVF definition:
<OGRVRTDataSource> <OGRVRTLayer name="th"> <SrcDataSource relativeToVRT="1">./th.csv</SrcDataSource> <GeometryType>wkbPoint</GeometryType> <LayerSRS>WGS84</LayerSRS> <GeometryField encoding="PointFromColumns" x="Longitude" y="Latitude"/> </OGRVRTLayer> </OGRVRTDataSource>
Transform to your heart’s content:
$ ogr2ogr -f KML ./th.kml ./th.ovf
$ ogr2ogr -dsco “GPX_USE_EXTENSIONS=YES” -f GPX ./th.gpx ./th.ovf
I’ve bundled up a zipfile of various formats for use as an example — have fun!