GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Source code for geonames webservice  XML
Forum Index -> FAQ - frequently asked questions
Author Message
uttrokad



Joined: 16/02/2007 13:39:13
Messages: 3
Offline

Hi there. I would like to setup the a geonames webservice on my own server. Is the source code available for what powers ws.geonames.org?
I have seen lots of source code for pointing to the geonames server, but what if I want to use my own server?

Thanks and sorry if this has been asked before.
marc



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

The source code for the server side is not yet available for lack of time. There is a client side API available : http://www.geonames.org/source-code/

Marc

[WWW]
uttrokad



Joined: 16/02/2007 13:39:13
Messages: 3
Offline

Any updates on the release of the source code?
Are there plans to release the server side source code?
DARKHalf



Joined: 30/10/2007 09:57:37
Messages: 5
Offline

Hi, many of the functionality in Geonames you can reach with a stored procedure. The content of the stored procedure is the great circle distace formula made by haversine. Just google about "great circle distance SQL". There you should find the answer.
actualrandy



Joined: 17/05/2007 01:48:24
Messages: 7
Offline

Can you confirm my observations?

Looking at the downloaded data, I see lat/long pairs associated with place names.

My assumption is that the coordinates represent the centroid of the place name - correct?

I also assume that this is the same data used to perform reverse geocoding (such as http://ws.geonames.org/countrySubdivision?lat=43.59&lng=-116.30) - correct?

If so, then I guess there is no boundary information available (with which you could test a point to see if if falls within the bounding polygon of a place) - correct?

So I'm assuming that the search algorithm (to perform reverse geocoding) is to find the shortest distance between the specified coordinates and the place centroids - correct?[i]
DARKHalf



Joined: 30/10/2007 09:57:37
Messages: 5
Offline

Exactly that is what I wanted to say.

But: You can get more precise data. E.g. if you know the radius of the centroid of a city or a place. Such information can be found in internet.

The coordinates in download are like a big cloud of points. This leads to the assumption that you always build a circle centering your actual point and looking whats in its radius.

If you want to have boundaries of a country you will have to pay money for that. So this would be no option. You can get a rough estimation, if you tag cities which are in a certain state. If you mark cities near the borders of a state, you could build up a poly for them and find out, if another city is in or outside the 'state'. As I know there exists a website which has really good polygon data of the united states. If this is ok for you, look at google. I don't know the search term for finding the page. Sorry.
actualrandy



Joined: 17/05/2007 01:48:24
Messages: 7
Offline

Howdy DarkHalf -

You can get free data for the US from the census bureau with polygons for all political entities, such as counties, states, cities, etc. (Or maybe it's USGS - can't remember exactly).

This data is free but hard to use - I believe the data set is called "TIGER Line Files", though I haven't looked at it for a while.

Anyway, the point of my request for confirmation was that, using polygons, you can determine, with absolute certainty, whether a given point is in a particular political entity. In other words, reverse geocoding is 100% accurate when you use polygons.

Whereas, with a collection of centroids, reverse geocoding is subject to error, especially for political entities shaped as irregular polygons.

So, basically I was checking whether 1) there really aren't any polygons in this data set and 2) whether I might be wrong about exact reverse geocoding, just in case.
actualrandy



Joined: 17/05/2007 01:48:24
Messages: 7
Offline

And just to be absolutely clear, I'm definitely not complaining - I always appreciate freely shared data. Thanks, Marc!
DARKHalf



Joined: 30/10/2007 09:57:37
Messages: 5
Offline

Hi,
thanks for the info with polygons and US States. Since I do not live in the US it is not very important to me, but it's good to know that.

Reverse GeoCoding with irregular Polygons is indeed inaccurate, but not for one case: Every Point inside the polygon belongs to the according area which could be a city, a state or a country. Every point outside the poly can not be brought in correct relation to my target poly. But as always, theres one exception. A point outside my poly can be in another poly that is next to me. So if I have enough information, I can set the two points (maybe center of my poly and the point to test) in relation to each other.

Centroids give only a estimation to the fact what your point could be.
A sample statement would be: "I dont know the color of your point, but i found one near you which is orange. So your point could be orange or one of the others in my list)

I have to admit, that I do not know wheter there are polygons in the data set, but I believe not.

And the same for me: I appreciate freely shared data. Thanks too.

Greetings from Germany.
andi



Joined: 26/11/2008 10:57:08
Messages: 1
Offline

I want to show my interest in the serverside code, too.
I am interested to get the right hierarchy for every point (reverse geocoding).
I don't want to use the webservice because I will work millions of points.

How I would do it now:

Set up database locally and add a spatial index for latitude/longitude. Then I look for all geoname features which are relevant for the political hierarchy in a bbox. Additionally you can filter the bbox results with the circular function, but to use the bbox for pre-filtering is very quick, because so you can use the spatial index. Then I take the next point as endpoint for the hierarchy tree.

Relevant points to find here are not countries and admin levels but populated places. Then I use the columns in the geonames table to re-build the hierarchy up to country.

Not to use shapes is a compromise because the populated places can be just an approximation. And this is my main question: Where does the server side code use shapes and where does it use apprimated results?
juan294



Joined: 30/03/2010 05:47:31
Messages: 2
Offline

Hi all, any news regarding the source code for the WS?

I'm starting as a WS developer and I want to deploy in Soaplab2. I'm basically trying to learn by example how to do it and since they use this WS in one of their examples I'd like to see how it's done.

Thanks for your time and help,

Cheers,

Juan.
ACalcutt



Joined: 01/06/2010 19:31:53
Messages: 1
Offline

I just wanted to add that I am interested in the sourcecode for the webservice.

I just discovered geonames last week while looking for a way to divide my access point database (http://www.vistumbler.net/wifidb) up by country. I was able to create something that worked using the webservice to get the country information from latitude and longitude, but I would like to find a way to do this without relying on your servers.

I am interested in how you find the regions by latitude and longitude and If I could easily get this information myself.

I would also be interested in collaboration between our projects if you ever wanted to start mapping wireless access points.

-Andrew Calcutt
Vistumbler.net

tlse2004



Joined: 09/08/2010 21:28:58
Messages: 1
Offline

Seems like there is no interest in publishing the server source code... . I think I will just have to manage my 3000 hourly credits

Seriously, any plans? Please ?
marc



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

there are no plans to release the server side source code.

Marc

[WWW]
a110y



Joined: 13/08/2010 17:38:48
Messages: 3
Offline

Any possibility of releasing at least the SQL queries? I've downloaded the database on my machine but I'm getting different results compared to the webservice.

Thank you.
marc



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

There a plenty of threads in this forum about how to write spatial queries for various database systems and spatial capabilities.
Releasing 'the queries' wouldn't help you, it would only lead to even more questions for support, which we really cannot answer all. This is also the reason the source code is not being released.

Marc

[WWW]
 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team