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
26
27
28
29
30
31
32
33
34
35
36
37
|
define_tag(
'geocode',
-namespace='tsp_',
-required='address',
-priority='replace',
-description='Looks up the given address at geocoder.us.'
);
local('url' = 'http://rpc.geocoder.us/service/csv');
local('getparams') = array(
'address' = #address
);
local('response') = include_url(
#url,
-getparams=#getparams
);
#response >> 'sorry' ? return;
local('out' = map);
local('fields') = array(
'latitude',
'longitude',
'street',
'city',
'state',
'zip'
);
iterate(#response->split(','), local('i'));
#out->insert(#fields->get(loop_count) = (loop_count < 3 ? decimal(#i) | #i));
/iterate;
return(#out);
/define_tag;
|
Thanks a bunch!
This Tag has come in really handy! I've managed to plug it into a database and retrieve the coordinates for multiple coordinates along with search for single coordinates and display a map with a marker and info window. I have a question for you Jason. Are you going to create a Tag for the new Google geocoder? If so, I can't wait! When they released the new Google geocoder I realized more of my addresses were coming back as "found" rather than "not found" which is what I was getting sometimes with the one used by your tag, so I'm really interested if you are going to make a tag for the Google one! :) Thanks, Israel