GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Reverse Geocoding Using Json  XML
Forum Index -> General
Author Message
dotrural



Joined: 17/04/2012 00:14:48
Messages: 4
Offline

Hi,

I'm new to using this service but what I'm trying to do is search for areas/parks/roads etc using JSON and returning a longitude and latitude for this particular area. From what I've seen, I am able to do this using:

http://ws.geonames.org/searchJSON?q=PLACE_NAME&country=COUNTRY&countryBias=COUNTRY&continentCode=CONTINENT&type=json&maxRows=10

This works for a city like London but if I add my own place (for instance, I have added "Stewart Park" in Aberdeen to Geonames) then I don't get any results.

Any ideas on what I am doing wrong here?
marc



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

the synchronization of modifications to the web services is not immediately. It takes a couple of days. The ws.geonames.org domain is deprecated and only occasionally updated. You should use the api.geonames.org domain in any case.

Best

Marc

[WWW]
dotrural



Joined: 17/04/2012 00:14:48
Messages: 4
Offline

Hey,

Thanks for the response. I've switch to the Java API now but I'm having trouble connecting.

I'm receiving the following error:
java.lang.ClassNotFoundException: org.jdom.input.SAXBuilder
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1701)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1546)
org.geonames.WebService.connectAndParse(Unknown Source)
org.geonames.WebService.search(Unknown Source)
com.abdn.dotrural.models.Location.getLocation(Location.java:86)
com.abdn.dotrural.models.Location.<init>(Location.java:30)
com.abdn.dotrural.models.Text.getLocation(Text.java:52)
com.abdn.dotrural.models.Text.<init>(Text.java:20)
com.abdn.dotrural.web.TextServlet.doPost(TextServlet.java:59)
com.abdn.dotrural.web.TextServlet.doGet(TextServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

I've added the jdom package and pretty much copied and pasted the sample code in the javadoc still getting nowhere. The jdom package is added to the project path but I'm not sure how I'm suppose to use it (if at all).

Any ideas?

Thanks for the help too!!
marc



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

the error message means that it cannot find the jdom classes. Check the classpath again, something is wrong with it and it does not include the jdom jar file.

Marc

[WWW]
dotrural



Joined: 17/04/2012 00:14:48
Messages: 4
Offline

Hi,

Thanks for the quick response. I've tried adding the jar file directly to the Classpath as well but still no luck.

I'm using a Java servlet on Ubuntu to access the API and the jdom jar is located within WEB-INF/lib and its part of the java build path so it's getting picked up. I can even reference classes from the jdom package within the servlet but for some reason it's not able to from within the geonames package.

I forgot to mention but I'm also getting the below error as well:
java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder
org.geonames.WebService.connectAndParse(Unknown Source)
org.geonames.WebService.search(Unknown Source)
com.abdn.dotrural.models.Location.getLocation(Location.java:79)
com.abdn.dotrural.models.Location.<init>(Location.java:23)
com.abdn.dotrural.models.Text.getLocation(Text.java:52)
com.abdn.dotrural.models.Text.<init>(Text.java:20)
com.abdn.dotrural.web.TextServlet.doPost(TextServlet.java:59)
com.abdn.dotrural.web.TextServlet.doGet(TextServlet.java:37)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)

Any ideas on this?
dotrural



Joined: 17/04/2012 00:14:48
Messages: 4
Offline

I've managed to work out what was wrong. Right enough it was the class path but apparently it wasn't being refreshed when restarting eclipse or even the machine :S but i had to select the "lib" folder and hit refresh there instead. Thanks for the help though!

Another quick question, how long after inputting my own points into the geonames system do they become usable (when do they turn up in results)?
clascronlund



Joined: 28/09/2014 12:16:37
Messages: 2
Offline

It seems that the update/sync to the webservices is a little bit unpredictable.
I made some changes for a couple of weeks ago and it is not yet visible when using "api.geonames.org/findNearby" services.
For some days ago I could get the new result "sometimes" but not everytime.
So I suspect that there are more than one server involved and one (or more) server are not synced correctly.
Maybe som other reason for this but you can not really tell when it's updated.
I can't anyway.
[Email] [WWW]
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team