I used the ST_Envelope function.<div>Create a field with the X and Y column of your points, and add something like this:</div><div>ST_MakeEnvelope(xcoord-"+0.1+", ycoord-"+0.1+", xcoord+"+0.1+", ycoord+"+0.1+", 4326))<br>
<br></div><div>The above is from my python and pygresql script so ignore the syntax. However, the idea is the same if you want to create grid cells from points.</div><div><br></div><div>Andreas</div><div><br><div class="gmail_quote">
2010/10/18 Randall, Eric <span dir="ltr"><<a href="mailto:ERandall@eriecountygov.org">ERandall@eriecountygov.org</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
Hi Brent,<br>
<br>
<br>
I use something like this, should be adaptable to your use (but might not be the best way).<br>
this makes a 10000 foot sided cell, and translates it 10x and 10y.<br>
<br>
Eric<br>
<br>
<br>
<br>
select st_translate(geom, 0 ,yseries) as geom from<br>
(select generate_series(0,90000, 10000) as yseries,st_translate(geom, xseries ,0) as geom from<br>
(select  generate_series(0, 90000, 10000) as xseries, geom from<br>
(select st_envelope(st_makeline(st_makepoint(1380000,630000),st_makepoint(1390000,640000))) as geom) as t1) as t2) as t3<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a><br>
[mailto:<a href="mailto:postgis-users-bounces@postgis.refractions.net">postgis-users-bounces@postgis.refractions.net</a>]On Behalf Of<br>
<a href="mailto:pcreso@pcreso.com">pcreso@pcreso.com</a><br>
Sent: Sunday, October 17, 2010 1:39 PM<br>
To: <a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
Subject: [postgis-users] How best to build a regular grid from points<br>
<br>
<br>
Hi,<br>
<br>
I have a set of 155,000,000 points on a regular grid. I need to convert these to a set of square polygons covering the area represented by the points.<br>
<br>
Can anyone suggest how this could be done in Postgis?<br>
<br>
Thanks,<br>
<br>
  Brent Wood<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>