<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Wed, 19 Jun 2013 20:01:52 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[PHPRiot.com: Reducing a Map Path Using Douglas-Peucker Algorithm]]></title>
      <guid>http://www.phpdeveloper.org/news/16274</guid>
      <link>http://www.phpdeveloper.org/news/16274</link>
      <description><![CDATA[<p>
On PHPRiot.com there's a new tutorial showing you how to <a href="http://phpriot.com/articles/reducing-map-path-douglas-peucker-algorithm">use the Douglas-Peucker algorithm</a> to make the pathing on your map the simplest possible (the fewer points the better) having serious benefits a wide range of users, most notably those on mobile devices.
</p>
<blockquote>
When drawing a path on a map (for instance, the directions from point A to point B) it is important to consider the limitations of the device you're drawing the path on. In this article, I will show you how to reduce the number of points in a path so the path can be displayed with minimal loss of quality on devices such as iPhone or Android-powered devices that may struggle with an extremely large set of points.
</blockquote>
<p>
Using the <a href="http://code.google.com/transit/spec/transit_feed_specification.html">GTFS</a> service's data, he's been creating maps for an iPhone application. Naturally, a path with <a href="http://phpriot.com/assets/2223-58---e759">700 points</a> would take a lot of resources to render. Using the Douglas-Peucker algorithm he can reduce it down to a much more manageable <a href="http://phpriot.com/assets/ed88-59---8965">70 points</a>. He explains the algorithm briefly and hows how to implement it in PHP with three classes - ShapePoint, Shape and ShapeReducer. The resulting reduced dataset is then passed directly over to a Google Maps for plotting.
</p>]]></description>
      <pubDate>Fri, 29 Apr 2011 12:40:42 -0500</pubDate>
    </item>
  </channel>
</rss>
