[SciPy-User] [SciPy-user] Selection of dominant points

Charles Vejnar ce@vejnar...
Mon Jul 27 11:20:29 CDT 2009


Hi,

Thank you. I wasn't looking in the right direction.

After intensive googling, I found Python implementations of Ramer-Douglas-
Peucker algorithm:
http://mappinghacks.com/2008/05/05/douglas-peucker-line-simplification-in-
python/
It was derived from this one:
http://mappinghacks.com/code/PolyLineReduction/
I also found one here:
http://cvs.linuxcnc.org/cvs/emc2/lib/python/rs274/author.py?rev=1.1

This algorithm is working perfectly on my data. Thanks again.

Charles

On Saturday 25 July 2009, Joe Kington wrote:
> Well, I thought shapely <http://trac.gispython.org/lab/wiki/Shapely> would
> have some sort of line-generalization capabilities, but apparently it
> doesn't.
>
> You may already be aware of this, but algorithm wise, you're looking for
> the Douglas-Peucker
> algorithm<http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm>,
> or something similar.
>
> If you don't want to mess with implementing it yourself, you might want to
> look at grass <http://grass.itc.it/>.  Grass has a
> generalize<http://grass.osgeo.org/wiki/V.generalize_tutorial>function
> that should do what you need, and does have at least some python
> bindings.  I've never actually used the python bindings for
> grass<http://download.osgeo.org/grass/grass6_progman/pythonlib.html>,
> so I can't help you too much there...
>
> Hope that helps, at any rate!
> -Joe
>
> On Fri, Jul 24, 2009 at 11:45 PM, David Warde-Farley 
<dwf@cs.toronto.edu>wrote:
> > On 24-Jul-09, at 11:47 AM, Charles Vejnar wrote:
> > > Hi,
> > >
> > > I have a curve with millions of points which is non-standard (i.e.
> > > it's not a
> > > gaussian or ...).
> > >
> > > I would like to select about 500 points which best describe the curve
> > > (something like selecting dominant points).
> >
> > It would be helpful to know more about the problem.  Like:
> > - are the points evenly spaced along the independent axis?
> > - are they assumed to be samples from a continuous signal?
> > - does the signal have any known structure at all? If you could
> > describe where these data come from it might help nail down what
> > methods would be appropriate.
> >
> > Regards,
> >
> > David
> > _______________________________________________
> > SciPy-User mailing list
> > SciPy-User@scipy.org
> > http://mail.scipy.org/mailman/listinfo/scipy-user
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user


More information about the SciPy-User mailing list