GeoNames Home
|
Postal Codes
|
Download / Webservice
|
About
GeoNames Forum
Search
Recent Topics
Back to home page
Register
/
Login
Largest 10 cities algorithm
Forum Index
->
General
Author
Message
10/09/2008 22:20:57
Subject:
Largest 10 cities algorithm
Kpoxman
Joined: 10/09/2008 22:00:48
Messages: 2
Offline
Hello,
When browsing largest cities though the web interface, 10 largest cities in the rectangle are shown.
Could you please hint an algorithm for querying 10 "largest" items from a rectangle? Is this some kind of R-Tree modification?
Thanks.
11/09/2008 07:19:03
Subject:
Re:Largest 10 cities algorithm
marc
Joined: 08/12/2005 07:39:47
Messages: 4501
Offline
The rectangle index is handled by the database. Just use a spatially enabled database like postgres.
Marc
13/09/2008 22:14:27
Subject:
Re:Largest 10 cities algorithm
Kpoxman
Joined: 10/09/2008 22:00:48
Messages: 2
Offline
Rectangle index is not a problem. It can be just an R-Tree (GiST) or, as you said, using spatial extentions (for example, PostGis for Postrges).
But rectangle index does not bring an effective solution for for querying 10 largest cities from a rectangle.
Obviously, something like
SELECT * FROM cities WHERE coordinates INSIDE (alt1, lng1, alt2, lng2) ORDER BY population LIMIT 10;
is far from optimal even if INSIDE relation is handled by spatial index.
Forum Index
->
General
Go to:
Select a forum
Forum in English
-------------
General
Administrative Divisions
FAQ - frequently asked questions
Postal Codes
Discussion of GeoNames Toponyms
Forum in other language
-------------
Forum in Deutsch
Powered by
JForum 2.1.5
©
JForum Team
info@geonames.org
GeoNames Home
Postal Codes
Download / Webservice
Forum
About