<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Messages posted by "barryhunter"]]></title>
		<link>http://forum.geonames.org/gforum/posts/listByUser/75.page</link>
		<description><![CDATA[Messages posted by "barryhunter"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>Re:country = 'UK' not returning anything.</title>
				<description><![CDATA[ The 'country code' for the UK, is actually GB

select * from geoname where country = 'GB' order by random() LIMIT 1 


Possibly confusion when the standard was devised, GB is short for Great Britain which is often confused with United Kingdom. When defining country top level domains, undid this mistake and switched to the more understandable .uk (.gb domains are not used) 
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/20287/29316.page#29316</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/20287/29316.page#29316</link>
				<pubDate><![CDATA[Sun, 1 Nov 2015 14:00:41]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Trying to lookup cities by country, but country is among results</title>
				<description><![CDATA[ Can post filter by fcode, 
http://www.geonames.org/export/codes.html
to remove ones you not interested in. 

Or could perhaps use the cities paramater, to limit to top cities. 
http://www.geonames.org/export/geonames-search.html

Or even the featureCode paramater, and then list the types of feature codes you do want. Probably the PPL* ones. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/11088/19768.page#19768</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/11088/19768.page#19768</link>
				<pubDate><![CDATA[Wed, 24 Sep 2014 09:39:32]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:NGA GEOnet Names ID's in GeoNames?</title>
				<description><![CDATA[ Another bump for this. None of the above links work any more. :(

I have an old gazetteer imported from NGA GEOnet. I would like to convert it to geonames.org. It still has the UFI&UNI ids stored, so would great to be able to use that for the conversion. (rather than having do some sort of imperfect fuzzy matching) ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/887/11992.page#11992</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/887/11992.page#11992</link>
				<pubDate><![CDATA[Sat, 3 Nov 2012 08:20:43]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Extract "geonames" from text</title>
				<description><![CDATA[ http://developer.yahoo.com/geo/placemaker/

http://developers.metacarta.com/product/metacarta-geotagger/

http://www.geonames.org/rss-to-georss-converter.html


Otherwise grow your own. Can get a fairly basic, but working, implementation, by loading geonames placenames into a full-text search index (eg sphinxsearch.com). And querying against it. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/2093/8476.page#8476</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/2093/8476.page#8476</link>
				<pubDate><![CDATA[Mon, 27 Sep 2010 17:58:52]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Sorting geocoded place name results in own server?</title>
				<description><![CDATA[ At the most basic level, I think it just sorts by population descending. 

Ie at the lack of any other distinguishing features returns the biggest one first. 

But can also combine in sort by the featurecode. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/2046/8302.page#8302</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/2046/8302.page#8302</link>
				<pubDate><![CDATA[Wed, 25 Aug 2010 13:38:55]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Search with LIKE --&amp;gt; very very slow</title>
				<description><![CDATA[ You should look at Full-text search indexes. I have no idea if oracle offer such a thing - but would be very surprised if they dont. 


If not look at something like sphinxsearch.com - works great with geonames data. Shouldnt be too difficult to hook up to a oracal database, either using odbc, 
http://sphinxsearch.com/docs/current.html#conf-odbc-dsn
or xmlpipe

]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/1692/6969.page#6969</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/1692/6969.page#6969</link>
				<pubDate><![CDATA[Wed, 13 Jan 2010 13:31:24]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Is geonames webservice is currently broken</title>
				<description><![CDATA[ Btw see these threads

http://groups.google.com/group/geonames/browse_thread/thread/b8e0917b13240264?hl=en

http://groups.google.com/group/geonames/browse_thread/thread/775e8b6c518b8bcb?hl=en
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/1230/5267.page#5267</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/1230/5267.page#5267</link>
				<pubDate><![CDATA[Fri, 23 Jan 2009 03:15:38]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Is geonames webservice is currently broken</title>
				<description><![CDATA[ Because of a problem with a iphone application apparently causing issues, the webservices have been moved temporally to ws5.geonames.org

http://ws5.geonames.org/neighbourhood?lat=40.78343&lng=-73.96625


BUT its very suspicious that ws.geonames.org redirects to the the iPhone apps webpage!

The only reason I can think is its a retaliatory effort, to send all the traffic that is currently hitting geonames servers and instead overwelm imob's webservers. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/1230/5266.page#5266</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/1230/5266.page#5266</link>
				<pubDate><![CDATA[Fri, 23 Jan 2009 03:12:51]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>How to build a "Suggest" search</title>
				<description><![CDATA[ Re the note on using Sphinx, it was probably my misinformation, but you dont actully need to create that column, Sphinx can do it transarently at the indexing stage. 

what to include... I wondered this, in the end not sure can leave anything out, you just want them very low priority so they come last :)

order by ... I've done basically that in a prototype I am building, but didnt think about the population (although now think it I think geonames does that!) ... what I did was assigna  sort order (manually) to each feature code, and sort on that. (can either add it as another column, or just join with a table of feature codes) ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/748/3391.page#3391</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/748/3391.page#3391</link>
				<pubDate><![CDATA[Mon, 21 Jan 2008 22:25:39]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ Despite what I said before  :oops: , Sphinx does have inbuilt functionality to to do indexing of part words. 

Its not documented, but in the config file there is min_prefix_len
"if prefix length is positive, indexer will not only index all words,
but all the possible prefixes (ie. word beginnings) as well"

and minimum infix length
"if infix length is positive, indexer will not only index all words,
but all the possible infixes (ie. characters subsequences starting
anywhere inside the word) as well"

ok so they do exactly the same but you dont have to maintain a seperate column :)


]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3388.page#3388</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3388.page#3388</link>
				<pubDate><![CDATA[Mon, 21 Jan 2008 21:10:37]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ > Is there no way in Sphinx to search for partial words?
Nope, it doesnt actully store the words but rather CRC number hashes for each word - why it can be so quick. 

> found it it's hard to install on mac osx for a command line novice like me
dito - unfortuntly it doesnt seem to have many packages available, so has to be compiled from source. 

btw I should make clear that sphinx just one I use (and love) but there are other full text engines like Lucene which will probably install easier (but not sure if easier to use) , or you might find the inbuilt MySQL one fast enough for you. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3274.page#3274</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3274.page#3274</link>
				<pubDate><![CDATA[Tue, 8 Jan 2008 15:32:58]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ Yes that is almost certainly possible (and is almost what I do) 

I was going to post this here:
http://www.nearby.org.uk/geonames/text-service.php?query=Brussel+BE
to as I now have the sphinx index on a online server, so you can see how quick it is. 

As it happens I was putting the script I use for autocomplete, via sphinx. 

The trick I use, is to build a 'autocomplete' secondary index column, 

so <span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>        name=Brusselse Voorstad
        autocomplete=brusselse brussels brussel brusse bruss brus bru br b voorstad voorsta voorst voors voor voo vo v</pre>
		</div>

what this does is gives the sphinx index words to find (as it can only match whole words) 

(note however that "Bruxe" wont work on the above service yet as only built the autocompelte index for PPLs)
- its far from useable service yet

Also note by also indexing the country_code column can also just add that as a search term to restrict to that country. (this can be done transparently in your code) 

"<i>If my user enters "Bruxe..." he shouldn't see "Brussels" in the list below, and he also shouldn't see the full comma-separated list of alternames but only the altername he's probably going to be entering: "Bruxelles".</i>"

This is case I hadnt considered, but it can be easily rectified with a bit of post processing (in php etc), where you detect the query doesnt match the name field, and just select the apprirate one from ther alternames and show that instead (as though it was the main name) ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3272.page#3272</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3272.page#3272</link>
				<pubDate><![CDATA[Tue, 8 Jan 2008 14:07:03]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ I managed to create two seperate indexes

  PRIMARY KEY  (`geonameid`),
  KEY `country_code` (`country_code`,`feature_code`),
  KEY `name_2` (`name`),
  KEY `alternames` (`alternames`),
  FULLTEXT KEY `name` (`name`,`alternames`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 |


(the one on alternames took over 1 hour and 30 minutes - even the Full text index only took 15 minutes) 

But 
<span class="genmed"><b>Code:</b></span><br>
		<div style="overflow: auto; width: 100%;">
		<pre>
mysql&gt; explain SELECT * FROM `geonames` use key &#40;`alternames`&#41; WHERE `alternames` LIKE '%tenterden%' ;
+----+-------------+----------+------+---------------+------+---------+------+---------+-------------+
| id | select_type | table    | type | possible_keys | key  | key_len | ref  | rows    | Extra       |
+----+-------------+----------+------+---------------+------+---------+------+---------+-------------+
|  1 | SIMPLE      | geonames | ALL  | NULL          | NULL | NULL    | NULL | 6605140 | Using where |
+----+-------------+----------+------+---------------+------+---------+------+---------+-------------+
1 row in set &#40;0.00 sec&#41;

mysql&gt; explain SELECT * FROM `geonames` use key &#40;`alternames`&#41; WHERE `alternames` LIKE 'tenterden%' ;
+----+-------------+----------+-------+---------------+------------+---------+------+------+-------------+
| id | select_type | table    | type  | possible_keys | key        | key_len | ref  | rows | Extra       |
+----+-------------+----------+-------+---------------+------------+---------+------+------+-------------+
|  1 | SIMPLE      | geonames | range | alternames    | alternames | 602     | NULL |    1 | Using where |
+----+-------------+----------+-------+---------------+------------+---------+------+------+-------------+
1 row in set &#40;0.05 sec&#41;
</pre>
		</div>
so it seems the altername index is useless. So a union still takes (19.07 sec) as the alternames half still takes forever.  ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3270.page#3270</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3270.page#3270</link>
				<pubDate><![CDATA[Tue, 8 Jan 2008 12:43:50]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ Some benchmarks, (for some reason couldnt get a standard index to work so missed that test out) 

These tests are all on the same machine, its only one time shown, but did each test a number of times and the numbers in same ballpark. This is on a table with the global geonames database loaded. 

================================================

No Index
--------

SELECT *
FROM `geonames`
WHERE `name` = 'tenterden'
OR `alternames` LIKE '%tenterden%';

Showing rows 0 - 2 (3 total, Query took 17.9760 sec)

================================================

ADD INDEX `name` ( `name` , `alternames` );

MySQL said: #1071 - Specified key was too long; max key length is 1000 bytes

No idea why that wont work... so no test with index...

================================================

Full Text Index
--------

SQL query: SELECT *
FROM `geonames`
WHERE MATCH (
name, alternames
)
AGAINST (
'tenterden'
);

Showing rows 0 - 3 (4 total, Query took 0.1028 sec)

================================================

Sphinx
--------

 time search --index geonames tenterden
Sphinx 0.9.7
index 'geonames': query 'tenterden ': returned 4 matches of 4 total in 0.000 sec

<SNIP RESULTS>

words:
1. 'tenterden': 4 documents, 7 hits


real    0m0.076s
user    0m0.000s
sys     0m0.056s

(the difference in time between that reported by sphinx search and the overall, is because the overall includes having to lookup the details in the mysql - as sphinx only returns ID. 

(doing it as 4 seperate mysql queries takes 0.0102 sec, but in a real application would do in (id1,id2) etc which took 0.0003 sec)

So overall in a realworld application coould expect 0.001 seconds :)

================================================
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3265.page#3265</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3265.page#3265</link>
				<pubDate><![CDATA[Tue, 8 Jan 2008 00:30:21]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ > But isn't a full text search much slower than using LIKE?

Not usually, mostly Full Text is quicker, espically when checking multiple columns. (mysql doesnt optimise OR queries very well in my experience) 

 A single column, with a normal index, should be quicker with LIKE, esp if LIKE 'bla%' as it can optimise the use of the index. 

But using a dedicated engine like sphinx will be MUCH MUCH MUCH quicker then either Like, or even plain =, even on single columns. 

Edited to add: the disanvantage of full text is updates are slower, (esp with a seperate engine :)), but with something like a gazetteer that rarely changes not such an issue.
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3257.page#3257</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3257.page#3257</link>
				<pubDate><![CDATA[Mon, 7 Jan 2008 21:04:57]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Best/fastest way to search geonames table (mysql query)</title>
				<description><![CDATA[ Personally I would recommend using a Full Text Search. 

Mysql has full text functionality built in, which should work. 
http://dev.mysql.com/doc/en/Fulltext_Search.html
(you can create a index on multiple columns, so the name and alternate name can be in one index) 

However I would also recommend, 
http://www.sphinxsearch.com/
which is a very nice full text engine, in other projects found it _much_ quicker as well as returning more relevent results thatn the built in mysql one. (I've never tried it on the geonames gazetteer, but have on others) 

Its not trivial to setup, and comes with some overhead, but I would say the effort is worth it. 

(I beleive that geonames use the Lucene fulltext engine, which evidently works too!) 
]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/722/3255.page#3255</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/722/3255.page#3255</link>
				<pubDate><![CDATA[Mon, 7 Jan 2008 19:38:26]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:rss to georss recognizes coordinates?</title>
				<description><![CDATA[ Do you have the option to add tags?

If so could use the following tags:

geo:lat=51.4989 
geo:lon=-0.1786

that are fairly standard, and no reason geonames cant easily parse that. ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/509/2403.page#2403</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/509/2403.page#2403</link>
				<pubDate><![CDATA[Mon, 16 Jul 2007 14:56:23]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:rss to georss recognizes coordinates?</title>
				<description><![CDATA[ One thing that strikes me here is this is what Microformats should be for

http://microformats.org/wiki/geo

... so encourage the blog creator to use microformats to tag the locations, (if they not already using GeoRSS - which this tool does maintain :) - and then geonames only has to support parseing out a microformat. 

more...
http://highearthorbit.com/a-proposal-georss-kml/
(unifing the various standards)

... alas I dont have any feeds to test this on :(


... although the geonames rss parser does have a 'place in the market' for taking arbitrtay text and marking it up to standarsd (eg surrounding identified coordinates with the microformat for other services to consume)

(Marc I'll forward you some regexp's I have for identifing arbiray coordinates in free text, that I have used in a prototype geographic search engine - alas before it was recently patented :) ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/509/2400.page#2400</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/509/2400.page#2400</link>
				<pubDate><![CDATA[Mon, 16 Jul 2007 14:02:20]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Re:Database Dump Postals</title>
				<description><![CDATA[ Have you seen the postcodes forum:
http://forum.geonames.org/gforum/forums/show/7.page]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/381/1921.page#1921</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/381/1921.page#1921</link>
				<pubDate><![CDATA[Thu, 19 Apr 2007 21:49:50]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
			<item>
				<title>Map and Mybrid layers in Google Map?</title>
				<description><![CDATA[ Great information!

It's true for geonames, which is primarilly a gazetteer, that its not really a direct copy of the map data (which is a special case of a database hence under Database Right), as you say the data will not exactly match and is subject to artistic interpretation. 

The two angles that I am taking from this I guess would be taking a more direct 'copy' of the map, the openstreetmap project would be taking a copy of the map data itself. And in the case of geograph, we are picking features at a high resolution, that for example would be exactly matching the underlying data- to eventually be able to recreate a sizeable portion of the map data (ie capture, road junctions, roads, canals, churchs,  basically all map features.)  ]]></description>
				<guid isPermaLink="true">http://forum.geonames.org/gforum/posts/preList/262/1501.page#1501</guid>
				<link>http://forum.geonames.org/gforum/posts/preList/262/1501.page#1501</link>
				<pubDate><![CDATA[Sat, 27 Jan 2007 14:28:24]]> GMT</pubDate>
				<author><![CDATA[ barryhunter]]></author>
			</item>
	</channel>
</rss>