Geocoding, REXML and the Missing Method
The first step is to find (and URL encode) an address. For this demonstration, we will be using "Mission & Valencia Sts, San Francisco CA" as the address. You will see the following XML document if you point a browser at http://rpc.geocoder.us/service/rest?address=Mission+%26+Valencia+Sts%2C+San+Francisco+CA:
1
2
3
4
5
6
7
| |
This is technically an RDF document. It can still be parsed as a regular XML document though. Let's define a Location class:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| |
From there, you can create a Location object and get the coordinates:
1
2
3
| |
From there, you can use the location in a mapping application (such as a Google Maps mashup for example...)
