geonames.smd 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263
  1. {
  2. // JSON REST services provided by geonames.org
  3. // adapted from: http://www.geonames.org/export/JSON-webservices.html
  4. // http://creativecommons.org/licenses/by/3.0/
  5. // INCOMPLETE IMPLEMENTATION
  6. "SMDVersion":"2.0",
  7. "id":"/geonames",
  8. "transport":"JSONP",
  9. "envelope":"URL",
  10. "target": "http://ws.geonames.org/",
  11. "parameters" : [
  12. {name:"type", optional: false, "default":"JSON"}
  13. ],
  14. "services":{
  15. getCountryInfo:{
  16. // Result : returns info about a country such as name, population, etc.
  17. // If country parameter is not specified, that information is returned for
  18. // every country
  19. "target": "countryInfoJSON",
  20. "parameters": [
  21. { name: "country", type:"STRING", optional: true },
  22. { name: "lang", type:"STRING"}, // default: "en"
  23. { name: "maxRows", type:"INTEGER", optional: true } // default: 10
  24. ]
  25. },
  26. getCities:{
  27. // Result : returns a list of cities and placenames in the bounding box,
  28. // ordered by relevancy (capital/population). Placenames close together
  29. // are filterered out and only the larger name is included in the resulting list.
  30. "target": "citiesJSON",
  31. "parameters": [
  32. { name: "north", type:"FLOAT"},
  33. { name: "south", type:"FLOAT"},
  34. { name: "east", type:"FLOAT"},
  35. { name: "west", type:"FLOAT"},
  36. { name: "lang", type:"STRING"}, // default: "en"
  37. { name: "maxRows", type:"INTEGER", optional: true } // deault: 10
  38. ]
  39. },
  40. "getQuakes":{
  41. // Result : returns a list of earthquakes, ordered by magnitude
  42. "target" : "earthquakesJSON",
  43. "parameters" : [
  44. // bounding box coords:
  45. { name: "north", type:"FLOAT" },
  46. { name: "south", type:"FLOAT" },
  47. { name: "east", type:"FLOAT" },
  48. { name: "west", type:"FLOAT" },
  49. { name: "date", type:"STRING",optional: true }, // yyyy-MM-dd
  50. { name: "minMagniture", type:"INTERGER",optional: true },
  51. { name: "maxRows", type:"INTEGER", optional: true } // deault: 10
  52. ]
  53. },
  54. "getWeather":{
  55. // Weather data is provided in the METAR (METeorological Aerodrome Report) format.
  56. // Result : returns a list of weather stations with the most recent weather observation
  57. "target" : "weatherJSON",
  58. "parameters" : [
  59. { name: "north", type:"FLOAT" },
  60. { name: "south", type:"FLOAT" },
  61. { name: "east", type:"FLOAT" },
  62. { name: "west", type:"FLOAT" },
  63. { name: "maxRows", type:"INTEGER",optional:true } // deault: 10
  64. ]
  65. },
  66. "getWeatherByICAO":{
  67. // Result : returns the weather station and the most recent weather observation for the ICAO code
  68. "target": "weatherIcaoJSON",
  69. "parameters": [
  70. { name:"ICAO", type:"STRING" }
  71. ]
  72. },
  73. "getWeatherByCoords":{
  74. // Result : returns a weather station with the most recent weather observation
  75. "target": "findNearByWeatherJSON",
  76. "parameters": [
  77. { name:"lat", type:"FLOAT" },
  78. { name:"lng", type:"FLOAT" }
  79. ]
  80. },
  81. "getChildren":{
  82. // Returns the children for a given geonameId. The children are the
  83. // administrative divisions within an other administrative division.
  84. // Like the counties (ADM2) in a state (ADM1) or also the countries
  85. // in a continent.
  86. "target": "childrenJSON",
  87. "parameters": [
  88. { name:"geonameId", type:"INTEGER" }
  89. ]
  90. },
  91. "getHierarchy":{
  92. // Result : returns a list of GeoName records, ordered by hierarchy
  93. // level. The top hierarchy (continent) is the first element in the list
  94. "target": "hierarchyJSON",
  95. "parameters": [
  96. { name:"geonameId", type:"INTEGER" }
  97. ]
  98. },
  99. "getNeighbours":{
  100. // The neighbourhood for US cities. Data provided by Zillow under cc-by-sa license.
  101. "target":"neighboursJSON",
  102. "parameters": [
  103. { name:"geonameId", type:"INTEGER" }
  104. //{ name:"lat", type:"FLOAT" },
  105. //{ name:"long", type:"FLOAT" }
  106. ]
  107. },
  108. "getNeighbourhood":{
  109. // returns the neighbourhood for the given latitude/longitude
  110. // Example http://ws.geonames.org/neighbourhood?lat=40.78343&lng=-73.96625
  111. "target":"neighbourhoodJSON",
  112. "parameters":[
  113. { name:"lat", type:"FLOAT" },
  114. { name:"lng", type:"FLOAT" },
  115. { name:"radius", type:"FLOAT" }
  116. ]
  117. },
  118. "getSiblings":{
  119. // Result : returns a list of GeoNames records that have the same
  120. // administrative level and the same father
  121. "target":"siblingsJSON",
  122. "parameters": [
  123. { name:"geonameId", type:"INTEGER" }
  124. ]
  125. },
  126. "getCountryCode":{
  127. // returns the iso country code for the given latitude/longitude
  128. // With the parameter type=xml this service returns an xml document
  129. // with iso country code and country name. The optional parameter
  130. // lang can be used to specify the language the country name should
  131. // be in. JSON output is produced with type=JSON
  132. "target":"countryCode",
  133. "parameters": [
  134. { name:"lat", type:"FLOAT" },
  135. { name:"lng", type:"FLOAT" },
  136. { name:"lang", type:"STRING",optional:true },
  137. { name:"radius", type:"FLOAT" }
  138. ]
  139. },
  140. "getCountrySubdivision":{
  141. // returns the country and the administrative subdivison (state, province,...) for the given latitude/longitude
  142. // Example http://ws.geonames.org/countrySubdivisionJSON?lat=47.03&lng=10.2
  143. "target":"countrySubdivisionJSON",
  144. "parameters":[
  145. { name:"lat", type:"FLOAT" },
  146. { name:"long", type:"FLOAT" },
  147. { name:"radius", type:"FLOAT" }
  148. ]
  149. },
  150. "getWikipediaBoundingBox":{
  151. // returns the wikipedia entries within the bounding box as xml document
  152. // Example http://ws.geonames.org/wikipediaBoundingBoxJSON?north=44.1&south=-9.9&east=-22.4&west=55.2
  153. "target":"wikipediaBoundingBoxJSON",
  154. "parameters":[
  155. { name: "north", type:"FLOAT" },
  156. { name: "south", type:"FLOAT" },
  157. { name: "east", type:"FLOAT" },
  158. { name: "west", type:"FLOAT" },
  159. { name: "lang", type:"STRING",optional:true }, // default: "en"
  160. { name: "maxRows", type:"INTEGER",optional:true } // default: 10
  161. ]
  162. },
  163. "searchWikipedia":{
  164. // returns the wikipedia entries found for the searchterm as xml document
  165. // Example http://ws.geonames.org/wikipediaSearchJSON?q=london&maxRows=10
  166. "target":"wikipediaSearchJSON",
  167. "parameters":[
  168. { name: "q", type:"STRING" }, // place name?
  169. { name: "title", type:"STRING" }, // optional
  170. { name: "lang", type:"FLOAT",optional:true }, // de or en
  171. { name: "maxRows", type:"INTEGER",optional:true } // default: 10
  172. ]
  173. },
  174. "getTimezone":{
  175. // the timezone at the lat/lng with gmt offset (1. January) and dst offset (1. July)
  176. "target":"timezoneJSON",
  177. "parameters":[
  178. { name:"lat", type:"FLOAT" },
  179. { name:"lng", type:"FLOAT" }
  180. ]
  181. },
  182. "search":{
  183. // returns the names found for the searchterm as xml or json document,
  184. // the search is using an AND operator
  185. "target":"searchJSON",
  186. "parameters":[
  187. // exhaustive list. see: http://www.geonames.org/export/geonames-search.html
  188. { name:"q", type:"STRING" },
  189. { name:"name", type:"STRING" },
  190. { name:"name_equals", type:"STRING" },
  191. // optional:
  192. { name:"maxRows", type:"INTEGER",optional:true }, // def: 100, max:1000
  193. { name:"startRow", type:"INTEGER",optional:true }, // def: 0
  194. { name:"country", type:"STRING",optional:true }, // iso-3166, def: all
  195. /* name:"adminCode..." */
  196. { name:"featureClass", type:"STRING",optional:true}, // ? multi, enum(a,h,l,p,r,s,t,u,v)
  197. { name:"featureCode", type:"STRING",optional:true},
  198. { name:"lang", type:"STRING",optional:true}, // iso-636
  199. { name:"type", type:"STRING",optional:true}, // xml | json | rdf, def: xml
  200. { name:"style", type:"STRING",optional:true }, // SHORT,MEDIUM,LONG,FULL def: MEDIUM
  201. { name:"isNamedRequired", type:"BOOLEAN", optional:true }
  202. ]
  203. },
  204. "postalCodeLookup":{
  205. // returns a list of places for the given postalcode in JSON format
  206. // Example http://ws.geonames.org/postalCodeLookupJSON?postalcode=6600&country=AT
  207. "target":"postalCodeLookupJSON",
  208. "parameters":[
  209. { name:"postalcode", type:"STRING" },
  210. { name:"country", type:"STRING",optional:true},
  211. { name:"maxRows", type:"INTEGER", optional:true }, // def: 20
  212. { name:"charset", type:"STRING",optional:true } // def: utf-8
  213. ]
  214. },
  215. "postalCodeSearch":{
  216. "target":"postalCodeSearchJSON",
  217. "parameters":[
  218. { name:"postalcode", type:"STRING",optional:true}, // one or the other
  219. { name:"placename", type:"STRING",optional:true }, // one or the other
  220. { name:"country", type:"STRING",optional:true},
  221. { name:"style", type:"STRING",optional:true}, // def: MEDIUM
  222. { name:"maxRows", type:"INTEGER",optional:true}, // def: 20
  223. { name:"charset", type:"STRING",optional:true} // def: utf-8
  224. ]
  225. }
  226. // TODO: implement:
  227. // findNearby,
  228. // findNearbyPlaceName
  229. // findNearbyPostalCodes,
  230. // findNearbyStreets,
  231. // findNearByWeather
  232. // findNearByWikipedia
  233. // findNeareastAddress
  234. // findNearestInterestion
  235. // get
  236. // gtop30
  237. // srtm3
  238. } // end services
  239. }