1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="description" content=""><meta name="author" content="Thomas Dy"><title>Elevation Data in OTP | Pleasant Programmer</title><link href="../assets/css/rst.css" rel="stylesheet" type="text/css"><link href="../assets/css/code.css" rel="stylesheet" type="text/css"><link href="../assets/css/colorbox.css" rel="stylesheet" type="text/css"><link href="../assets/css/theme.css" rel="stylesheet" type="text/css"><link href="../assets/css/custom.css" rel="stylesheet" type="text/css"><!--[if lt IE 9]>
- <script src="http://html5shim.googlecode.com/svn/trunk/html5.js" type="text/javascript"></script>
- <![endif]--><link rel="alternate" type="application/rss+xml" title="RSS (en)" href="../rss.xml"></head><body>
- <div class="container">
- <div class="header">
- <h1 id="blog-title">
- <a href="../" title="Pleasant Programmer">Pleasant Programmer</a>
- </h1>
- <ul class="nav"><li><a href="../archive.html">Archives</a>
- </li><li><a href="../categories/index.html">Tags</a>
- </li><li><a href="../rss.xml">RSS</a>
- </li><li><a href="http://www.twitter.com/pleasantprog">@pleasantprog</a></li>
- <ul class="nav"></ul></ul></div>
- <div class="content">
-
- <div class="postbox">
- <div class="title">
-
- <h1>Elevation Data in OTP</h1>
- <hr><small>
- Posted: 2013-07-23 18:23
-
-
- | More posts about
- <a class="tag" href="../categories/philippine-transit-app.html"><span class="badge badge-info">philippine-transit-app</span></a>
- <a class="tag" href="../categories/programming.html"><span class="badge badge-info">programming</span></a>
- </small>
- </div>
- <hr><p><img alt="OpenTripPlanner showing elevation data" src="../galleries/transit/otpelevation.png"></p>
- <p>One thing I hadn't tested out last time was OTP's support for elevation data. It makes use of this by showing the elevation you have to traverse while walking along the suggested route. It can also take it into account when suggesting bike routes.</p>
- <p>The <a href="https://github.com/openplans/OpenTripPlanner/wiki/FiveMinutes">5 minute tutorial</a> actually discusses the elevation data briefly, but a more in-depth thing you can look at is the <a href="https://github.com/openplans/OpenTripPlanner/wiki/GraphBuilder#elevation-data">GraphBuilder documentation</a>. It suggests using the ASTER dataset which is free but requires registration. I just opted to use the SRTM data available from the <a href="http://www.philgis.org/freegisdata.htm">PhilGIS website</a>.</p>
- <p>I don't know about the ASTER dataset, but the PhilGIS data was in the ERDAS img format. OTP only supports GeoTIFF so there was a need to convert it beforehand. You can use <a href="http://www.gdal.org/">GDAL</a> for this. You'd just then run,</p>
- <div class="code"><pre> <span class="n">gdal_translate</span> <span class="n">srtm41_90m_phl</span><span class="p">.</span><span class="n">img</span> <span class="n">phil</span><span class="p">.</span><span class="n">tiff</span>
- </pre></div>
- <p>Afterwards, it's just a matter of following the OTP instructions on using a local elevation dataset. The process actually doubled the size of the generated Graph.obj so it might not be ideal if you're running on limited RAM.</p>
- <p>I've actually hosted a <a href="http://maps.pleasantprogrammer.com">working example</a>. It's pretty much at the limits of the RAM so it might be slow and unreliable, but you can test it out just for fun. Please don't abuse it though.</p>
-
- <ul class="pager clearfix"><li class="previous">
- <a href="graphserver.html">← Previous post</a>
- </li>
- <li class="next">
- <a href="highways-in-otp.html">Next post →</a>
- </li>
- </ul><div id="disqus_thread"></div>
- <script type="text/javascript">
- var disqus_shortname ="pleasantprog";
- var disqus_url="http://pleasantprogrammer.com/posts/elevation-data-in-otp.html";
- var disqus_title="Elevation Data in OTP";
- var disqus_identifier="cache/posts/elevation-data-in-otp.html";
- var disqus_config = function () {
- this.language = "en";
- };
- (function() {
- var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
- dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
- (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
- })();
- </script><noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
- </div>
- </div>
- <div class="footer"><small><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="CC-BY-SA" style="border-width:0" src="http://i.creativecommons.org/l/by-sa/3.0/80x15.png"></a> © 2013 Thomas Dy - Powered by <a href="http://nikola.ralsina.com.ar">Nikola</a></small></div>
- </div>
-
- </body></html>
|