1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width, initial-scale=1.0"><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/bootstrap.min.css" rel="stylesheet" type="text/css"><link href="../assets/css/bootstrap-responsive.min.css" rel="stylesheet" type="text/css"><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" href="../rss.xml"></head><body>
- <!-- Menubar -->
- <div class="navbar navbar-fixed-top">
- <div class="navbar-inner">
- <div class="container">
- <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- <span class="icon-bar"></span>
- </a>
- <a class="brand" href="../">
- Pleasant Programmer
- </a>
- <!-- Everything you want hidden at 940px or less, place within here -->
- <div class="nav-collapse collapse">
- <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></ul><ul class="nav pull-right"><li>
- <a href="elevation-data-in-otp.md" id="sourcelink">Source</a>
- </li>
- </ul></div>
- </div>
- </div>
- </div>
- <!-- End of Menubar -->
- <div class="container-fluid" id="container-fluid">
- <!--Body content-->
- <div class="row-fluid">
- <div class="span2"></div>
- <div class="span8">
-
- <div class="postbox">
-
- <h1>Elevation Data in OTP</h1>
- <hr><small>
- Posted: <time class="published" datetime="2013-07-23T18:23:00+08:00">2013-07-23 18:23</time>
-
-
- | 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>
- <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"><li class="previous">
- <a href="graphserver.html">← Previous 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>
- <!--End of body content-->
- </div>
- <div class="footerbox">
- <a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/deed.en_US"><img alt="Creative Commons License" 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>
- </div>
- <script src="../assets/js/jquery-1.7.2.min.js" type="text/javascript"></script><script src="../assets/js/bootstrap.min.js" type="text/javascript"></script><script src="../assets/js/jquery.colorbox-min.js" type="text/javascript"></script><script type="text/javascript">jQuery("a.image-reference").colorbox({rel:"gal",maxWidth:"80%",maxHeight:"80%",scalePhotos:true});</script></body></html>
|