[GRASS-user] Removing detail from polygons

Dylan Beaudette dylan.beaudette at gmail.com
Thu Aug 3 14:31:26 EDT 2006


On Thursday 27 July 2006 02:18, Markus Neteler wrote:
> On Thu, Jul 27, 2006 at 09:34:16AM +1200, Brent Wood wrote:
> > Jose Gomez-Dans wrote:
> > >Hi!
> > >I have a large shapefile with polygons. It takes a long time to load
> > >it into GRASS with ogr, but my question is other. I only need to use
> > >this polygon for drawing "informal" maps (i.e., they don't need to be
> > >accurate). The detail of these polygons is huge, so that if I use plot
> > >them with GMT or any other tool, I get massive EPS files. I don't need
> > >most of those vetices. Ideally, I'd like to specify some distance so
> > >that I get a single line, rather than a myriad lines. I thought
> > >v.clean could do this, but I am unsure whether it is the right tool or
> > >not.
> >
> > I've used PostGIS for manah\ging spatial data. It is possibly overkill
> > for what you are asking, but using the shp2pgsql program that come with
> > it, you can easily load a shapefile into PostGIS. You can then easily
> > simplify the geometry & use pgsql2shp to export the new version. I have
> > used it for making scale dependent layers of the same data for plotting
> > purposes, nmuch like you seem to be requiring.
> >
> > The PosGIS simplify() function is an implementation of the
> > Peuker-Douglas algorithm which is commonly used for this purpose. IT is
> > quite handy, in that despite the function operating in projection units,
> > you can wrap it in transform(), so you can take a lat/long geometry,
> > transform to an appropriate meter based equidistant projection, simplify
> > & project back again in a single SQL statement.
> >
> > ie: transform(simplify(transform(geometry)))
>
> Hi Brent,
>
> while I would love to see Douglas-Peucker implemented in v.clean
> or a v.generalize (the GMT site has a C implementation of it),
> I wonder about simply features versus topology issues:
>
> http://mpa.itc.it/markus/como2006/img8.html
> -> done in PostGIS (freegis.org world map simplified from VMAP0)
>
> http://mpa.itc.it/markus/como2006/img9.html
> -> done in GRASS
>
> The latter looks better to me.
>
> Markus
>

This is a good point. How exactly do the two methods differ in terms of 
vertex / node removal ? 

A little digging on google found an interesting page on the topic:

http://geometryalgorithms.com/Archive/algorithm_0205/#Douglas-Peucker%20Algorithm

Perhaps this would be a fun project for later in the summer when things slow 
down a bit...

Cheers,

Dylan

-- 
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341




More information about the grass-user mailing list