<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "Airport autocomplete advice"]]></title>
		<link>http://forum.geonames.org/gforum/posts/list/4.page</link>
		<description><![CDATA[Latest messages posted in the topic "Airport autocomplete advice"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Airport autocomplete advice</title>
				<description><![CDATA[ I have been searching through the forums and haven't been able to find anything that has helped me with my dilema.

I am attempting to make an autocomplete menu for city names/airport codes that duplicated the functionality of the autocomplete on this form  <a href='http://laosparadisetravel.turbott.com/IndexVT.aspx' target='_new' rel="nofollow">http://laosparadisetravel.turbott.com/IndexVT.aspx</a>  I am using the jQeury UI autocomplete widget and started with a duplicate of their query of geonames.  The test page I am working on is at <a href='http://laosparadisetravel.com/test/test4.php' target='_new' rel="nofollow">http://laosparadisetravel.com/test/test4.php</a> and the code is:

<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
$&#40;function&#40;&#41; {
		$&#40; "#gsorigin" &#41;.autocomplete&#40;{
			source: function&#40; request, response &#41; {
				$.ajax&#40;{
					url: "http://ws.geonames.org/searchJSON",
					dataType: "jsonp",
					data: {
						featureClass: "P",
						//fcode: "AIRP",
						style: "full",
						maxRows: 12,
						name_startsWith: request.term
					},
					success: function&#40; data &#41; {
						response&#40; $.map&#40; data.geonames, function&#40; item &#41; {
							return {
								label: item.name + &#40;item.alternateName ? ", " + item.alternateName : ""&#41; + ", " + item.countryName,
								value: item.name
							}
						}&#41;&#41;;
					}
				}&#41;;
			},
			minLength: 2,
			open: function&#40;&#41; {
				$&#40; this &#41;.removeClass&#40; "ui-corner-all" &#41;.addClass&#40; "ui-corner-top" &#41;;
			},
			close: function&#40;&#41; {
				$&#40; this &#41;.removeClass&#40; "ui-corner-top" &#41;.addClass&#40; "ui-corner-all" &#41;;
			}
		}&#41;;
	}&#41;;
</pre>
		</div>

If I use featureClass P the results are way to broad, including non-airport related locations.  If I use use S and fcode AIRP I don't get city names.  I know I don't know the full structure of the geonames data so I expect I am missing data somewhere.  Any suggestions on how to get both city names AND airport codes?

Also, I understand from reading the forum that the free web service is strained.  An autocomplete ajax function is going to call the web service several times per form submission so I expect it would be best if I just downloaded the data and ran it off our servers.  Is there a way to just download the relevant city/airport data without having to get the whole geonames db?]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/list/2152.page#8721</guid>
				<link>http://forum.geonames.org/gforum/posts/list/2152.page#8721</link>
				<pubDate><![CDATA[Mon, 8 Nov 2010 20:36:55]]> GMT</pubDate>
				<author><![CDATA[ Robert Heist]]></author>
			</item>
	</channel>
</rss>