mentby.com
Blog | Jobs | Help | Signup | Login
loading
Hi Daniel,

Do you want regular cells or polygons?

There are a few approaches for generating voronoi polygons in Postgis:

eg: http://www.bostongis.com/PrinterFriendly.aspx?content_name=p[..] http://geogeek.garnix.org/2012/04/faster-voronoi-diagrams-in[..]

If your points already represent the centre of cells, then a fishnet approach would work, generate a mesh to match the grid, then do a spatial join on points inside cells to generate the match. You just need to know the extent & size of the grid:

http://trac.osgeo.org/postgis/wiki/UsersWikiCreateFishnet

HTH,

   Brent Wood
Thanks,

All things come to those who wait :-)

My data is 2D at present...

If I can't get thr PL/R solution working I think I'm better off waiting for GEOS 3.4/Postgis 2.1

Cheers,

  Brent
Hi,

I'm trying to come up with an approach using Postgis to come up with a polygon representing the outer bounds of a set of points, ie: a polygon passing through all the outer points.

Much useful info (as usual - thanks guys!!) at spatialdbadvisor & bostongis but my limited understanding is stalling progress for now.

I came across the ST_Concavehull() function, which fails. Indeed, I was surprised to see this actually expands the polygon extent representing the point set, as shown at: http://www.bostongis.com/postgis_concavehull.snippet  as this buffers the points in some cases, and often gives quite unexpected (to me anyway) results.

Looking for something that fits better, using existing capabilities, I figured I could pretty easily use Delaunay triangulation to create the outer hull, then realised this bridges every second outer point (pretty much by definition). That's easy, just remove any triangles from the polygon where they share a line segment with the polygon. I like Postgis!!

I have Simon's code working fine, at least using his example invocation, from: http://www.spatialdbadvisor.com/postgis_tips_tricks/290/r-ba[..]

But I can't figure out how to make it work with my point data. I don't know R or PL/R well enough to adapt it.

I have a set of sample points in a table:

  Column |      Type       |                                  
 --------+-----------------+-----------------
  id     | integer         | not null default
  geom   | geometry(Point) |

Can anyone explain, ideally in words of one syllable or less, how Simon's function from the link above needs to be adapted to read my points dataset as input?

Once I get the triangles as an output set I can use Postgis for the rest...

Thanks,

   Brent Wood