Lasso Soft Inc. > Home


AuthorJason Huck
LicensePublic Domain
Posted08 Feb 2006
Updated21 Feb 2006
More by this author...


This is a quick'n'dirty tag to retrieve coordinate data using the free service at Per their terms of service, it is free for non-commercial use. Returns a map containing the components of the street address along with longitude and latitude. Returns null if the address could not be found. Only works with US addresses.

Sample Usage

var('address') = '1815 Griffin Road, Dania Beach, FL  33004';
var('coordinates') = tsp_geocode($address);

	'Latitude: ' + $coordinates->find('latitude') + '
\n'; 'Longitude: ' + $coordinates->find('longitude') + '
\n'; 'Street: ' + $coordinates->find('street') + '
\n'; 'City: ' + $coordinates->find('city') + '
\n'; 'State: ' + $coordinates->find('state') + '
\n'; 'Zip: ' + $coordinates->find('zip') + '
\n'; /if;

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

	-description='Looks up the given address at'
	local('url' = '');
	local('getparams') = array(
		'address' = #address
	local('response') = include_url(
	#response >> 'sorry' ? return;
	local('out' = map);
	local('fields') = array(
	iterate(#response->split(','), local('i'));
		#out->insert(#fields->get(loop_count) = (loop_count < 3 ? decimal(#i) | #i));

Related Tags


14 Jun 2006, Israel Thompson

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! :)



Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft