Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-20 Thread Daniel Morissette
On 13-02-20 10:08 AM, Jeff Lacoste wrote: Daniel: Using 'SIA' technique sounds promising. Does it apply to polygons as well ? or just polylines ? I would be interested to test (and later use if applicable) your approach. If would like an extra tester, please let me know. Yes, our implementati

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-20 Thread Graeme B. Bell
"Graeme: Is your tracing technique a new algorithm different from GDAL_Polygonize ? Is there a C/C++ code I can build or may be an .exe utility I could use to try out ?" It is not my technique. Dan's utils were written by some heroic figure known only as Dan Stahlke. I have no idea who he is, but

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-20 Thread Jeff Lacoste
Thanks Mateusz. Is this limited to polylines only ? not polygons ? On Wed, Feb 20, 2013 at 10:19 AM, Mateusz Loskot wrote: > On 20 February 2013 15:08, Jeff Lacoste wrote: > > Thanks every one who responded to my post. > > > > Jeff: it appears that your approach involve smoothing the original

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-20 Thread Mateusz Loskot
On 20 February 2013 15:08, Jeff Lacoste wrote: > Thanks every one who responded to my post. > > Jeff: it appears that your approach involve smoothing the original grid > before generating contours (or polygons from it). Right ? It would be nice > if I could have the smoothing either as an after pr

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-20 Thread Jeff Lacoste
Thanks every one who responded to my post. Jeff: it appears that your approach involve smoothing the original grid before generating contours (or polygons from it). Right ? It would be nice if I could have the smoothing either as an after process operation or ideally as an option within the polygo

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-20 Thread Graeme B. Bell
> > > Yes visually attractive or smooth polygons is the goal. Thanks again Frank. > > Doing a web search about simplification algorithm i found one named > '*Ramer-Douglas?Peucker' > (*http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). > It appears that 'Geos'' library implement this

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Brian Case
a few years ago someone had posted some perl code for making polys from the contour output. the idea was to sort the lines into an m-way tree by contains with the root node being the extent of the data then each node would be outer ring and a copy of the children being the inner rings i have done

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Jeff Lake
It all depends on the data your having gdal_polygonize contour ... here is a snippet of what I'm doing with a csv I'm creating of current weather /usr/local/bin/gdal_grid -zfield "temp" -a invdist:power=2.0:smoothing=1:nodata=- -outsize 800 600 -l temp /var/www/html/metar/temp.vrt /var/w

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Daniel Morissette
Hi Jeff, FYI we have been working on smoothing contours produced by gdal_contour, and one of the issues that we encountered was having to deal with that same stair effect (even with contours we get it in some cases). I don't think that simplifying your polygons will be enough in your case, you

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Jeff Lacoste
Thank you Frank ! Very much appreciated. I'll give 'Simplify' option a try. Jeff On Tue, Feb 19, 2013 at 3:25 PM, Frank Warmerdam wrote: > Jeff, > > I believe this is exposed in ogr2ogr using the -simplify argument: > > -simplify tolerance: > (starting with GDAL 1.9.0) distance tolerance for si

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Frank Warmerdam
Jeff, I believe this is exposed in ogr2ogr using the -simplify argument: -simplify tolerance: (starting with GDAL 1.9.0) distance tolerance for simplification. Note: the algorithm used preserves topology per feature, in particular for polygon geometries, but not for a whole layer. Best regards,

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Jeff Lacoste
Yes visually attractive or smooth polygons is the goal. Thanks again Frank. Doing a web search about simplification algorithm i found one named '*Ramer-Douglas–Peucker' (*http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm). It appears that 'Geos'' library implement this algorithm. Is thi

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Frank Warmerdam
On Tue, Feb 19, 2013 at 11:28 AM, Jeff Lacoste wrote: > Hi Frank, > > Thanks for your quick response. Following the edges of the pixels seems a > perfect solution for non continuous grid (ex. land use, etc.) as > the boundary between the class is important to keep when constructing the > polygon.

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Jeff Lacoste
Hi Frank, Thanks for your quick response. Following the edges of the pixels seems a perfect solution for non continuous grid (ex. land use, etc.) as the boundary between the class is important to keep when constructing the polygon. However for continuous grid (.ex elevations), the boundaries are a

Re: [gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Frank Warmerdam
On Tue, Feb 19, 2013 at 10:29 AM, Jeff Lacoste wrote: > Hi, > > I'm using gdal_polygonize.py to create polygon from a grid and the output > polygons seems to follow the edges > of the grid pixels. I was wondering if there is any way to change/edit the > code to instead of following the edges > of

[gdal-dev] gdal_polygonize and polygon edges

2013-02-19 Thread Jeff Lacoste
Hi, I'm using gdal_polygonize.py to create polygon from a grid and the output polygons seems to follow the edges of the grid pixels. I was wondering if there is any way to change/edit the code to instead of following the edges of the pixels, use the center of