Posts Tagged ‘Altitude’

Woeid’s altitude service.

Sunday, January 3rd, 2010

Was reading Geonames Api Documentations and a service providing elevation data from the Aster Global Digital Elevation Model on tiles of 30m x 30 m. The only problem with this services was that it only took long/lats. I wrote a small wrapper providing this service for WOEID (http://www.geomojo.org/cgi-bin/getaltitude.cgi).

To get the elevation of a point just call the service with either the ‘woeid’ parameter or the ‘long’ and ‘lat’ parameters.

http://www.geomojo.org/cgi-bin/getaltitude.cgi?woeid=44418:

<altitudepoint>
<woeid>44418</woeid>
<long>-0.127140</long>
<lat>51.506321</lat>
<altitude>21</altitude>
</altitudepoint>

http://www.geomojo.org/cgi-bin/getaltitude.cgi?long=-0.27140&lat=51.506321:

<altitudepoint>
<woeid>26352796</woeid>
<long>-0.271400</long>
<lat>51.506321</lat>
<altitude>22</altitude>
</altitudepoint>

You can also select the output format by using the ‘format’ parameter. The only supported format are JSON and XML

I also added an extra functionality that returns the elevations between two points. This services could be useful to view the relief between two points of course the distance between the points should be much great than 30 m.

This service take two points either WOEID’s or long/lats and an extra stepping parameters.

http://www.geomojo.org/cgi-bin/getaltitude.cgi?fromWoeid=44418&toWoeid=26352796&steps=5:

<altitudepoints>
<altitudepoint>
<woeid/>
<long>-0.127140</long>
<lat>51.506321</lat>
<altitude>21</altitude>
</altitudepoint>
<altitudepoint>
<woeid/>
<long>-0.156974</long>
<lat>51.509502</lat>
<altitude>27</altitude>
</altitudepoint>
<altitudepoint>
<woeid/>
<long>-0.186808</long>
<lat>51.512684</lat>
<altitude>28</altitude>
</altitudepoint>
<altitudepoint>
<woeid/>
<long>-0.216642</long>
<lat>51.515865</lat>
<altitude>16</altitude>
</altitudepoint>
<altitudepoint>
<woeid/>
<long>-0.246476</long>
<lat>51.519047</lat>
<altitude>9</altitude>
</altitudepoint>
<altitudepoint>
<woeid/>
<long>-0.276310</long>
<lat>51.522228</lat>
<altitude>47</altitude>
</altitudepoint>
</altitudepoints>

Here are the list of parameters for this service:

  • woeid: the woeid of the place for which the elevation is needed
  • long: the longitude of the place for which the elevation is needed
  • lat: the latitude of the place for which the elevation is needed
  • format: the output format of the service supports JSON or XML
  • fromWoeid, toWoeid: the WOEID’s of the places for which the list elevations are needed
  • fromLong: the longitude of the place from which the list of elevations are needed.
  • fromLat: the latitude of the place from which the list of elevations are needed.
  • toLong: the longitude of the place to which the list of elevations are needed.
  • toLat: the latitude of the place to which the list of elevations are needed.
  • steps: Numbers of samples between the two points provided.