Click here to get back home

Douglas-Peucker Algorithm , VB6

 HomeNewsGroups | Search | About
 comp.infosystems.gis    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Douglas-Peucker Algorithm , VB6 Jacquelin Hardy 12-08-2005
Posted by Jacquelin Hardy on December 8, 2005, 1:07 pm
Please log in for more thread options
Hello group,

I have been trying hard to find a version of the
Douglas-Peucker algorithm in Visual Basic 6, without result so far. As I do
not know C or C++, I cannot make out what Google can find for the subject. A
good explanation of the algorithm in plain language would suite me right.

Thank you all

Jacquelin Hardy
from cold Canada



Posted by Mateusz Loskot on December 8, 2005, 4:33 pm
Please log in for more thread options
Hi,
Here is a good explanation with Pseudo-code examples. Yes, there is
also full implementation in C++ at the end of this article but I think
pseudo-code parts will be helpful.

http://geometryalgorithms.com/Archive/algorithm_0205/

Here is C++ implementation but the article provides a very good
explanation on figures:

http://www.codeproject.com/cpp/dphull.asp

Cheers
--
Mateusz Loskot
http://mateusz.loskot.net


Posted by Paul Cooper on December 8, 2005, 4:57 pm
Please log in for more thread options
On Thu, 8 Dec 2005 13:07:58 -0500, "Jacquelin Hardy"

>Hello group,
>
> I have been trying hard to find a version of the
>Douglas-Peucker algorithm in Visual Basic 6, without result so far. As I do
>not know C or C++, I cannot make out what Google can find for the subject. A
>good explanation of the algorithm in plain language would suite me right.
>
>Thank you all
>
>Jacquelin Hardy
>from cold Canada
>
As follows:

Mark all vertices for discard.

Find the furthest vertex from the line joing the endpoints.

If ( further away than the threshold distance) Then {
Mark the vertex for retention
Repeat for each subsection.
} else stop


This is a classic recursive algorithm - you can actually implement it
in very few lines of code. If you haven't done it before, the only
slightly tricky bit is the formula for the distance of a point from a
line - and that's a one-liner.

Paul

Similar ThreadsPosted
Polyline labeling algorithm November 13, 2005, 10:58 pm
Point in Polygon-Algorithm August 29, 2006, 9:19 am
Quadtree spatial indexing Algorithm October 18, 2005, 6:32 am
dykstra's algorithm for trip routing January 24, 2006, 8:46 pm
Help Need: Algorithm or Code for Computing Quantiles February 1, 2006, 6:24 pm
Area of Polygon on a Sphere - Algorithm September 7, 2006, 5:03 pm
Using a Quadtree Algorithm To Assess Line of Sight February 27, 2006, 2:51 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap