Parcel Tracker

From fmepedia


Table of contents



Scenario

I've just bought a new computer, and it is (at the time of writing) in transit with UPS.
But instead of tracking progress by visiting the UPS website every day (more like every ten minutes), I thought why not use FME?

The advantage of using FME is that I can scrape location information from the UPS web site, geocode it, and write it out to KML for viewing in Google Earth.


This workspace accepts one or more UPS tracking numbers as input, submits them to the UPS web site, geocodes the returned information via a Yahoo web service and writes the results to KML.

Taking the process one step further I could even upload the workspace to FME Server, register it as a KML Network Link, and have my Google Earth view automatically update every hour. At least it would prevent me pressing the refresh button every ten minutes!



Workspace

The workspace really is quite simple.



Above: The workspace

1: A tracking number is read. This can come from a user input parameter, or as a list of tracking numbers in a text file.
2: The tracking number is concatenated onto a base URL, and the URL processed. The content of the web page is returned as an attribute.
3: The web page is examined and the last known location is extracted (using StringSearchers), along with the last action (arrived/departed) plus the date and time.
4: The location information is sent to a Yahoo web service for geocoding - this custom transformer already has its own page on fmepedia.
5: The feature(s) is styled before sending to the destination KML file



Output

Here's a comparison of two different views of the data:



Above: The view of the parcel on the UPS web site



Above: My FME-ized view of the parcel in Google Earth. My computer might still be far away, but at least I know where Concord, ON is now!

Attached Files
filesizedate
UPSPackageTracker.zip1.0 MB02/05/09
ups2.png6.4 kB02/05/09
ups3.png1019.9 kB02/05/09
upsWorkspace.png26.9 kB02/05/09
User Comments Add a new comment