<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 2/3/2016 10:34 AM, Hemant Bist
wrote:<br>
</div>
<blockquote
cite="mid:CAHgSXQnDSNV6QgWpwcpmBthLFfqu2Va0XDVEEExG4buyEBsYpQ@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>...<br>
<div>I tried the simple approach of st_union grid rectangles
with st_snap_to_grid as mentioned <a moz-do-not-send="true"
href="http://gis.stackexchange.com/questions/31895/what-is-the-best-way-to-join-lots-of-small-polygons-to-form-a-larger-polygon">here</a>.</div>
<div>The problem is that the resulting polygons have zig-zag
edges. If I do st_simplify or smoothening (grass
v.generalize) I am left with polygons that are not touching
anymore (there is a gap between polygons that were touching
earlier).</div>
<br>
</div>
</div>
</blockquote>
<br>
There are those on this list that have a LOT more experience using
all the tools, but I'll provide some observations...<br>
<br>
You might get a single query to give you what you really want, but
it is likely you will need to do the transformation in steps.
Because you are massaging polygons, you may end up with a Topology
exception given specific data. Recognize it might happen and decide
how you will handle it. We ended up using almost exclusively user
defined functions to do transforms by steps and not a single query.
<br>
<br>
ST_SnapToGrid takes in varying precision on the radius. 0.0001 will
not give the same result as 0.000001.<br>
ST_Buffer can be used to grow or shrink a polygon by a set amount -
but if you grow each polygon, you'll then have overlaps that have to
be trimmed. <br>
<br>
It might be possible to SnapToGrid, then grow one polygon in a group
and let it grab all the space it overlaps with the other polygons by
using ST_Difference and ST_Intersects to trim the polygons you will
take space from - but that presumes you are "OK" with the
degradation in precision of the size of each polygon... is this for
display or analytics?<br>
<br>
Roxanne<br>
<br>
<pre class="moz-signature" cols="72">--
[At other schools] I think the most common fault in general is to teach students how to pass exams instead of teaching them the science.
Donald Knuth</pre>
</body>
</html>