
430
|
Chapter 7, Names and Places
#86 Track a Package Across the U.S.
HACK
Running the Hack
Compile the Java file like this.
% javac org/rajsingh/maphacks /GNISCoords.java
Now you can run the program.
—Raj Singh
HACK
#86
Track a Package Across the U.S. Hack #86
Use free data sources to map your package’s progress across the U.S.
Being able to see where a package is on its way to your door was developed
as a business process-management tool. But it has turned out to be really
popular with customers, too. What if you could take the next step, not only
seeing a list of towns your new cell phone is visiting, but seeing them on a
map! This hack presents one way of doing this.
Preparation
If you didn’t do “Java-Based Desktop Mapping with Openmap” [Hack #66],
take a quick look at it, because Openmap will be used to map our package
shipment stops. In essence, you need to install a Version 1.4 or later Java
Development Kit and Openmap 4.6. Make sure to copy the file openmap.
properties from the program’s installation directory into your home direc-
tory. After Java and Openmap are set up, you need to make a small modifi-
cation to the openmap.properties file. Open openmap.properties in a text
editor. Search for
openmap.layers=. The second occurrence should look
something like this:
openmap.layers=date dtlayer distlayer quake daynight cities test graticule
demo shapePolitical
We will be creating a new layer that we