<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16825" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>Bob,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>Does the below help any. The below will give you the
centroid of the portion of geometries that intersect a reference grid where the
grid of the reference is defined by reference.the_geom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>SELECT r.gid, r.the_geom,
ST_Centroid(ST_Collect(ST_Intersection(r.the_geom,p.the_geom))) As
the_centroid</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>FROM tblpolygons As p INNER JOIN reference As r ON
ST_Intersects(p.the_geom, r.the_geom)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>GROUP BY r.gid, r.the_geom</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>Hope that helps,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=797145403-20042009><FONT face=Arial
color=#0000ff size=2>Regina</FONT></SPAN></DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B>
postgis-users-bounces@postgis.refractions.net
[mailto:postgis-users-bounces@postgis.refractions.net] <B>On Behalf Of </B>Bob
Pawley<BR><B>Sent:</B> Sunday, April 19, 2009 1:58 PM<BR><B>To:</B> PostGIS
Users Discussion<BR><B>Subject:</B> [postgis-users] Reference
Grid<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV><FONT face=Arial size=2>Hi</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I'm using a reference grid of small
polygons.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I have been trying to collect concurrent polygons
into one geometry in order to establish the centroid of the region covered. I've
tried a number of operations such as union, contains, accum etc.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I haven't been successful.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Can anyone give me some ideas??</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Bob</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>