<?xml version="1.0" encoding="utf-8" ?>
<ignite version="1.0" source="geonames.org">

  <func name="countryInfo" endpoint="http://api.geonames.org/countryInfo?" method="GET" format="XML"  >
    <description>
      This function returns country information given a two letter country code, from geonames.org.
    </description>
    <example>
      =Ignite("geonames.org","countryInfo","countryName","DE")
    </example>
    <inputs>
      <input name="country" type ="input1"/>
      <input name="username" type="config" value="enclout"/>
      <input name="lang" type="config" value="en"/>
    </inputs>
    <outputs>
      <output name="countryCode" path="//countryCode"/>
      <output name="countryName" path="//countryName"/>
      <output name="isoNumeric" path="//isoNumeric"/>
      <output name="isoAlpha3" path="//isoAlpha3"/>
      <output name="fipsCode" path="//fipsCode"/>
      <output name="continent" path="//continent"/>
      <output name="continentName" path="//continentName"/>
      <output name="capital" path="//capital"/>
      <output name="areaInSqKm" path="//areaInSqKm"/>
      <output name="population" path="//population"/>
      <output name="currencyCode" path="//currencyCode"/>
      <output name="languages" path="//languages"/>
      <output name="postalCodeFormat" path="//postalCodeFormat"/>
      <output name="ALL" path="" />
    </outputs>
  </func>

  <func name="postalCode" endpoint="http://api.geonames.org/postalCodeLookupJSON?" method="GET" format="JSON" jsonRootForXML="postal" >
    <description>
      This function returns location information given a two letter country code and a zip code, from geonames.org.
    </description>
    <example>
      =Ignite("geonames.org","postalCode","placeName","US", "61101")
    </example>
    <inputs>
      <input name="country" type ="input1"/>
      <input name="postalcode" type ="input2"/>
      <input name="username" type="config" value="enclout"/>
    </inputs>
    <outputs>
      <output name="placeName" path="//placeName"/>
      <output name="lng" path="//lng"/>
      <output name="lat" path="//lat"/>
      <output name="adminName1" path="//adminName1"/>
      <output name="adminCode1" path="//adminCode1"/>
      <output name="adminCode2" path="//adminCode2"/>
      <output name="adminName2" path="//adminName2"/>
      <output name="adminCode3" path="//adminCode3"/>
      <output name="adminName3" path="//adminName3"/>
      <output name="postalcode" path="//postalcode"/>
      <output name="countryCode" path="//countryCode"/>
      <output name="ALL" path="" />
    </outputs>
  </func>

  <examples>
    <![CDATA[
<table border='1' class='ExcelTable2007'>
<tr><th class='heading'>&nbsp;</th><th>A</th><th>B (Forumla)</th><th>C (Output) </th></tr>
<tr><td class='heading' >1</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","countryCode",A1)</td>
<td>DE</td>
</tr>
<tr><td class='heading' >2</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","countryName",A2)</td>
<td>Germany</td>
</tr>
<tr><td class='heading' >3</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","isoNumeric",A3)</td>
<td>276</td>
</tr>
<tr><td class='heading' >4</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","isoAlpha3",A4)</td>
<td>DEU</td>
</tr>
<tr><td class='heading' >5</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","fipsCode",A5)</td>
<td>GM</td>
</tr>
<tr><td class='heading' >6</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","continent",A6)</td>
<td>EU</td>
</tr>
<tr><td class='heading' >7</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","continentName",A7)</td>
<td>Europe</td>
</tr>
<tr><td class='heading' >8</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","capital",A8)</td>
<td>Berlin</td>
</tr>
<tr><td class='heading' >9</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","areaInSqKm",A9)</td>
<td>357021</td>
</tr>
<tr><td class='heading' >10</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","population",A10)</td>
<td>81802257</td>
</tr>
<tr><td class='heading' >11</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","currencyCode",A11)</td>
<td>EUR</td>
</tr>
<tr><td class='heading' >12</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","languages",A12)</td>
<td>de</td>
</tr>
<tr><td class='heading' >13</td>
<td>DE</td>
<td>=Ignite("geonames.org","countryInfo","postalCodeFormat",A13)</td>
<td>#####</td>
</tr>
</table>
<br/><br/>

<table border='1' class='ExcelTable2007'>
<tr><th class='heading'>&nbsp;</th><th>A</th><th>B</th><th>C (Forumla)</th><th>D (Output) </th></tr>
<tr><td class='heading' >1</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","placeName",A1,B1)</td>
<td>Rockford</td>
</tr>
<tr><td class='heading' >2</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","lng",A2,B2)</td>
<td>-89.116118</td>
</tr>
<tr><td class='heading' >3</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","lat",A3, B3)</td>
<td>42.292233</td>
</tr>
<tr><td class='heading' >4</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","adminName1",A4, B4)</td>
<td>Illinois</td>
</tr>
<tr><td class='heading' >5</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","adminCode1",A5, B5)</td>
<td>IL</td>
</tr>
<tr><td class='heading' >6</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","adminName2",A6, B6)</td>
<td>Winnebago</td>
</tr>
<tr><td class='heading' >7</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","adminCode2",A7, B7)</td>
<td>201</td>
</tr>
<tr><td class='heading' >8</td>
<td>US</td><td>61101</td>
<td>=Ignite("geonames.org","postalCode","postalcode",A8, B8)</td>
<td>61101</td>
</tr>
<tr><td class='heading' >6</td>
<td>GB</td><td>ne616yf</td>
<td>=Ignite("geonames.org","postalCode","adminName3",A9, B9)</td>
<td>Northumberland</td>
</tr>
<tr><td class='heading' >7</td>
<td>GB</td><td>ne616yf</td>
<td>=Ignite("geonames.org","postalCode","adminCode3",A10, B10)</td>
<td>E06000048</td>
</tr>
</table>

      ]]>
  </examples>

</ignite>
