Update to use api.geonames.org instead of ws.geonames.org
This commit is contained in:
parent
b135fff9b0
commit
1a2f6c29c6
2 changed files with 4 additions and 2 deletions
|
@ -26,7 +26,7 @@ class GeocoderController < ApplicationController
|
|||
@sources.push "osm_nominatim"
|
||||
else
|
||||
@sources.push "osm_nominatim"
|
||||
@sources.push "geonames"
|
||||
@sources.push "geonames" if defined?(GEONAMES_USERNAME)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -272,7 +272,7 @@ class GeocoderController < ApplicationController
|
|||
@results = Array.new
|
||||
|
||||
# ask geonames.org
|
||||
response = fetch_xml("http://ws.geonames.org/search?q=#{escape_query(query)}&maxRows=20")
|
||||
response = fetch_xml("http://api.geonames.org/search?q=#{escape_query(query)}&maxRows=20&username=#{GEONAMES_USERNAME}")
|
||||
|
||||
# parse the response
|
||||
response.elements.each("geonames/geoname") do |geoname|
|
||||
|
|
|
@ -38,6 +38,8 @@ defaults: &defaults
|
|||
max_messages_per_hour: 60
|
||||
# Domain for handling message replies
|
||||
#messages_domain: "messages.openstreetmap.org"
|
||||
# Geonames authentication details
|
||||
#geonames_username: ""
|
||||
# Quova authentication details
|
||||
#quova_username: ""
|
||||
#quova_password: ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue