GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Simple Example  XML
Forum Index -> General
Author Message
ALD2355



Joined: 27/09/2009 23:09:46
Messages: 13
Offline

Is there a simple example somewhere of how to get either the weather or the altitude for a specific location?
marc



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

Every service has an example link in the documentation:


For instance gotopo30 as xml:
http://ws.geonames.org/gtopo30?lat=47.01&lng=10.2&style=full&type=XML

Cheers

Marc

[WWW]
ALD2355



Joined: 27/09/2009 23:09:46
Messages: 13
Offline

Thanks for this. What I am trying to do is to get an altitude and weather for a lat long position but the examples at http://www.geonames.org/export/web-services.html#gtopo30 are more complex.

I cannot understand how to do a callback based on request = 'http://ws.geonames.org/srtm3?lat=51.4715&lng=-0.4539&callback=XXX';

and get a value into a div

marc



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

For a callback you have to use the JSON service. An example of a JSON callback is here:
http://www.geonames.org/export/ajax-postalcode-autocomplete.html

Marc

[WWW]
ALD2355



Joined: 27/09/2009 23:09:46
Messages: 13
Offline

Thanks very much for your help - I have now got it working
b1344



Joined: 05/10/2009 17:32:09
Messages: 1
Location: Sydney Australia
Offline

Thanks for the simple example Marc, its much appreciated.
I have been tearing my hair out for the past few days trying to get things to work and then I realised I was actuially fighting the JSON code, and not working with it..

Thanks for the contribution, much appreciated

B.

Find out more about the latest laptops and notbooks.
ALD2355



Joined: 27/09/2009 23:09:46
Messages: 13
Offline

Thanks for the help - my working project file is here at www.sysmaps.co.uk/sysmaps_cm.html

 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team