[postgis-users] Reference Grid

Paragon Corporation lr at pcorp.us
Mon Apr 20 12:09:27 PDT 2009


reference was meant to be just an example table your grid is in.  If you
don't have any then you don't really need the inner join except for not
having to repeat the same static geometry twice
 
So below I defined a static geometry to represent by grid geom --
ST_Buffer(ST_Point(1,2),3)    replace this with your grid polygon
 
SELECT  ST_Centroid(ST_Collect(ST_Intersection(r.the_geom,p.the_geom))) As
the_centroid
FROM tblpolygons As p INNER JOIN (SELECT ST_Buffer(ST_Point(1,2),3) As
the_geom) As r
ON ST_Intersects(r.the_geom, p.the_geom)
 
 
 

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Monday, April 20, 2009 12:05 PM
To: PostGIS Users Discussion
Subject: Re: [postgis-users] Reference Grid


Hi Regina
 
Thanks for the help.
 
I don't understand " INNER JOIN reference As r ON".
 
I get the error - > relation "reference" does not exist.
 
It doesn't like my substitution for reference either.
 
Bob
 
Bob

----- Original Message ----- 
From: Paragon Corporation <mailto:lr at pcorp.us>  
To: 'PostGIS Users  <mailto:postgis-users at postgis.refractions.net>
Discussion' 
Sent: Sunday, April 19, 2009 8:58 PM
Subject: RE: [postgis-users] Reference Grid

Bob,
 
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
 
SELECT r.gid, r.the_geom,
ST_Centroid(ST_Collect(ST_Intersection(r.the_geom,p.the_geom))) As
the_centroid
FROM tblpolygons As p INNER JOIN reference As r ON ST_Intersects(p.the_geom,
r.the_geom)
GROUP BY r.gid, r.the_geom
 
 
Hope that helps,
Regina

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Bob
Pawley
Sent: Sunday, April 19, 2009 1:58 PM
To: PostGIS Users Discussion
Subject: [postgis-users] Reference Grid


Hi
 
I'm using a reference grid of small polygons.
 
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.
 
I haven't been successful.
 
Can anyone give me some ideas??
 
Bob
 
 
 



  _____  




_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090420/69930a01/attachment.html>


More information about the postgis-users mailing list