geocoding-services.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <!DOCTYPE html>
  2. <html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " vocab="http://ogp.me/ns" lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width">
  6. <title>Geocoding Services | Pleasant Programmer</title>
  7. <link href="../assets/css/rst.css" rel="stylesheet" type="text/css">
  8. <link href="../assets/css/code.css" rel="stylesheet" type="text/css">
  9. <link href="../assets/css/theme.css" rel="stylesheet" type="text/css">
  10. <link href="../assets/css/custom.css" rel="stylesheet" type="text/css">
  11. <link rel="alternate" type="application/rss+xml" title="RSS" href="../rss.xml">
  12. <link rel="canonical" href="http://pleasantprogrammer.com/posts/geocoding-services.html">
  13. <script type="text/javascript" src="//use.typekit.net/iwm5axp.js"></script><script type="text/javascript">try{Typekit.load();}catch(e){}</script><!--[if lt IE 9]><script src="../assets/js/html5.js"></script><![endif]--><meta name="author" content="Thomas Dy">
  14. <link rel="prev" href="jeep-and-bus-schedules.html" title="Jeep and Bus Schedules" type="text/html">
  15. <link rel="next" href="console-keymap-switching.html" title="Console Keymap Switching" type="text/html">
  16. <meta property="og:site_name" content="Pleasant Programmer">
  17. <meta property="og:title" content="Geocoding Services">
  18. <meta property="og:url" content="http://pleasantprogrammer.com/posts/geocoding-services.html">
  19. <meta property="og:description" content="A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even the">
  20. <meta property="og:type" content="article">
  21. <meta property="article:published_time" content="2013-09-25T12:26:59+08:00">
  22. <meta property="article:tag" content="philippine-transit-app">
  23. <meta property="article:tag" content="programming">
  24. </head>
  25. <body>
  26. <a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>
  27. <header id="header" role="banner"><div class="thomas">
  28. <img src="../assets/img/thomas.gif" alt="DJ THOMAS IN DA HAUS"><img src="../assets/img/thomas.png" alt="Pleasant Programmer">
  29. </div>
  30. <h1 id="brand"><a href="http://pleasantprogrammer.com/" title="Pleasant Programmer" rel="home">
  31. <span id="blog-title">Pleasant Programmer</span>
  32. </a></h1>
  33. <nav id="menu" role="navigation"><ul>
  34. <li class="twitter"><a href="http://twitter.com/pleasantprog">@pleasantprog</a></li>
  35. <li><a href="../archive.html">Archives</a></li>
  36. <li><a href="../categories/index.html">Tags</a></li>
  37. <li><a href="../rss.xml">RSS</a></li>
  38. </ul></nav></header><div id="container">
  39. <main id="content" role="main"><article class="post-text h-entry hentry postpage" itemscope="itemscope" itemtype="http://schema.org/Article"><header><h1 class="p-name entry-title" itemprop="headline name"><a href="#" class="u-url">Geocoding Services</a></h1>
  40. <small>
  41. <span class="dateline">Posted: <a href="#" rel="bookmark"><time class="published dt-published" datetime="2013-09-25T12:26:59+08:00" itemprop="datePublished" title="2013-09-25 12:26">2013-09-25 12:26</time></a></span>
  42. |
  43. More posts about
  44. <a class="tag p-category" href="../categories/philippine-transit-app.html" rel="tag">philippine-transit-app</a>
  45. <a class="tag p-category" href="../categories/programming.html" rel="tag">programming</a>
  46. </small>
  47. </header><div class="e-content entry-content" itemprop="articleBody text">
  48. <div>
  49. <p>A key component for any routing service is being able to do geocoding. Most people who are looking for routes most probably don't know exactly where their start and end points are on the map. Even then, manually looking for a location on a map is a time-consuming task.</p>
  50. <p>The gold standard for doing geocoding right now is Google Maps. It's hard to find a better location search experience. If they actually provided routing for jeeps here in the Philippines, I imagine there wouldn't be <em>that</em> much you could do for the competition.</p>
  51. <p>When the competition started though, I took it as a challenge to avoid Google Maps as much as possible. I wanted to see how much is currently possible with other options such as OpenStreetMap. In fact, OSM does have a geocoding service called <a href="http://nominatim.openstreetmap.org">Nominatim</a>.</p>
  52. <p>Sadly, for a mapping app, what you want to do is not simply just geocoding. With geocoding, you take an address and turn it into coordinates. When you want to search for a place in a mapping app, you take part of an address, infer the rest of it, and give the user options to choose from.</p>
  53. <p>Given a typical mapping app, you might type in "ateneo" and expect it to give you Ateneo de Manila University. With typical geocoding services like Nominatim or even Google's <a href="https://developers.google.com/maps/documentation/javascript/geocoding">geocoding API</a>, you probably won't get any result for this. What you want to use is the <a href="https://developers.google.com/maps/documentation/javascript/places">Places API</a> which provides an autocomplete search box. Using it, when you type in "ateneo", it automatically suggests in the dropdown, "Ateneo de Manila University".</p>
  54. <p>A downside to using the Places API is that it's against the terms of service to use it with something that isn't Google Maps, which means no OpenStreetMap. If there were more time, writing your own autocompletion engine using OpenStreetMap's data will probably be a better long term solution.</p>
  55. <p>For now, since the competition's deadline is just a few days away, I'll be using Google Maps.</p>
  56. </div>
  57. </div>
  58. <aside class="postpromonav"><nav><ul class="pager clearfix">
  59. <li class="previous">
  60. <a href="jeep-and-bus-schedules.html" rel="prev" title="Jeep and Bus Schedules">← Previous post</a>
  61. </li>
  62. <li class="next">
  63. <a href="console-keymap-switching.html" rel="next" title="Console Keymap Switching">Next post →</a>
  64. </li>
  65. </ul></nav></aside><section class="comments"><div id="disqus_thread"></div>
  66. <script>
  67. var disqus_shortname ="pleasantprog",
  68. disqus_url="http://pleasantprogrammer.com/posts/geocoding-services.html",
  69. disqus_title="Geocoding Services",
  70. disqus_identifier="cache/posts/geocoding-services.html",
  71. disqus_config = function () {
  72. this.language = "en";
  73. };
  74. (function() {
  75. var dsq = document.createElement('script'); dsq.async = true;
  76. dsq.src = '//' + disqus_shortname + '.disqus.com/embed.js';
  77. (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
  78. })();
  79. </script><noscript>Please enable JavaScript to view the <a href="//disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a>
  80. </noscript>
  81. <a href="//disqus.com" class="dsq-brlink" rel="nofollow">Comments powered by <span class="logo-disqus">Disqus</span></a>
  82. </section></article><script>var disqus_shortname="pleasantprog";(function(){var a=document.createElement("script");a.async=true;a.src="//"+disqus_shortname+".disqus.com/count.js";(document.getElementsByTagName("head")[0]||document.getElementsByTagName("body")[0]).appendChild(a)}());</script></main><footer id="footer" role="contentinfo"><p><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> © 2015 Thomas Dy - Powered by <a href="http://getnikola.com">Nikola</a></p>
  83. </footer>
  84. </div>
  85. <script src="../assets/js/konami.js"></script><script src="http://code.jquery.com/jquery-2.0.3.min.js"></script><script>
  86. var easter_egg = new Konami();
  87. easter_egg.code = function() {
  88. $(".thomas").toggleClass("whoa");
  89. $("body").scrollTop(0);
  90. }
  91. easter_egg.load();
  92. // love you, thomas!
  93. // yours, @_phi + @meggykawsek
  94. </script>
  95. </body>
  96. </html>