<div dir="ltr">Yes visually attractive or smooth polygons is the goal. Thanks again Frank.<div><br></div><div style>Doing a web search about simplification algorithm i found one named '<b style="font-size:13px;color:rgb(0,0,0);font-family:sans-serif;line-height:19.1875px">Ramer-Douglas–Peucker' (</b><a href="http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm">http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm</a>).</div>
<div style>It appears that 'Geos'' library implement this algorithm. Is this algorithm exposed through OGR ?</div><div style><br></div><div style>Could this algorithm help smoothing a polygon without necessary make the new nodes too far from the original one ? Or may be there</div>
<div style>are other *more* recommended algorithms ?</div><div style><br></div><div>If any one could suggest a simplification algorithm or had some experience with smoothing polygons, I appreciate their input.</div><div><br>
</div><div>Thanks</div><div><br></div><div>Jeff<br><div><br></div><div><br></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 19, 2013 at 2:42 PM, Frank Warmerdam <span dir="ltr"><<a href="mailto:warmerdam@pobox.com" target="_blank">warmerdam@pobox.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, Feb 19, 2013 at 11:28 AM, Jeff Lacoste<br>
<<a href="mailto:jefflacostegdal@gmail.com">jefflacostegdal@gmail.com</a>> wrote:<br>
> Hi Frank,<br>
><br>
> Thanks for your quick response. Following the edges of the pixels seems a<br>
> perfect solution for non continuous grid (ex. land use, etc.) as<br>
> the boundary between the class is important to keep when constructing the<br>
> polygon. However for continuous grid (.ex elevations), the boundaries are<br>
> a bit not clear and not clear cut. When following the pixels edges, the<br>
> created polygons appear to have the stairs effect and are less visually<br>
> attractive.<br>
><br>
> I thought of a smoothing the polygons to not have *rough* edges using the<br>
> current gdal_polygonize by trying to not follow the pixels edges and use<br>
> instead of the<br>
> pixel centers. Basically do something similar to what contour generator does<br>
> by treating the raster values as continuous.<br>
<br>
</div>Jeff,<br>
<br>
Ah, I see, you are looking for visually attractive polygons from<br>
continuous fields.<br>
<br>
I have wondered if it would be reasonable to produce a version of the<br>
contour generator that actually produces polygon regions. If we had<br>
that then applying appropriate simplification to the resulting very<br>
detailed edges should give something attractive and with reasonable<br>
information density. An appropriate simplification algorithm might do<br>
this in a reasonable way for the existing polygonize output but I<br>
don't know enough about the simplification algorithms to suggest one.<br>
<br>
I don't think aiming for pixel centers in gdal_polygonize would really<br>
solve the problem.<br>
<div class="HOEnZb"><div class="h5"><br>
Best regards,<br>
--<br>
---------------------------------------+--------------------------------------<br>
I set the clouds in motion - turn up | Frank Warmerdam, <a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a><br>
light and sound - activate the windows | <a href="http://pobox.com/~warmerdam" target="_blank">http://pobox.com/~warmerdam</a><br>
and watch the world go round - Rush | Geospatial Software Developer<br>
</div></div></blockquote></div><br></div>