elecnix-ruby-geonames 0.2.5 → 0.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/Rakefile.rb ADDED
@@ -0,0 +1,21 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ require 'rake'
20
+ require 'rake/testtask'
21
+ require 'rake/rdoctask'
data/lib/address.rb ADDED
@@ -0,0 +1,25 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class Address
21
+
22
+ end
23
+ end
24
+
25
+
@@ -0,0 +1,18 @@
1
+ module Geonames
2
+ class BoundingBox
3
+ attr_reader :north_point, :south_point, :east_point, :west_point
4
+ attr_writer :north_point, :south_point, :east_point, :west_point
5
+
6
+ def initialize(north=0.0, south=0.0, east=0.0, west=0.0)
7
+ self.north_point = north
8
+ self.south_point = south
9
+ self.east_point = east
10
+ self.west_point = west
11
+ end
12
+
13
+ def contains?(point)
14
+ #todo implement me
15
+ return false
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,36 @@
1
+ module Geonames
2
+ class CountryInfo
3
+ attr_reader :country_code, :country_name, :iso_numeric, :iso_alpha_3
4
+ attr_reader :fips_code, :continent, :capital, :area_sq_km, :population
5
+ attr_reader :currency_code, :geoname_id
6
+
7
+ attr_writer :country_code, :country_name, :iso_numeric, :iso_alpha_3
8
+ attr_writer :fips_code, :continent, :capital, :area_sq_km, :population
9
+ attr_writer :currency_code, :geoname_id
10
+
11
+ def initialize
12
+ @langs = []
13
+ @bounding_box = BoundingBox.new()
14
+ end
15
+
16
+ def bounding_box
17
+ return @bounding_box
18
+ end
19
+
20
+ def bounding_box=(new_bb)
21
+ @bounding_box = new_bb
22
+ end
23
+
24
+ def set_bounding_box(north, south, east, west)
25
+ @bounding_box = BoundingBox.new(north, south, east, west)
26
+ end
27
+
28
+ def languages
29
+ return @langs
30
+ end
31
+
32
+ def languages=(new_langs)
33
+ @langs = new_langs
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,35 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class CountrySubdivision
21
+ attr :country_code
22
+ attr :country_name
23
+ attr :admin_code_1
24
+ attr :admin_name_1
25
+ attr :code_fips
26
+ attr :code_iso
27
+
28
+ attr_writer :country_code, :country_name
29
+ attr_writer :admin_name_1, :admin_code_1
30
+ attr_writer :code_fips, :code_iso
31
+
32
+ end
33
+ end
34
+
35
+
data/lib/geonames.rb ADDED
@@ -0,0 +1,59 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ require 'cgi'
20
+ require 'net/http'
21
+ require 'rexml/document'
22
+
23
+ require 'web_service'
24
+ require 'toponym'
25
+ require 'toponym_search_result'
26
+ require 'toponym_search_criteria'
27
+ require 'postal_code'
28
+ require 'postal_code_search_criteria'
29
+ require 'timezone'
30
+ require 'country_subdivision'
31
+ require 'wikipedia_article'
32
+ require 'intersection'
33
+
34
+ module Geonames
35
+
36
+ GEONAMES_SERVER = "http://ws.geonames.org"
37
+ USER_AGENT = "geonames ruby webservice client 0.1"
38
+
39
+ @@username = nil
40
+ @@base_url = "http://ws.geonames.org"
41
+
42
+ def self.username
43
+ @@username
44
+ end
45
+
46
+ def self.username=(username)
47
+ @@username = username
48
+ end
49
+
50
+ def self.base_url
51
+ @@base_url
52
+ end
53
+
54
+ def self.base_url=(base_url)
55
+ @@base_url = base_url
56
+ end
57
+
58
+ end
59
+
@@ -0,0 +1,42 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class Intersection
21
+ attr :street_1
22
+ attr :street_2
23
+ attr :latitude
24
+ attr :longitude
25
+ attr :distance
26
+ attr :postal_code
27
+ attr :place_name
28
+ attr :country_code
29
+ attr :admin_code_1
30
+ attr :admin_name_2
31
+ attr :admin_code_2
32
+ attr :admin_name_1
33
+
34
+ attr_writer :street_1, :street_2
35
+ attr_writer :postal_code, :place_name, :country_code
36
+ attr_writer :latitude, :longitude, :admin_name_1
37
+ attr_writer :admin_code_1, :admin_name_2, :admin_code_2
38
+ attr_writer :distance
39
+ end
40
+ end
41
+
42
+
data/lib/main.rb ADDED
@@ -0,0 +1,63 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ # Contributions by Andrew Turner, High Earth Orbit
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
+ # use this file except in compliance with the License. You may obtain a copy of
8
+ # the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations under
16
+ # the License.
17
+ #
18
+ #=============================================================================
19
+
20
+ require 'geonames'
21
+ require 'pp'
22
+
23
+ # get the nearest intersection
24
+ intersection = Geonames::WebService.find_nearest_intersection 40.7574053333333, -73.9734773333333
25
+ puts intersection.street_1 #=> Park Ave
26
+ puts intersection.street_2 #=> E 51st St
27
+
28
+ # get wikipedia articles by lat / long
29
+ articles_nearby = Geonames::WebService.find_nearby_wikipedia :lat => 43.900120387, :long => -78.882869834
30
+ p articles_nearby
31
+
32
+ # get wikipedia articles by bounding box
33
+ articles_nearby = Geonames::WebService.find_bounding_box_wikipedia :north => 43.900120387, :east => -78.882869834, :south => 43.82, :west => 79.0
34
+ p articles_nearby
35
+
36
+ # get list of places near by longitude/longitude location
37
+ places_nearby = Geonames::WebService.find_nearby_place_name 43.900120387, -78.882869834
38
+ p places_nearby
39
+
40
+ # get timezone for longitude/longitude location
41
+ timezone = Geonames::WebService.timezone 43.900120387, -78.882869834
42
+ p timezone
43
+
44
+ # get country code for longitude/longitude location
45
+ country_code = Geonames::WebService.country_code 43.900120387, -78.882869834
46
+ p country_code
47
+
48
+ # get country sub-division info for longitude/longitude location
49
+ country_subdivision = Geonames::WebService.country_subdivision 43.900120387, -78.882869834
50
+ p country_subdivision
51
+
52
+ # get postal codes for a given location
53
+ postal_code_sc = Geonames::PostalCodeSearchCriteria.new
54
+ postal_code_sc.place_name = "Oshawa"
55
+ postal_codes = Geonames::WebService.postal_code_search postal_code_sc
56
+ p postal_codes
57
+
58
+ # get nearby postal codes for a place name
59
+ postal_code_sc = Geonames::PostalCodeSearchCriteria.new
60
+ postal_code_sc.place_name = "Oshawa"
61
+ postal_codes_nearby = Geonames::WebService.find_nearby_postal_codes postal_code_sc
62
+ p postal_codes_nearby
63
+
@@ -0,0 +1,40 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class PostalCode
21
+ attr :postal_code
22
+ attr :place_name
23
+ attr :country_code
24
+ attr :latitude
25
+ attr :longitude
26
+ attr :admin_name_1
27
+ attr :admin_code_1
28
+ attr :admin_name_2
29
+ attr :admin_code_2
30
+ attr :distance
31
+
32
+ attr_writer :postal_code, :place_name, :country_code
33
+ attr_writer :latitude, :longitude, :admin_name_1
34
+ attr_writer :admin_code_1, :admin_name_2, :admin_code_2
35
+ attr_writer :distance
36
+
37
+ end
38
+ end
39
+
40
+
@@ -0,0 +1,84 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class PostalCodeSearchCriteria
21
+
22
+ attr :postal_code
23
+ attr :place_name
24
+ attr :country_code
25
+ attr :latitude
26
+ attr :longitude
27
+ attr :style
28
+ attr :max_rows
29
+ attr :is_or_operator
30
+ attr :radius
31
+
32
+ attr_writer :postal_code, :place_name, :country_code
33
+ attr_writer :latitude, :longitude, :style
34
+ attr_writer :max_rows, :is_or_operator, :radius
35
+
36
+ def initialize
37
+ @is_or_operator = false
38
+ end
39
+
40
+ def to_query_params_string
41
+ url = ''
42
+
43
+ if !@postal_code.nil?
44
+ url = url + "&postalcode=" + CGI::escape( @postal_code )
45
+ end
46
+
47
+ if !@place_name.nil?
48
+ url = url + "&placename=" + CGI::escape( @place_name )
49
+ end
50
+
51
+ if !@latitude.nil?
52
+ url = url + "&lat" + CGI::escape( @latitude.to_s )
53
+ end
54
+
55
+ if !@longitude.nil?
56
+ url = url + "&lng" + CGI::escape( @longitude.to_s )
57
+ end
58
+
59
+ if !@style.nil?
60
+ url = url + "&style" + CGI::escape( @style )
61
+ end
62
+
63
+ if !@country_code.nil?
64
+ url = url + "&country=" + CGI::escape( @country_code )
65
+ end
66
+
67
+ if !@max_rows.nil?
68
+ url = url + "&maxRows=" + CGI::escape( @max_rows )
69
+ end
70
+
71
+ if !@radius.nil?
72
+ url = url + "&radius=" + CGI::escape( @radius.to_s )
73
+ end
74
+
75
+ if @is_or_operator
76
+ url = url + "&operator=OR"
77
+ end
78
+
79
+ url
80
+ end
81
+ end
82
+ end
83
+
84
+
@@ -0,0 +1,56 @@
1
+ $:.unshift File.join(File.dirname(__FILE__), "..", "lib")
2
+
3
+ require 'geonames'
4
+ require 'test/unit'
5
+
6
+ class TestCountryInfo < Test::Unit::TestCase
7
+ def setup
8
+ @test_code = "TH"
9
+
10
+ @expected =
11
+ {:country_code => 'TH', :country_name => 'Thailand', :iso_numeric => 764,
12
+ :iso_alpha_3 => 'THA', :fips_code => 'TH', :continent => 'AS',
13
+ :capital => 'Bangkok', :area_sq_km => 514000.0, :population => 65493000,
14
+ :currency_code => 'THB', :geonameId => 1605651,
15
+ :languages => ['th', 'en'],
16
+ :box_north => 20.4631977081299, :box_south => 5.60999917984009,
17
+ :box_east => 105.63939666748, :box_west => 97.3456268310547}
18
+ end
19
+
20
+ def teardown
21
+ #nothing here really
22
+ end
23
+
24
+ def test_simple_values
25
+ info = Geonames::WebService.country_info(@test_code)
26
+
27
+ assert_equal(@expected[:country_code], info.country_code)
28
+ assert_equal(@expected[:country_name], info.country_name)
29
+ assert_equal(@expected[:iso_numeric], info.iso_numeric)
30
+ assert_equal(@expected[:iso_alpha_3], info.iso_alpha_3)
31
+ assert_equal(@expected[:fips_code], info.fips_code)
32
+ assert_equal(@expected[:continent], info.continent)
33
+ assert_equal(@expected[:capital], info.capital)
34
+ assert_equal(@expected[:area_sq_km], info.area_sq_km)
35
+ assert_equal(@expected[:population], info.population)
36
+ assert_equal(@expected[:currency_code], info.currency_code)
37
+ assert_equal(@expected[:geonameId], info.geoname_id )
38
+ end
39
+
40
+ def test_languages
41
+ info = Geonames::WebService.country_info(@test_code)
42
+
43
+ assert_equal(2, info.languages.size)
44
+ assert_equal(@expected[:languages][0], info.languages[0])
45
+ assert_equal(@expected[:languages][1], info.languages[1])
46
+ end
47
+
48
+ def test_bounding_box
49
+ info = Geonames::WebService.country_info(@test_code)
50
+
51
+ assert_equal(@expected[:box_north], info.bounding_box.north_point)
52
+ assert_equal(@expected[:box_south], info.bounding_box.south_point)
53
+ assert_equal(@expected[:box_east], info.bounding_box.east_point)
54
+ assert_equal(@expected[:box_west], info.bounding_box.west_point)
55
+ end
56
+ end
data/lib/timezone.rb ADDED
@@ -0,0 +1,29 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class Timezone
21
+ attr :timezone_id
22
+ attr :gmt_offset
23
+ attr :dst_offset
24
+
25
+ attr_writer :timezone_id, :gmt_offset, :dst_offset
26
+ end
27
+ end
28
+
29
+
data/lib/toponym.rb ADDED
@@ -0,0 +1,45 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class Toponym
21
+
22
+ attr :geoname_id
23
+ attr :name
24
+ attr :alternate_names
25
+ attr :country_code
26
+ attr :country_name
27
+ attr :population
28
+ attr :elevation
29
+ attr :feature_class
30
+ attr :feature_class_name
31
+ attr :feature_code
32
+ attr :feature_code_name
33
+ attr :latitude
34
+ attr :longitude
35
+ attr :distance
36
+
37
+ attr_writer :geoname_id, :name, :alternate_names, :country_code
38
+ attr_writer :country_name, :population, :elevation, :feature_class
39
+ attr_writer :feature_class_name, :feature_code,:feature_code_name
40
+ attr_writer :latitude, :longitude, :distance
41
+
42
+ end
43
+ end
44
+
45
+
@@ -0,0 +1,44 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class ToponymSearchCriteria
21
+
22
+ attr :q
23
+ attr :country_code
24
+ attr :name
25
+ attr :name_equals
26
+ attr :name_starts_with
27
+ attr :tag
28
+ attr :language
29
+ attr :style
30
+ attr :feature_class
31
+ attr :feature_codes
32
+ attr :admin_code_1
33
+ attr :max_rows
34
+ attr :start_row
35
+
36
+ attr_writer :q, :country_code, :name, :name_equals
37
+ attr_writer :name_starts_with, :tag, :language, :style
38
+ attr_writer :feature_class, :feature_codes, :admin_code_1
39
+ attr_writer :max_rows, :start_row
40
+
41
+ end
42
+ end
43
+
44
+
@@ -0,0 +1,33 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class ToponymSearchResult
21
+
22
+ attr :total_results_count
23
+ attr :toponyms
24
+
25
+ attr_writer :total_results_count, :toponyms
26
+
27
+ def initialize
28
+ @toponyms = Array.new
29
+ end
30
+ end
31
+ end
32
+
33
+
@@ -0,0 +1,561 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ # Contributions by Andrew Turner, High Earth Orbit
5
+ #
6
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
7
+ # use this file except in compliance with the License. You may obtain a copy of
8
+ # the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
+ # License for the specific language governing permissions and limitations under
16
+ # the License.
17
+ #
18
+ #=============================================================================
19
+
20
+ module Geonames
21
+ class WebService
22
+ def WebService.get_element_child_text( element, child )
23
+ if !element.elements[child].nil?
24
+ element.elements[child][0].to_s
25
+ end
26
+ end
27
+
28
+ def WebService.get_element_child_float( element, child )
29
+ if !element.elements[child].nil?
30
+ element.elements[child][0].to_s.to_f
31
+ end
32
+ end
33
+
34
+ def WebService.get_element_child_int( element, child )
35
+ if !element.elements[child].nil?
36
+ element.elements[child][0].to_s.to_i
37
+ end
38
+ end
39
+
40
+ def WebService.element_to_postal_code ( element )
41
+ postal_code = PostalCode.new
42
+
43
+ postal_code.admin_code_1 = WebService::get_element_child_text( element, 'adminCode1' )
44
+ postal_code.admin_code_2 = WebService::get_element_child_text( element, 'adminCode2' )
45
+ postal_code.admin_name_1 = WebService::get_element_child_text( element, 'adminName1' )
46
+ postal_code.admin_name_2 = WebService::get_element_child_text( element, 'adminName2' )
47
+ postal_code.country_code = WebService::get_element_child_text( element, 'countryCode' )
48
+ postal_code.distance = WebService::get_element_child_float( element, 'distance' )
49
+ postal_code.longitude = WebService::get_element_child_float( element, 'lng' )
50
+ postal_code.latitude = WebService::get_element_child_float( element, 'lat' )
51
+ postal_code.place_name = WebService::get_element_child_text( element, 'name' )
52
+ postal_code.postal_code = WebService::get_element_child_text( element, 'postalcode' )
53
+
54
+ return postal_code
55
+
56
+ end
57
+
58
+ def WebService.element_to_wikipedia_article ( element )
59
+ article = WikipediaArticle.new
60
+
61
+ article.language = WebService::get_element_child_text( element, 'lang' )
62
+ article.title = WebService::get_element_child_text( element, 'title' )
63
+ article.summary = WebService::get_element_child_text( element, 'summary' )
64
+ article.wikipedia_url = WebService::get_element_child_text( element, 'wikipediaUrl' )
65
+ article.feature = WebService::get_element_child_text( element, 'feature' )
66
+ article.population = WebService::get_element_child_text( element, 'population' )
67
+ article.elevation = WebService::get_element_child_text( element, 'elevation' )
68
+ article.latitude = WebService::get_element_child_float( element, 'lat' )
69
+ article.longitude = WebService::get_element_child_float( element, 'lng' )
70
+ article.thumbnail_img = WebService::get_element_child_text( element, 'thumbnailImg' )
71
+ article.distance = WebService::get_element_child_float( element, 'distance' )
72
+
73
+ return article
74
+
75
+ end
76
+
77
+ def WebService.element_to_toponym ( element )
78
+ toponym = Toponym.new
79
+
80
+ toponym.name = WebService::get_element_child_text( element, 'name' )
81
+ toponym.alternate_names = WebService::get_element_child_text( element, 'alternateNames' )
82
+ toponym.latitude = WebService::get_element_child_float( element, 'lat' )
83
+ toponym.longitude = WebService::get_element_child_float( element, 'lng' )
84
+ toponym.geoname_id = WebService::get_element_child_text( element, 'geonameId' )
85
+ toponym.country_code = WebService::get_element_child_text( element, 'countryCode' )
86
+ toponym.country_name = WebService::get_element_child_text( element, 'countryName' )
87
+ toponym.feature_class = WebService::get_element_child_text( element, 'fcl' )
88
+ toponym.feature_code = WebService::get_element_child_text( element, 'fcode' )
89
+ toponym.feature_class_name = WebService::get_element_child_text( element, 'fclName' )
90
+ toponym.feature_code_name = WebService::get_element_child_text( element, 'fCodeName' )
91
+ toponym.population = WebService::get_element_child_int( element, 'population' )
92
+ toponym.elevation = WebService::get_element_child_text( element, 'elevation' )
93
+ toponym.distance = WebService::get_element_child_float( element, 'distance' )
94
+
95
+ return toponym
96
+
97
+ end
98
+
99
+ def WebService.element_to_intersection ( element )
100
+ intersection = Intersection.new
101
+
102
+ intersection.street_1 = WebService::get_element_child_text( element, 'street1' )
103
+ intersection.street_2 = WebService::get_element_child_text( element, 'street2' )
104
+ intersection.admin_code_1 = WebService::get_element_child_text( element, 'adminCode1' )
105
+ intersection.admin_code_1 = WebService::get_element_child_text( element, 'adminCode1' )
106
+ intersection.admin_code_2 = WebService::get_element_child_text( element, 'adminCode2' )
107
+ intersection.admin_name_1 = WebService::get_element_child_text( element, 'adminName1' )
108
+ intersection.admin_name_2 = WebService::get_element_child_text( element, 'adminName2' )
109
+ intersection.country_code = WebService::get_element_child_text( element, 'countryCode' )
110
+ intersection.distance = WebService::get_element_child_float( element, 'distance' )
111
+ intersection.longitude = WebService::get_element_child_float( element, 'lat' )
112
+ intersection.latitude = WebService::get_element_child_float( element, 'lng' )
113
+ intersection.place_name = WebService::get_element_child_text( element, 'name' )
114
+ intersection.postal_code = WebService::get_element_child_text( element, 'postalcode' )
115
+
116
+ return intersection
117
+
118
+ end
119
+
120
+ def WebService.element_to_country_info(element)
121
+ country_info = CountryInfo.new
122
+
123
+ country_info.country_code = WebService.get_element_child_text(element, 'countryCode')
124
+ country_info.country_name = WebService.get_element_child_text(element, 'countryName')
125
+ country_info.iso_numeric = WebService.get_element_child_int(element, 'isoNumeric')
126
+ country_info.iso_alpha_3 = WebService.get_element_child_text(element, 'isoAlpha3')
127
+ country_info.fips_code = WebService.get_element_child_text(element, 'fipsCode')
128
+ country_info.continent = WebService.get_element_child_text(element, 'continent')
129
+ country_info.capital = WebService.get_element_child_text(element, 'capital')
130
+ country_info.area_sq_km = WebService.get_element_child_float(element, 'areaInSqKm')
131
+ country_info.population = WebService.get_element_child_int(element, 'population')
132
+ country_info.currency_code = WebService.get_element_child_text(element, 'currencyCode')
133
+ #actually an array of the available languages
134
+ country_info.languages = WebService.get_element_child_text(element, 'languages').split(",")
135
+ country_info.geoname_id = WebService.get_element_child_int(element, 'geonameId')
136
+
137
+ north = WebService.get_element_child_float(element, 'bBoxNorth')
138
+ south = WebService.get_element_child_float(element, 'bBoxSouth')
139
+ east = WebService.get_element_child_float(element, 'bBoxEast')
140
+ west = WebService.get_element_child_float(element, 'bBoxWest')
141
+
142
+ country_info.set_bounding_box(north, south, east, west)
143
+
144
+ return country_info
145
+ end
146
+
147
+ def WebService.postal_code_search( postal_code, place_name, country_code )
148
+ postal_code_sc = PostalCodeSearchCriteria.new
149
+ postal_code_sc.postal_code = postal_code
150
+ postal_code_sc.place_name = place_name
151
+ postal_code_sc.country_code = country_code
152
+
153
+ WebService.postal_code_search postal_code_sc
154
+ end
155
+
156
+ def WebService.postal_code_search( search_criteria )
157
+ # postal codes to reutrn
158
+ postal_codes = Array.new
159
+
160
+ url = Geonames::GEONAMES_SERVER + "/postalCodeSearch?a=a"
161
+ url = url + search_criteria.to_query_params_string
162
+
163
+ uri = URI.parse(url)
164
+
165
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
166
+
167
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
168
+ http.request( req )
169
+ }
170
+
171
+ doc = REXML::Document.new res.body
172
+
173
+ doc.elements.each("geonames/code") do |element|
174
+ postal_codes << WebService::element_to_postal_code( element )
175
+ end
176
+
177
+ postal_codes
178
+
179
+ end
180
+
181
+ def WebService.find_nearby_postal_codes( search_criteria )
182
+ # postal codes to reutrn
183
+ postal_codes = Array.new
184
+
185
+ url = Geonames::GEONAMES_SERVER + "/findNearbyPostalCodes?a=a"
186
+ url = url + search_criteria.to_query_params_string
187
+
188
+ uri = URI.parse(url)
189
+
190
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
191
+
192
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
193
+ http.request( req )
194
+ }
195
+
196
+ doc = REXML::Document.new res.body
197
+
198
+ doc.elements.each("geonames/code") do |element|
199
+ postal_codes << WebService::element_to_postal_code( element )
200
+ end
201
+
202
+ postal_codes
203
+
204
+ end
205
+
206
+ def WebService.find_nearby_place_name( lat, long )
207
+ places = Array.new
208
+
209
+ url = Geonames::GEONAMES_SERVER + "/findNearbyPlaceName?a=a"
210
+
211
+ url = url + "&lat=" + lat.to_s
212
+ url = url + "&lng=" + long.to_s
213
+
214
+ uri = URI.parse(url)
215
+
216
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
217
+
218
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
219
+ http.request( req )
220
+ }
221
+
222
+ doc = REXML::Document.new res.body
223
+
224
+ doc.elements.each("geonames/geoname") do |element|
225
+
226
+ places << WebService::element_to_toponym( element )
227
+
228
+ end
229
+
230
+ return places
231
+
232
+ end
233
+
234
+ def WebService.find_nearest_intersection( lat, long )
235
+
236
+ url = Geonames::GEONAMES_SERVER + "/findNearestIntersection?a=a"
237
+
238
+ url = url + "&lat=" + lat.to_s
239
+ url = url + "&lng=" + long.to_s
240
+
241
+ uri = URI.parse(url)
242
+
243
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
244
+
245
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
246
+ http.request( req )
247
+ }
248
+
249
+ doc = REXML::Document.new res.body
250
+
251
+ intersection = []
252
+ doc.elements.each("geonames/intersection") do |element|
253
+
254
+ intersection = WebService::element_to_intersection( element )
255
+
256
+ end
257
+
258
+ return intersection
259
+
260
+ end
261
+
262
+ def WebService.timezone( lat, long, *args )
263
+ res = make_request("/timezone?lat=#{lat.to_s}&lng=#{long.to_s}", args)
264
+ doc = REXML::Document.new res.body
265
+ timezone = Timezone.new
266
+ doc.elements.each("geonames/timezone") do |element|
267
+ timezone.timezone_id = WebService::get_element_child_text( element, 'timezoneId' )
268
+ timezone.gmt_offset = WebService::get_element_child_float( element, 'gmtOffset' )
269
+ timezone.dst_offset = WebService::get_element_child_float( element, 'dstOffset' )
270
+ end
271
+ timezone
272
+ end
273
+
274
+ def WebService.make_request(path_and_query, *args)
275
+ url = Geonames::base_url + path_and_query
276
+ url = url + "&username=#{Geonames::username}" if Geonames::username
277
+ options = {
278
+ :open_timeout => 60,
279
+ :read_timeout => 60
280
+ }
281
+ options.update(args.last.is_a?(::Hash) ? args.pop : {})
282
+ uri = URI.parse(url)
283
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
284
+ Net::HTTP.start(uri.host, uri.port) { |http|
285
+ http.read_timeout = options[:read_timeout]
286
+ http.open_timeout = options[:open_timeout]
287
+ http.request(req)
288
+ }
289
+ end
290
+
291
+ def WebService.findNearbyWikipedia( hashes )
292
+ # here for backwards compatibility
293
+ WebService.find_nearby_wikipedia( hashes )
294
+ end
295
+
296
+ def WebService.find_nearby_wikipedia( hashes )
297
+ articles = Array.new
298
+
299
+ lat = hashes[:lat]
300
+ long = hashes[:long]
301
+ lang = hashes[:lang]
302
+ radius = hashes[:radius]
303
+ max_rows = hashes[:max_rows]
304
+ country = hashes[:country]
305
+ postalcode = hashes[:postalcode]
306
+ q = hashes[:q]
307
+
308
+ url = Geonames::GEONAMES_SERVER + "/findNearbyWikipedia?a=a"
309
+
310
+ if !lat.nil? && !long.nil?
311
+ url = url + "&lat=" + lat.to_s
312
+ url = url + "&lng=" + long.to_s
313
+ url = url + "&radius=" + radius.to_s unless radius.nil?
314
+ url = url + "&max_rows=" + max_rows.to_s unless max_rows.nil?
315
+
316
+ elsif !q.nil?
317
+ url = url + "&q=" + q
318
+ url = url + "&radius=" + radius.to_s unless radius.nil?
319
+ url = url + "&max_rows=" + max_rows.to_s unless max_rows.nil?
320
+ end
321
+
322
+ uri = URI.parse(url)
323
+
324
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
325
+
326
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
327
+ http.request( req )
328
+ }
329
+
330
+ doc = REXML::Document.new res.body
331
+
332
+ doc.elements.each("geonames/entry") do |element|
333
+ articles << WebService::element_to_wikipedia_article( element )
334
+ end
335
+
336
+ return articles
337
+
338
+ end
339
+
340
+ def WebService.findBoundingBoxWikipedia( hashes )
341
+ # here for backwards compatibility
342
+ WebService.find_bounding_box_wikipedia( hashes )
343
+ end
344
+
345
+ def WebService.find_bounding_box_wikipedia( hashes )
346
+ articles = Array.new
347
+
348
+ north = hashes[:north]
349
+ east = hashes[:east]
350
+ south = hashes[:south]
351
+ west = hashes[:west]
352
+ lang = hashes[:lang]
353
+ radius = hashes[:radius]
354
+ max_rows = hashes[:max_rows]
355
+ country = hashes[:country]
356
+ postalcode = hashes[:postalcode]
357
+ q = hashes[:q]
358
+
359
+ url = Geonames::GEONAMES_SERVER + "/wikipediaBoundingBox?a=a"
360
+
361
+ url = url + "&north=" + north.to_s
362
+ url = url + "&east=" + east.to_s
363
+ url = url + "&south=" + south.to_s
364
+ url = url + "&west=" + west.to_s
365
+ url = url + "&radius=" + radius.to_s unless radius.nil?
366
+ url = url + "&max_rows=" + max_rows.to_s unless max_rows.nil?
367
+
368
+ uri = URI.parse(url)
369
+
370
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
371
+
372
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
373
+ http.request( req )
374
+ }
375
+
376
+ doc = REXML::Document.new res.body
377
+
378
+ doc.elements.each("geonames/entry") do |element|
379
+ articles << WebService::element_to_wikipedia_article( element )
380
+ end
381
+
382
+ return articles
383
+
384
+ end
385
+
386
+ def WebService.country_subdivision ( lat, long, radius = 0, maxRows = 1 )
387
+
388
+ country_subdivisions = Array.new
389
+
390
+ # maxRows is only implemented in the xml version:
391
+ # http://groups.google.com/group/geonames/browse_thread/thread/f7f1bb2504ed216e
392
+ # Therefore 'type=xml' is added:
393
+ url = Geonames::GEONAMES_SERVER + "/countrySubdivision?a=a&type=xml"
394
+
395
+ url = url + "&lat=" + lat.to_s
396
+ url = url + "&lng=" + long.to_s
397
+ url = url + "&maxRows=" + maxRows.to_s
398
+ url = url + "&radius=" + radius.to_s
399
+
400
+ uri = URI.parse(url)
401
+
402
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
403
+
404
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
405
+ http.request( req )
406
+ }
407
+
408
+ doc = REXML::Document.new res.body
409
+
410
+ doc.elements.each("geonames/countrySubdivision") do |element|
411
+
412
+ country_subdivision = CountrySubdivision.new
413
+
414
+ country_subdivision.country_code = WebService::get_element_child_text( element, 'countryCode' )
415
+ country_subdivision.country_name = WebService::get_element_child_text( element, 'countryName' )
416
+ country_subdivision.admin_code_1 = WebService::get_element_child_text( element, 'adminCode1' )
417
+ country_subdivision.admin_name_1 = WebService::get_element_child_text( element, 'adminName1' )
418
+ country_subdivision.code_fips = WebService::get_element_child_text( element, 'code[@type="FIPS10-4"]')
419
+ country_subdivision.code_iso = WebService::get_element_child_text( element, 'code[@type="ISO3166-2"]')
420
+
421
+ country_subdivisions << country_subdivision
422
+
423
+ end
424
+
425
+ return country_subdivisions
426
+
427
+ end
428
+
429
+ def WebService.country_info(country_code)
430
+ url = Geonames::GEONAMES_SERVER + "/countryInfo?a=a"
431
+
432
+ url += "&country=#{country_code.to_s}"
433
+ uri = URI.parse(url)
434
+
435
+ req = Net::HTTP::Get.new(uri.path + "?" + uri.query)
436
+ res = Net::HTTP.start(uri.host, uri.port) { |http| http.request(req)}
437
+
438
+ doc = REXML::Document.new res.body
439
+
440
+ return WebService.element_to_country_info(doc.elements["geonames/country"])
441
+ end
442
+
443
+ def WebService.country_code ( lat, long, radius = 0, maxRows = 1 )
444
+ # maxRows is only implemented in the xml version:
445
+ # http://groups.google.com/group/geonames/browse_thread/thread/f7f1bb2504ed216e
446
+ # Therefore 'type=xml' is added:
447
+ url = Geonames::GEONAMES_SERVER + "/countrycode?a=a&type=xml"
448
+
449
+ countries = Array.new
450
+
451
+ url = url + "&lat=" + lat.to_s
452
+ url = url + "&lng=" + long.to_s
453
+ url = url + "&maxRows=" + maxRows.to_s
454
+ url = url + "&radius=" + radius.to_s
455
+
456
+ uri = URI.parse(url)
457
+
458
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
459
+
460
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
461
+ http.request( req )
462
+ }
463
+
464
+ doc = REXML::Document.new res.body
465
+
466
+ doc.elements.each("geonames/country") do |element|
467
+
468
+ countries << WebService::element_to_toponym( element )
469
+
470
+ end
471
+
472
+ return countries
473
+
474
+ end
475
+
476
+ def WebService.search( search_criteria )
477
+ #toponym search results to return
478
+ toponym_sr = ToponymSearchResult.new
479
+
480
+ url = Geonames::GEONAMES_SERVER + "/search?a=a"
481
+
482
+ if !search_criteria.q.nil?
483
+ url = url + "&q=" + CGI::escape( search_criteria.q )
484
+ end
485
+
486
+ if !search_criteria.name_equals.nil?
487
+ url = url + "&name_equals=" + CGI::escape( search_criteria.name_equals )
488
+ end
489
+
490
+ if !search_criteria.name_starts_with.nil?
491
+ url = url + "&name_startsWith=" + CGI::escape( search_criteria.name_starts_with )
492
+ end
493
+
494
+ if !search_criteria.name.nil?
495
+ url = url + "&name=" + CGI::escape( search_criteria.name )
496
+ end
497
+
498
+ if !search_criteria.tag.nil?
499
+ url = url + "&tag=" + CGI::escape( search_criteria.tag )
500
+ end
501
+
502
+ if !search_criteria.country_code.nil?
503
+ url = url + "&country=" + CGI::escape( search_criteria.country_code )
504
+ end
505
+
506
+ if !search_criteria.admin_code_1.nil?
507
+ url = url + "&adminCode1=" + CGI::escape( search_criteria.admin_code_1 )
508
+ end
509
+
510
+ if !search_criteria.language.nil?
511
+ url = url + "&lang=" + CGI::escape( search_criteria.language )
512
+ end
513
+
514
+ if !search_criteria.feature_class.nil?
515
+ url = url + "&featureClass=" + CGI::escape( search_criteria.feature_class )
516
+ end
517
+
518
+ if !search_criteria.feature_codes.nil?
519
+ for feature_code in search_criteria.feature_codes
520
+ url = url + "&fcode=" + CGI::escape( feature_code )
521
+ end
522
+ end
523
+
524
+ if !search_criteria.max_rows.nil?
525
+ url = url + "&maxRows=" + CGI::escape( search_criteria.max_rows )
526
+ end
527
+
528
+ if !search_criteria.start_row.nil?
529
+ url = url + "&startRow=" + CGI::escape( search_criteria.start_row )
530
+ end
531
+
532
+ if !search_criteria.style.nil?
533
+ url = url + "&style=" + CGI::escape( search_criteria.style )
534
+ end
535
+
536
+ uri = URI.parse(url)
537
+
538
+ req = Net::HTTP::Get.new(uri.path + '?' + uri.query)
539
+
540
+ res = Net::HTTP.start( uri.host, uri.port ) { |http|
541
+ http.request( req )
542
+ }
543
+
544
+ doc = REXML::Document.new res.body
545
+
546
+ toponym_sr.total_results_count = doc.elements["geonames/totalResultsCount"].text
547
+
548
+ doc.elements.each("geonames/geoname") do |element|
549
+
550
+ toponym_sr.toponyms << WebService::element_to_toponym( element )
551
+
552
+ end
553
+
554
+ return toponym_sr
555
+ end
556
+
557
+ end
558
+ end
559
+
560
+ #alias WebService.find_nearby_wikipedia findNearbyWikipedia
561
+ #alias find_bounding_box_wikipedia findBoundingBoxWikipedia
@@ -0,0 +1,42 @@
1
+ #=============================================================================
2
+ #
3
+ # Copyright 2007 Adam Wisniewski <adamw@tbcn.ca>
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License"); you may not
6
+ # use this file except in compliance with the License. You may obtain a copy of
7
+ # the License at
8
+ #
9
+ # http://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14
+ # License for the specific language governing permissions and limitations under
15
+ # the License.
16
+ #
17
+ #=============================================================================
18
+
19
+ module Geonames
20
+ class WikipediaArticle
21
+
22
+ attr :language
23
+ attr :title
24
+ attr :summary
25
+ attr :wikipedia_url
26
+ attr :feature
27
+ attr :population
28
+ attr :elevation
29
+ attr :latitude
30
+ attr :longitude
31
+ attr :thumbnail_img
32
+ attr :distance
33
+
34
+ attr_writer :language, :title, :summary
35
+ attr_writer :wikipedia_url, :feature, :population
36
+ attr_writer :elevation, :latitude, :longitude
37
+ attr_writer :thumbnail_img, :distance
38
+
39
+ end
40
+ end
41
+
42
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elecnix-ruby-geonames
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Wisniewski
@@ -23,6 +23,23 @@ extra_rdoc_files:
23
23
  - README.markdown
24
24
  files:
25
25
  - README.markdown
26
+ - lib/timezone.rb
27
+ - lib/wikipedia_article.rb
28
+ - lib/geonames.rb
29
+ - lib/postal_code_search_criteria.rb
30
+ - lib/intersection.rb
31
+ - lib/country_subdivision.rb
32
+ - lib/toponym.rb
33
+ - lib/toponym_search_result.rb
34
+ - lib/bounding_box.rb
35
+ - lib/web_service.rb
36
+ - lib/postal_code.rb
37
+ - lib/toponym_search_criteria.rb
38
+ - lib/tc_country_info.rb
39
+ - lib/main.rb
40
+ - lib/Rakefile.rb
41
+ - lib/address.rb
42
+ - lib/country_info.rb
26
43
  has_rdoc: true
27
44
  homepage: http://github.com/elecnix/ruby-geonames
28
45
  post_install_message: