Permalink
Browse files

not all fields are being captured by web_service search when style=FU…

…LL is given. This adds in some of the admin_code fields more to come.
  • Loading branch information...
1 parent 0709ba8 commit 8094a87c1b7a153426421d3c54e628f97faa8449 Will Fisher committed Apr 15, 2010
Showing with 9 additions and 0 deletions.
  1. +5 −0 lib/toponym.rb
  2. +4 −0 lib/web_service.rb
View
@@ -33,11 +33,16 @@ class Toponym
attr :latitude
attr :longitude
attr :distance
+ attr :admin_code_1
+ attr :admin_code_2
+ attr :admin_name_1
+ attr :admin_name_2
attr_writer :geoname_id, :name, :alternate_names, :country_code
attr_writer :country_name, :population, :elevation, :feature_class
attr_writer :feature_class_name, :feature_code,:feature_code_name
attr_writer :latitude, :longitude, :distance
+ attr_writer :admin_code_1, :admin_code_2, :admin_name_1, :admin_name_2
end
end
View
@@ -91,6 +91,10 @@ def WebService.element_to_toponym ( element )
toponym.population = WebService::get_element_child_int( element, 'population' )
toponym.elevation = WebService::get_element_child_text( element, 'elevation' )
toponym.distance = WebService::get_element_child_float( element, 'distance' )
+ toponym.admin_code_1 = WebService::get_element_child_text( element, 'adminCode1' )
+ toponym.admin_code_2 = WebService::get_element_child_text( element, 'adminCode2' )
+ toponym.admin_name_1 = WebService::get_element_child_text( element, 'adminName1' )
+ toponym.admin_name_2 = WebService::get_element_child_text( element, 'adminName2' )
return toponym

0 comments on commit 8094a87

Please sign in to comment.