Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

No commit message

  • Loading branch information...
commit 87c1a24bbe53beae77ebcf4afc869760776a3358 1 parent 12be096
authored April 28, 2008

Showing 1 changed file with 64 additions and 6 deletions. Show diff stats Hide diff stats

  1. 70  lib/geonames.rb
70  lib/geonames.rb
@@ -36,8 +36,7 @@ def self.import
36 36
             if (FileTest.exist?(CITIES_15000))        
37 37
                 self.import_cities15000
38 38
             end 
39  
-            
40  
-            
  39
+                        
41 40
         end        
42 41
         
43 42
         ##
@@ -96,8 +95,7 @@ def self.import_countries
96 95
         # [16] gtopo30           : average elevation of 30'x30' (ca 900mx900m) area in meters, integer
97 96
         # [17] timezone          : the timezone id (see file timeZone.txt)
98 97
         # [18] modification date : date of last modification in yyyy-MM-dd format
99  
-
100  
-
  98
+        #
101 99
         def self.import_regions
102 100
             f = File.open(REGIONS)
103 101
             while (row = f.gets)
@@ -107,9 +105,29 @@ def self.import_regions
107 105
             end
108 106
             
109 107
         end
110  
-        
  108
+                
111 109
         ##
112 110
         # import_cities1000
  111
+        # ---------------------------------------------------------------------------------------
  112
+        # [0] geonameid         : integer id of record in geonames database
  113
+        # [1] name              : name of geographical point (utf8) varchar(200)
  114
+        # [2] asciiname         : name of geographical point in plain ascii characters, varchar(200)
  115
+        # [3] alternatenames    : alternatenames, comma separated varchar(4000)
  116
+        # [4] latitude          : latitude in decimal degrees (wgs84)
  117
+        # [5] longitude         : longitude in decimal degrees (wgs84)
  118
+        # [6] feature class     : see http://www.geonames.org/export/codes.html, char(1)
  119
+        # [7] feature code      : see http://www.geonames.org/export/codes.html, varchar(10)
  120
+        # [8] country code      : ISO-3166 2-letter country code, 2 characters
  121
+        # [9] cc2               : alternate country codes, comma separated, ISO-3166 2-letter country code, 60 characters
  122
+        # [10] admin1 code       : fipscode (subject to change to iso code), isocode for the us and ch, see file admin1Codes.txt for display names of this code; varchar(20)
  123
+        # [11] admin2 code       : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80) 
  124
+        # [12] admin3 code       : code for third level administrative division, varchar(20)
  125
+        # [13] admin4 code       : code for fourth level administrative division, varchar(20)
  126
+        # [14] population        : integer 
  127
+        # [15] elevation         : in meters, integer
  128
+        # [16] gtopo30           : average elevation of 30'x30' (ca 900mx900m) area in meters, integer
  129
+        # [17] timezone          : the timezone id (see file timeZone.txt)
  130
+        # [18] modification date : date of last modification in yyyy-MM-dd format
113 131
         #
114 132
         def self.import_cities1000
115 133
             
@@ -117,13 +135,53 @@ def self.import_cities1000
117 135
         
118 136
         ##
119 137
         # import_cities5000
  138
+        # ---------------------------------------------------------------------------------------
  139
+        # [0] geonameid         : integer id of record in geonames database
  140
+        # [1] name              : name of geographical point (utf8) varchar(200)
  141
+        # [2] asciiname         : name of geographical point in plain ascii characters, varchar(200)
  142
+        # [3] alternatenames    : alternatenames, comma separated varchar(4000)
  143
+        # [4] latitude          : latitude in decimal degrees (wgs84)
  144
+        # [5] longitude         : longitude in decimal degrees (wgs84)
  145
+        # [6] feature class     : see http://www.geonames.org/export/codes.html, char(1)
  146
+        # [7] feature code      : see http://www.geonames.org/export/codes.html, varchar(10)
  147
+        # [8] country code      : ISO-3166 2-letter country code, 2 characters
  148
+        # [9] cc2               : alternate country codes, comma separated, ISO-3166 2-letter country code, 60 characters
  149
+        # [10] admin1 code       : fipscode (subject to change to iso code), isocode for the us and ch, see file admin1Codes.txt for display names of this code; varchar(20)
  150
+        # [11] admin2 code       : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80) 
  151
+        # [12] admin3 code       : code for third level administrative division, varchar(20)
  152
+        # [13] admin4 code       : code for fourth level administrative division, varchar(20)
  153
+        # [14] population        : integer 
  154
+        # [15] elevation         : in meters, integer
  155
+        # [16] gtopo30           : average elevation of 30'x30' (ca 900mx900m) area in meters, integer
  156
+        # [17] timezone          : the timezone id (see file timeZone.txt)
  157
+        # [18] modification date : date of last modification in yyyy-MM-dd format
120 158
         #
121 159
         def self.import_cities5000
122 160
             
123 161
         end
124 162
         
125 163
         ##
126  
-        # import_cities15000
  164
+        # import_cities15000        
  165
+        # ---------------------------------------------------------------------------------------
  166
+        # [0] geonameid         : integer id of record in geonames database
  167
+        # [1] name              : name of geographical point (utf8) varchar(200)
  168
+        # [2] asciiname         : name of geographical point in plain ascii characters, varchar(200)
  169
+        # [3] alternatenames    : alternatenames, comma separated varchar(4000)
  170
+        # [4] latitude          : latitude in decimal degrees (wgs84)
  171
+        # [5] longitude         : longitude in decimal degrees (wgs84)
  172
+        # [6] feature class     : see http://www.geonames.org/export/codes.html, char(1)
  173
+        # [7] feature code      : see http://www.geonames.org/export/codes.html, varchar(10)
  174
+        # [8] country code      : ISO-3166 2-letter country code, 2 characters
  175
+        # [9] cc2               : alternate country codes, comma separated, ISO-3166 2-letter country code, 60 characters
  176
+        # [10] admin1 code       : fipscode (subject to change to iso code), isocode for the us and ch, see file admin1Codes.txt for display names of this code; varchar(20)
  177
+        # [11] admin2 code       : code for the second administrative division, a county in the US, see file admin2Codes.txt; varchar(80) 
  178
+        # [12] admin3 code       : code for third level administrative division, varchar(20)
  179
+        # [13] admin4 code       : code for fourth level administrative division, varchar(20)
  180
+        # [14] population        : integer 
  181
+        # [15] elevation         : in meters, integer
  182
+        # [16] gtopo30           : average elevation of 30'x30' (ca 900mx900m) area in meters, integer
  183
+        # [17] timezone          : the timezone id (see file timeZone.txt)
  184
+        # [18] modification date : date of last modification in yyyy-MM-dd format
127 185
         #
128 186
         def self.import_cities15000
129 187
             

0 notes on commit 87c1a24

Please sign in to comment.
Something went wrong with that request. Please try again.