<div dir="ltr">Thank you Frank ! Very much appreciated. I'll give 'Simplify' option a try. <div><br></div><div style>Jeff</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 19, 2013 at 3:25 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">Jeff,<br>
<br>
I believe this is exposed in ogr2ogr using the -simplify argument:<br>
<br>
-simplify tolerance:<br>
(starting with GDAL 1.9.0) distance tolerance for simplification.<br>
Note: the algorithm used preserves topology per feature, in particular<br>
for polygon geometries, but not for a whole layer.<br>
<br>
Best regards,<br>
Frank<br>
<div class="HOEnZb"><div class="h5"><br>
On Tue, Feb 19, 2013 at 12:12 PM, Jeff Lacoste<br>
<<a href="mailto:jefflacostegdal@gmail.com">jefflacostegdal@gmail.com</a>> wrote:<br>
> Yes visually attractive or smooth polygons is the goal. Thanks again Frank.<br>
><br>
> Doing a web search about simplification algorithm i found one named<br>
> 'Ramer-Douglas–Peucker'<br>
> (<a href="http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm" target="_blank">http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm</a>).<br>
> It appears that 'Geos'' library implement this algorithm. Is this algorithm<br>
> exposed through OGR ?<br>
><br>
> Could this algorithm help smoothing a polygon without necessary make the new<br>
> nodes too far from the original one ? Or may be there<br>
> are other *more* recommended algorithms ?<br>
><br>
> If any one could suggest a simplification algorithm or had some experience<br>
> with smoothing polygons, I appreciate their input.<br>
><br>
> Thanks<br>
><br>
> Jeff<br>
><br>
><br>
><br>
><br>
> On Tue, Feb 19, 2013 at 2:42 PM, Frank Warmerdam <<a href="mailto:warmerdam@pobox.com">warmerdam@pobox.com</a>><br>
> wrote:<br>
>><br>
>> 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<br>
>> > 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<br>
>> > the<br>
>> > polygon. However for continuous grid (.ex elevations), the boundaries<br>
>> > 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<br>
>> > 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<br>
>> > does<br>
>> > by treating the raster values as continuous.<br>
>><br>
>> 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>
>><br>
>> Best regards,<br>
>> --<br>
>><br>
>> ---------------------------------------+--------------------------------------<br>
>> I set the clouds in motion - turn up   | Frank Warmerdam,<br>
>> <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>
><br>
><br>
<br>
<br>
<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>