GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Fetching JSON data via AJAX, how to filter by population?  XML
Forum Index -> General
Author Message
mattis



Joined: 13/07/2010 18:54:18
Messages: 3
Offline

Hi!
I am trying to remove all the fcode > PPL that have population=0 (because obviously there's not three Stockholms' in Sweden (the two wrong locations have population = 0).

Here's part the code that fetches the data:

Code:
$.getJSON("http://ws.geonames.org/searchJSON?",
 			{ 'name': 'stockholm',
 			'maxRows': 10,
 			'fcode': 'PPL*',
 			'population': '0',
 			'type': 'json'},


As you see, I am messing around with the population variable. Can it be sent to the geonames service?

Thank you in advance.
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

The search service does not support a parameter 'population'.

Why shouldn't there not be three places called 'Stockholm' in Sweden? If the population of a place is unknown then it just means that it is probably a small place it does not mean the place does not exist. This wouldn't make any sense.


Marc

[WWW]
mattis



Joined: 13/07/2010 18:54:18
Messages: 3
Offline


Darned. I think you are right. I even looked into a Swedish atlas but it didn't have them. Finally I looked into the Swedish map service Eniro, and yeah, there it is and the coordinates match up pretty well.

Thank you Marc.

Do you know any way that I could filter out only the "real" cities/towns out of the database?
geotree


[Avatar]
Joined: 23/07/2007 18:28:40
Messages: 138
Location: France
Offline

mattis wrote:

Do you know any way that I could filter out only the "real" cities/towns out of the database?  


You may have a look to the dump directory :
http://download.geonames.org/export/dump/

especially those files :
- cities1000.zip : all cities with a population > 1000 (ca 80.000)
- cities5000.zip : all cities with a population > 5000 (ca 40.000)
- cities15000.zip : all cities with a population > 15000 (ca 20.000)

You may also use search webservice, then filter result to keep only places with population > n

Christophe
geotree.geonames.org
geotree.geonames.org/geotree.html
[WWW]
mattis



Joined: 13/07/2010 18:54:18
Messages: 3
Offline

geotree wrote:

mattis wrote:

Do you know any way that I could filter out only the "real" cities/towns out of the database?  


You may have a look to the dump directory :
http://download.geonames.org/export/dump/

especially those files :
- cities1000.zip : all cities with a population > 1000 (ca 80.000)
- cities5000.zip : all cities with a population > 5000 (ca 40.000)
- cities15000.zip : all cities with a population > 15000 (ca 20.000)

You may also use search webservice, then filter result to keep only places with population > n 


Yep, I am filtering it on my end of the transaction now. I just wanted to minimize the traffic.

Thank you guys!
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team